|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrita.RiObject
rita.RiText
public class RiText
RiTa's text display object. Wraps an instance of RiString to provide utility methods for typography, display, animation, text-to-speech, and audio playback.
Note: by default, RiText objects, once created, will draw themselves to the screen at each frame until they are either a) deleted (via RiText.delete(myRiText);) or b) hidden (via myRiText.setVisible(false);). To disable this behavior (and draw the objects manually), one can call disableAutoDraw().
An example usage:
import rita.*;
void setup() {
// start in the upper left corner
RiText rt = new RiText(this, "hello", 0, 10);
// measure the width of the text
float tw = rt.textWidth();
// move to the lower right over 2 sec
rt.moveTo(width-tw, height, 2);
}
void draw() {
// draw the bg every frame
background(255);
}
| Field Summary | |
|---|---|
static boolean |
DBUG_INFO
|
static java.lang.String |
DEFAULT_FONT
|
static int |
DEFAULT_MOTION_TYPE
|
int |
motionType
|
float |
rotateX
|
float |
rotateY
|
float |
rotateZ
|
RiSample |
sample
Current Sample object for this text |
float |
scaleX
|
float |
scaleY
|
float |
scaleZ
|
float |
x
Current x-position of this text |
float |
y
Current y-position of this text |
float |
z
Current z-position of this text |
| Fields inherited from interface processing.core.PConstants |
|---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
| Constructor Summary | |
|---|---|
RiText(processing.core.PApplet pApplet)
|
|
RiText(processing.core.PApplet pApplet,
char character)
|
|
RiText(processing.core.PApplet pApplet,
char character,
float startXPos,
float startYPos)
|
|
RiText(processing.core.PApplet pApplet,
float startXPos,
float startYPos)
|
|
RiText(processing.core.PApplet pApplet,
java.lang.String text)
|
|
RiText(processing.core.PApplet pApplet,
java.lang.String text,
float startXPos,
float startYPos)
|
|
RiText(processing.core.PApplet pApplet,
java.lang.String text,
float xPos,
float yPos,
int alignment)
|
|
RiText(processing.core.PApplet pApplet,
java.lang.String text,
float xPos,
float yPos,
int alignment,
processing.core.PFont theFont)
Creates a new RiText object base-aligned at x='xPos', y='yPos', with 'alignment' from one of (LEFT, CENTER, RIGHT), using font specified by 'theFont'. |
|
RiText(processing.core.PApplet pApplet,
java.lang.String text,
float startXPos,
float startYPos,
processing.core.PFont font)
|
|
| Method Summary | |
|---|---|
RiTextBehavior |
addBehavior(RiTextBehavior behavior)
Add a new behavior to this RiText's run queue |
void |
addFeature(java.lang.CharSequence name,
java.lang.CharSequence value)
Adds a feature (a key-value pair) to the RiText. |
void |
appendFeature(java.lang.String name,
java.lang.String value)
See rita.support.feature.Featured#appendFeature(java.lang.String, java.lang.String) |
void |
boundingBoxFill(float gray)
|
void |
boundingBoxFill(float[] color)
Set the current boundingBoxFill color for this object, applicable only when showBoundingBox(true) has been called. |
void |
boundingBoxFill(float gray,
float alpha)
|
void |
boundingBoxFill(float r,
float g,
float b)
|
void |
boundingBoxFill(float r,
float g,
float b,
float alpha)
Set the bounding-box (or background) color for this object |
float |
boundingBoxPadding()
Returns the bounding box padding |
void |
boundingBoxPadding(float padding)
Sets min padding (in pixels) around all sides of text in bounding box (default=1) |
void |
boundingBoxStroke(float gray)
|
void |
boundingBoxStroke(float[] color)
Set the current boundingBoxStroke color for this object, applicable only when showBoundingBox(true) has been called. |
void |
boundingBoxStroke(float gray,
float alpha)
|
void |
boundingBoxStroke(float r,
float g,
float b)
|
void |
boundingBoxStroke(float r,
float g,
float b,
float alpha)
Set the stroke color for the bounding-box of this object, assuming it has been set to visible. |
float |
boundingBoxStrokeWeight()
Returns the bounding box stroke weight |
void |
boundingBoxStrokeWeight(float r)
Set the current bgstroke weight for this object |
char |
charAt(int index)
Returns the character at the specified index |
void |
clearFeatures()
Clears all the features (key-value pairs) for the RiText |
int |
compareTo(java.lang.Object arg0)
|
int |
compareTo(java.lang.String anotherString)
|
int |
compareToIgnoreCase(java.lang.String str)
|
void |
completeBehaviors()
Immediately marks all Behaviors in the RiText's run queue as complete and causes them to fire their behaviorCompleted() methods. |
java.lang.String |
concat(java.lang.String str)
|
boolean |
contains(java.lang.CharSequence s)
|
boolean |
contains(float mx,
float my)
Checks if the input point is inside the bounding box |
boolean |
contains3D(float mx,
float my)
Checks if the input point is inside the object's bounding box after converting its x,y,z coordinates to screen x & y. |
RiText |
copy()
Returns a field for field copy of this object |
static RiText |
copy(RiText toCopy)
Returns a field for field copy of toCopy |
static processing.core.PFont |
createDefaultFont(processing.core.PApplet p,
java.lang.String fontName,
float fontSize)
Sets the default font for all RiTexts to be created (via PApplet.createFont(String)). |
static void |
createDefaultFont(java.lang.String fontName,
float fontSize)
Deprecated. |
void |
createFont(java.lang.String fontName,
float sz)
Creates (and caches) the font for this object from a System font (via PApplet.createFont()). |
RiLerpBehavior |
createLerp(processing.core.PApplet pApplet)
|
RiLerpBehavior |
createLerp(processing.core.PApplet pApplet,
float start,
float target,
float durationSec)
|
RiLerpBehavior |
createLerp(processing.core.PApplet pApplet,
float start,
float target,
float startOffsetSec,
float durationSec)
Creates and returns a new behavior that interpolates between 2 values, 'start' and 'target', and generates a callback to pApplet.onRiTaEvent(RiTaEvent) when finished. |
static RiText[] |
createLetters(processing.core.PApplet pApplet,
processing.core.PFont theFont,
java.lang.String theText,
int startX,
int startY)
Creates an array of RiTexts, one per letter, with appropriate x and y positions for each (using the 'font' specified), starting at 'xStart' and 'yStart'. |
static RiText[] |
createLetters(processing.core.PApplet pApplet,
java.lang.String theText,
int startX,
int startY)
Creates an array of RiTexts, one per letter, with appropriate x and y positions for each (using the default 'font'), starting at 'xStart' and 'yStart'. |
static RiText[] |
createLines(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String text,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiText, one per line of input 'text', constrained to the 'maxChars' specified, starting with upper left corner at 'startX' and 'startY'. |
static RiText[] |
createLines(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String text,
java.awt.Rectangle rectangle)
Creates an array of RiText, one per line from the input String, and lays it out according to the rectangle (and font) specified. |
static RiText[] |
createLines(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String text,
java.awt.Rectangle rectangle,
float leading)
Creates an array of RiText, one per line from the input String, and lays it out according to the rectangle (and font/leading) specified. |
static RiText[] |
createLines(processing.core.PApplet pApplet,
java.lang.String[] text,
float startX,
float startY)
|
static RiText[] |
createLines(processing.core.PApplet pApplet,
java.lang.String[] text,
float startX,
float startY,
int maxCharsPerLine)
|
static RiText[] |
createLines(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates a RiText[] from the lines, re-formatting lines
according to maxCharsPerLine (using the specified 'font'). |
static RiText[] |
createLines(processing.core.PApplet p,
java.lang.String text,
float startX,
float startY)
|
static RiText[] |
createLines(processing.core.PApplet p,
java.lang.String text,
float startX,
float startY,
int maxCharsPerLine)
|
static RiText[] |
createLines(processing.core.PApplet pApplet,
java.lang.String text,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiText, one per line of input 'text', constrained to the 'maxChars' specified, starting with upper left corner at 'startX' and 'startY'. |
static RiText[] |
createLines(processing.core.PApplet pApplet,
java.lang.String text,
java.awt.Rectangle rectangle)
Creates an array of RiText, one per line from the input String, and lays it out according to the rectangle specified. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String fileName,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiText from the file specified by 'fileName', one per line of input text, constrained to the 'maxChars' specified, starting with upper left corner at 'startX' and 'startY'. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String fileName,
java.awt.Rectangle rectangle)
Creates an array of RiTexts, one per line from the input file, and lays it out according to the rectangle specified. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String fileName,
java.awt.Rectangle rectangle,
float leading)
Creates an array of RiTexts, one per line from the input file, and lays it out according to the rectangle specified. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
float startX,
float startY,
int maxCharsPerLine)
Creates an array of RiText from the file specified by 'fileName', one per line of input text, constrained to the 'maxChars' specified, starting with upper left corner at 'startX' and 'startY'. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiText from the file specified by 'fileName', one per line of input text, constrained to the 'maxChars' specified, starting with upper left corner at 'startX' and 'startY', using the 'leading' specified. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
int x,
int y)
Creates an array of RiText from the file specified by 'fileName', one per line of input text, starting with upper left corner at 'startX' and 'startY'. |
static RiText[] |
createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
java.awt.Rectangle rectangle)
Creates an array of RiTexts, one per line from the input file, and lays it out according to the rectangle specified. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String[] lines,
float startX,
float startY)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the specified 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the specified 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String[] words,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiTexts laid out in lines, one per array element, with one RiText for each of 'words', with x-spacing determined by the specified 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String input,
float startX,
float startY)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the specified 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the specified 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String input,
java.awt.Rectangle rectangle)
|
static RiText[] |
createWords(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String input,
java.awt.Rectangle rectangle,
float leading)
|
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the default 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the default 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the default 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String input,
float startX,
float startY)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the default 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String lines,
float startX,
float startY,
int maxCharsPerLine)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the default 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
Creates an array of RiTexts laid out in lines, with one RiText for each word of input, with x-spacing determined by the default 'font'. |
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String input,
java.awt.Rectangle rectangle)
|
static RiText[] |
createWords(processing.core.PApplet pApplet,
java.lang.String input,
java.awt.Rectangle rectangle,
float leading)
|
static void |
delete(java.util.List l)
Deletes all objects in the List. |
static void |
delete(RiText rt)
Call to remove a RiText from the current sketch (and from existence), cleaning up whatever resources it may have held |
static void |
delete(RiText[] c)
Deletes all objects in the array (and the array itself) |
static void |
deleteAll()
Deletes all current instances. |
static void |
disableAutoDraw()
Disables auto-drawing of subsequently created RiTexts. Note: draw() must be explicitly called on these objects. |
static void |
disableBehaviorWarnings()
Turns off warnings about conflicting or non-terminating behaviors. |
void |
dispose()
To be called only by AppletContainer on destroy, not by users! |
float |
distanceTo(RiText riText)
Returns the distance between the center points of the two RiTexts. |
void |
draw()
Draw the RiText object at current x,y,color,font,alignment, etc. |
void |
draw(processing.core.PGraphics p)
Draw the RiText object at current x,y,color,font,alignment, etc. |
static void |
drawAll()
Draws all (visible) RiText objects |
static void |
drawAll(processing.core.PGraphics p)
Draws all (visible) RiText objects |
boolean |
endsWith(java.lang.String suffix)
|
boolean |
equalsIgnoreCase(java.lang.String anotherString)
|
static void |
fadeAllIn(float seconds)
Fades in all RiText objects over the specified duration |
static void |
fadeAllOut(float seconds)
Fades all visible RiText objects. |
int |
fadeColor(float[] color,
float seconds)
|
int |
fadeColor(float[] color,
float startTime,
float seconds)
Transitions to 'color' (rgba) over 'seconds' starting at 'startTime' seconds in the future |
int |
fadeColor(float gray,
float seconds)
|
int |
fadeColor(float r,
float g,
float b,
float a,
float seconds)
Transitions to 'color' (rgba) over 'seconds' starting at 'startTime' seconds in the future |
int |
fadeIn(float seconds)
|
int |
fadeIn(float startTime,
float seconds)
Fades in current text over seconds starting at
startTime. |
int |
fadeOut(float seconds)
|
int |
fadeOut(float seconds,
boolean removeOnComplete)
|
int |
fadeOut(float startTime,
float seconds)
|
int |
fadeOut(float startTime,
float seconds,
boolean removeOnComplete)
Fades out current text over seconds starting at
startTime. |
int |
fadeToText(java.lang.String newText,
float seconds)
Fades out the current text and fades in the newText over
seconds starting immediately |
int |
fadeToText(java.lang.String newText,
float startTime,
float seconds)
Fades out the current text and fades in the newText over
seconds starting at 'startTime' seconds in the future |
void |
fill(float gray)
|
void |
fill(float[] color)
|
void |
fill(float gray,
float alpha)
|
void |
fill(float r,
float g,
float b)
|
void |
fill(float r,
float g,
float b,
float alpha)
Set the text fill for this object (same as setColor()) |
void |
fillHex(int hexColor)
Sets the text fill color according to a single hex number. |
int |
firstIndexOf(java.lang.String word)
|
float |
getAlpha()
Returns the fill alpha value (transparency) |
java.util.Set |
getAvailableFeatures()
Returns a Set of all the available feature keys for the RiText |
static RiTextBehavior |
getBehaviorById(int id)
Returns the behavior corresponding to the specified 'id'. |
java.util.List |
getBehaviors()
Returns a list of behaviors for the object. |
RiTextBehavior[] |
getBehaviorsByType(int type)
Returns a list of behaviors of the specified type for this object, where type is generally one of (MOVE, FADE_IN, FADE_OUT, FADE_TO_TEXT, SCALE_TO, etc.) |
java.awt.geom.Rectangle2D |
getBoundingBox()
Returns a rectangle representing the current screen position of the bounding box |
float[] |
getBoundingBoxFill()
Returns the current bounding box fill color for this object |
float[] |
getBoundingBoxStroke()
Returns the current bounding box stroke color for this object |
java.awt.geom.Point2D |
getCenter()
Returns the point representing the center of the RiText |
float[] |
getColor()
Returns the current text color for this object |
static processing.core.PFont |
getDefaultFont(processing.core.PApplet pApplet)
Returns the current default font. |
java.lang.String |
getFeature(java.lang.CharSequence name)
Returns the String value for the given feature |
java.util.Map |
getFeatures()
Returns a Map of all the features (key-value pairs) exists for this RiText |
processing.core.PFont |
getFont()
Return the current font for this object |
float |
getImageHeight()
Returns the height of the image associated with this RiText |
float |
getImageWidth()
Returns the width of the image associated with this RiText |
static RiText[] |
getInstances()
Returns all existing instances of RiText objects in an array |
int |
getMotionType()
Returns the motionType for this object, |
static int |
getNumInstances()
Returns the number of existing RiTexts |
processing.core.PApplet |
getPApplet()
|
static RiText[] |
getPicked(float x,
float y)
Returns all RiTexts that contain the point x,y or null if none do. |
java.lang.String |
getPos()
Returns the part-of-speech tags, one per word, separated by WORD_BOUNDARY, using the default Tokenizer & Poart-of-speech tagger. |
java.lang.String |
getPos(boolean useWordNetTags)
See rita.RiString#getPos(java.lang.String) |
java.lang.String[] |
getPosArr()
See rita.RiString#getPos() |
java.lang.String[] |
getPosArr(boolean useWordNetTags)
See rita.RiString#getPos() |
java.lang.String |
getPosAt(int wordIdx)
See rita.RiString#getPosAt(int) |
java.lang.String |
getPosAt(int wordIdx,
boolean useWordNetTags)
See rita.RiString#getPosAt(int) |
float[] |
getPosition()
Returns a 2 or 3-dimensional array with the objects x,y, or x,y,z position (depending on the renderer) |
RiSample |
getSample()
Returns the RiSample object associated with this RiText |
float[] |
getScale()
Returns a 3-dimensional array with the objects x,y,z scale (1=100% or unscaled) |
java.lang.String |
getText()
Returns the current text |
int |
getTextAlignment()
Returns the current alignment (default=LEFT) |
int |
getWordCount()
See rita.RiString#getWordCount() |
java.lang.String[] |
getWords()
See rita.RiString#getWords() |
float |
getX()
Gets the current x-position of the RiText |
float |
getY()
Gets the current y-position of the RiText |
float |
getZ()
Returns the z position for this object |
boolean |
hasFeature(java.lang.CharSequence name)
Checks whether the named feature (key-value pair) exists for this RiText |
int |
indexOf(int ch)
|
int |
indexOf(int ch,
int fromIndex)
|
int |
indexOf(java.lang.String str)
See rita.RiString#indexOf(java.lang.String) |
int |
indexOf(java.lang.String str,
int fromIndex)
|
boolean |
insertAt(int idx,
java.lang.String toInsert)
Inserts the 'toInsert' String at the desired character index ('idx'). |
boolean |
insertCharAt(int idx,
char toInsert)
Inserts the character at the specified character index ('idx'). |
boolean |
insertWordAt(java.lang.String newWord,
int wordIdx)
|
boolean |
isBoundingBoxVisible()
Returns the visibility of the objects bounding box (default=false) |
boolean |
isMouseDraggable()
Returns true if the object has been set to be draggable by the mouse |
boolean |
isOffscreen()
Returns true if the object is offscreen |
boolean |
isOffscreen(processing.core.PGraphics p)
Returns true if the object is offscreen |
boolean |
isShowingBoundingBox()
|
boolean |
isVisible()
Returns true if the objects is not hidden |
int |
lastIndexOf(int ch)
|
int |
lastIndexOf(int ch,
int fromIndex)
|
int |
lastIndexOf(java.lang.String str)
|
int |
lastIndexOf(java.lang.String str,
int fromIndex)
|
int |
length()
Returns number of characters in the contained String |
processing.core.PFont |
loadFont(java.lang.String fontFileName)
Returns the font specified after loading it and setting it as the the current font. |
processing.core.PFont |
loadFont(java.lang.String fontFileName,
float size)
Returns the font specified after loading it and setting the current font size. |
RiSample |
loadSample(java.lang.String sampleFileName)
|
RiSample |
loadSample(java.lang.String sampleFileName,
boolean setLooping)
|
RiSample |
loadSample(java.lang.String sampleFileName,
int playerType)
|
RiSample |
loadSample(java.lang.String sampleFileName,
int playerType,
boolean setLooping)
Loads a sample file and returns the appropriate type of RiSample object according to the library specified in playerType (defaults to
Minim). |
static RiText[] |
loadStrings(processing.core.PApplet p,
java.lang.String fileName)
Creates an array of RiText from a file, by delegating to PApplet.loadStrings(), then creating one array element per line (including blanks). |
static void |
main(java.lang.String[] args)
|
boolean |
matches(java.lang.String regex)
See rita.RiString#matches(java.lang.String) |
void |
mouseEvent(java.awt.event.MouseEvent e)
|
int |
moveBy(float[] posOffset,
float startTime,
float seconds)
Move to new position by x,y offset over the duration specified by 'seconds'. |
int |
moveBy(float xOffset,
float yOffset,
float seconds)
Move to new position by x,y offset over the duration specified by 'seconds'. |
int |
moveBy(float xOffset,
float yOffset,
float startTime,
float seconds)
Move to new position by x,y offset over the duration specified by 'seconds', starting at 'startTime' seconds in the future |
int |
moveBy3D(float xOffset,
float yOffset,
float zOffset,
float seconds)
Move to new position by x,y,z offset over the duration specified by 'seconds'. |
int |
moveBy3D(float xOffset,
float yOffset,
float zOffset,
float startTime,
float seconds)
Move to new position by x,y,z offset over the duration specified by 'seconds'. |
int |
moveTo(float[] newPosition,
float startTime,
float seconds)
Move to new absolute x,y (or x,y,z) position over 'time' seconds |
int |
moveTo(float newX,
float newY,
float seconds)
Move to new absolute x,y (or x,y,z) position over 'time' seconds |
int |
moveTo(float newX,
float newY,
float startTime,
float seconds)
Move to new absolute x,y (or x,y,z) position over 'time' seconds |
int |
moveTo3D(float newX,
float newY,
float newZ,
float seconds)
Move to new position by x,y,z over the duration specified by 'seconds'. |
int |
moveTo3D(float newX,
float newY,
float newZ,
float startTime,
float seconds)
Move to new position by x,y,z over the duration specified by 'seconds'. |
static void |
pauseAllBehaviors(boolean paused)
Immediately pauses all Behaviors in the RiText's run queue |
void |
pauseBehaviors(boolean paused)
Pauses (or unpauses) all Behaviors in the RiText's run queue |
static RiText[] |
popArray(RiText[] rts)
Pops the last value off the array, deletes it, and returns the new array (shortened by one element). |
float |
positionForChar(int charIdx)
Returns the x-position (in pixels) for the character at 'charIdx'. |
float |
positionForChar(processing.core.PFont pf,
int charIdx)
Returns the x-position (in pixels) for the character at 'charIdx'. |
static boolean |
regexMatch(java.lang.String patternStr,
java.lang.String fullStr)
Utility method to test whether a String partially matches a regex pattern. |
static java.lang.String |
regexReplace(java.lang.String patternStr,
java.lang.String fullStr,
java.lang.String replaceStr)
Utility method to do regex replacement on a String |
boolean |
regionMatches(boolean ignoreCase,
int toffset,
java.lang.String other,
int ooffset,
int len)
|
static void |
removeAll()
Deprecated. |
static void |
removeAll(java.util.List c)
Deprecated. |
static void |
removeAll(RiText[] c)
Deprecated. |
void |
removeBehavior(RiTextBehavior behavior)
Remove a Behavior from the RiText's run queue |
void |
removeBehaviors()
Remove all Behaviors from the RiText's run queue |
boolean |
removeCharAt(int idx)
Deletes the character at at the specified character index ('idx'). |
void |
removeFeature(java.lang.CharSequence name)
Clears the entry for the named feature (a key-value pair) |
void |
render()
Override in subclasses to do custom rendering |
void |
render(processing.core.PGraphics p)
Override in subclasses to do custom rendering |
java.lang.String |
replace(char oldChar,
char newChar)
|
java.lang.String |
replace(java.lang.CharSequence target,
java.lang.CharSequence replacement)
See rita.RiString#replace(java.lang.CharSequence, java.lang.CharSequence) |
void |
replace(java.lang.String oldText,
java.lang.String newText)
See rita.RiString#replace(java.lang.String, java.lang.String) |
java.lang.String |
replaceAll(java.lang.String regex,
java.lang.String replacement)
See rita.RiString#replaceAll(java.lang.String, java.lang.String) |
java.lang.String |
replaceByPos(java.lang.String newWord,
java.lang.String pos)
|
boolean |
replaceCharAt(int idx,
char replaceWith)
Replaces the character at the specified character index ('idx') with the 'replaceWith' character. |
boolean |
replaceCharAt(int idx,
java.lang.String replaceWith)
Replaces the character at 'idx' with 'replaceWith'. |
java.lang.String |
replaceFirst(java.lang.String regex,
java.lang.String replacement)
|
boolean |
replaceWordAt(java.lang.String newWord,
int wordIdx)
See rita.RiString#replaceWordAt(java.lang.String, int) |
void |
rotate(float rotate)
Rotate the object via affine transform. |
void |
rotateX(float rotate)
Sets the x-rotation for the object |
void |
rotateY(float rotate)
Sets the y-rotation for the object |
void |
rotateZ(float rotate)
Sets the z-rotation for the object |
void |
scale(float scale)
Uniformly scales the object on all dimensions (x,y,z) |
void |
scale(float[] scales)
Scales the object on either 2 or 3 dimensions (x,y,[z]) |
void |
scale(float sX,
float sY,
float sZ)
Scales the object on all dimensions (x,y,z) |
int |
scaleTo(float newScale,
float seconds)
Scales object to 'newScale' over 'time' seconds, starting immediately. |
int |
scaleTo(float newScale,
float startTime,
float seconds)
Scales object to 'newScale' over 'time' seconds, starting at 'startTime' seconds in the future |
int |
scaleTo(float scaleX,
float scaleY,
float scaleZ,
float seconds)
Scales object to {scaleX, scaleY, scaleZ} over 'time' seconds. |
int |
scaleTo(float newScaleX,
float newScaleY,
float newScaleZ,
float startTime,
float seconds)
Scales object to {scaleX, scaleY, scaleZ} over 'time' seconds, starting at 'startTime' seconds in the future. |
void |
scaleX(float scale)
Sets the x-scale for the object |
void |
scaleY(float scale)
Sets the y-scale for the object |
void |
scaleZ(float scale)
Sets the z-scale for the object |
void |
setAlpha(float alpha)
Set the current alpha trasnparency for this object (0-255)) |
void |
setAutoDraw(boolean b)
Enables/disables auto-drawing for this object |
static void |
setBoundingBoxesVisible(boolean visible)
Deprecated. |
static void |
setBoundingBoxStrokeWeights(float strokeWeight)
Deprecated. see setDefaultBBoxStrokeWeight(float) |
RiTextBehavior |
setCallbackTimer(float seconds)
Deprecated. |
RiTextBehavior |
setCallbackTimer(float seconds,
boolean repeat)
Deprecated. |
void |
setColor(float[] color)
Set the text color for this object |
static void |
setDefaultAlignment(int defaultAlignment)
Sets the default alignment for all RiTexts to be created. |
static void |
setDefaultBBoxFill(float[] fillColor)
Set the bounding box fill color for all RiTexts to be created; |
static void |
setDefaultBBoxFill(float r,
float g,
float b,
float a)
Set the bounding box fill color for all RiTexts to be created; |
static void |
setDefaultBBoxStroke(float[] strokeColor)
Set the bounding box stroke color for all RiTexts to be created; |
static void |
setDefaultBBoxStroke(float r,
float g,
float b,
float a)
Set the bounding box fill color for all RiTexts to be created; |
static void |
setDefaultBBoxStrokeWeight(float strokeWeight)
Set the default bounding box strokeweight for all RiTexts to be created. |
static void |
setDefaultBBoxVisibility(boolean show)
Sets the default behavior regarding whether newly created RiTexts are to display their bounding boxes Note: this does not affect already created RiText objects |
static void |
setDefaultColor(float gray)
|
static void |
setDefaultColor(float[] color)
Sets the default color for all (subsequently) created RiTexts. |
static void |
setDefaultColor(float gray,
float alpha)
|
static void |
setDefaultColor(float r,
float g,
float b)
|
static void |
setDefaultColor(float r,
float g,
float b,
float alpha)
Sets the default color for all RiTexts to be created. |
static void |
setDefaultFont(java.lang.String defaultFontName)
Sets the default font for all RiTexts to be created (via PApplet.loadFont(String)). |
static void |
setDefaultMotionType(int defaultMotionType)
Sets the default motion type for all (subsequently) created RiTexts. |
static void |
setDefaultMouseDraggable(boolean draggable)
Sets the default behavior regarding whether newly created RiTexts are to be mouse-draggable Note: this does not affect already created RiText objects |
void |
setFeatures(java.util.Map features)
Replaces all the features (key-value pairs) for the RiText with those in features |
static void |
setFont(processing.core.PFont pfont)
Deprecated. |
static void |
setFont(java.lang.String fontName)
Deprecated. |
static void |
setFontSize(float fontSize)
Deprecated. |
void |
setMotionType(int motionType)
Sets the animation motionType for this for moveTo() or
moveBy() methods on this object, set via one of the following constants: RiText.LINEAR RiText.EASE_IN RiText.EASE_OUT RiText.EASE_IN_OUT RiText.EASE_IN_OUT_CUBIC RiText.EASE_IN_CUBIC RiText.EASE_OUT_CUBIC; RiText.EASE_IN_OUT_QUARTIC RiText.EASE_IN_QUARTIC RiText.EASE_OUT_QUARTIC; RiText.EASE_IN_OUT_SINE RiText.EASE_IN_SINE RiText.EASE_OUT_SINE |
void |
setMouseDraggable(boolean mouseDraggable)
Sets the object's draggable state (default=false) |
void |
setPosition(float x,
float y)
Sets the position for the current RiText |
void |
setPosition(float x,
float y,
float z)
Sets the 3d position for the current RiText |
void |
setString(java.lang.CharSequence[] words)
|
void |
setString(java.lang.String newWord)
|
void |
setText(char ch)
Sets the current text to the character |
void |
setText(java.lang.String _text)
Sets the current text to this String |
static void |
setTextAlignment(int alignment)
Deprecated. |
void |
setVisible(boolean visible)
Sets boolean flag to show or hide the object |
void |
setX(float x)
Sets the x-position of the current RiText |
void |
setY(float y)
Sets the y-position of the current RiText |
void |
setZ(float z)
Sets the z position for this object |
static RiText[] |
shiftArray(RiText[] rts)
Shifts the first value off the array, deletes it, and returns the new array (shortened by one element). |
void |
showBoundingBox(boolean showBoundingBox)
Sets the visibility of the objects bounding box (default=false) |
static void |
showBoundingBoxes(boolean visible)
Deprecated. |
RiText[] |
splitLetters()
Splits the current object into an array of RiTexts, one per letter, maintaining the x and y position of each. |
RiText[] |
splitLetters(processing.core.PFont pf)
Splits the current object into an array of RiTexts, one per letter, maintaining the x and y position of each. |
RiText[] |
splitWords()
Splits this object into an array of RiTexts, one per word, with correct x and y-positions. |
boolean |
startsWith(java.lang.String prefix)
|
boolean |
startsWith(java.lang.String prefix,
int toffset)
|
java.lang.CharSequence |
subSequence(int start,
int end)
Returns a new character sequence that is a subsequence of this sequence. |
java.lang.String |
substring(int beginIndex)
|
java.lang.String |
substring(int beginIndex,
int endIndex)
|
void |
textAlign(int alignment)
Sets text mode for RiText object. |
void |
textFont(processing.core.PFont pf)
|
void |
textFont(processing.core.PFont pf,
float size)
Sets the font and size for this object's text |
float |
textHeight()
Returns the height for the current font in pixels (including ascendors and descendors) |
void |
textMode(int alignment)
Sets text mode for RiText object. |
float |
textSize()
Gets the current text size |
void |
textSize(float textSize)
Sets the object to this size |
float |
textWidth()
Returns the current text width in pixels |
static RiText[] |
toArray(java.util.List result)
Converts and returns a list of RiTexts as a RiText[] |
char[] |
toCharArray()
|
java.lang.String |
toLowerCase()
|
java.lang.String |
toLowerCase(java.util.Locale locale)
|
java.lang.String |
toString()
|
java.lang.String |
toUpperCase()
|
java.lang.String |
toUpperCase(java.util.Locale locale)
|
java.lang.String |
trim()
|
void |
updateBehaviors()
|
| Methods inherited from class rita.RiObject |
|---|
getId, nextId |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String DEFAULT_FONT
public static int DEFAULT_MOTION_TYPE
public static boolean DBUG_INFO
public RiSample sample
public int motionType
public float scaleX
public float scaleY
public float scaleZ
public float rotateX
public float rotateY
public float rotateZ
public float x
public float y
public float z
| Constructor Detail |
|---|
public RiText(processing.core.PApplet pApplet)
public RiText(processing.core.PApplet pApplet,
java.lang.String text)
public RiText(processing.core.PApplet pApplet,
char character)
public RiText(processing.core.PApplet pApplet,
float startXPos,
float startYPos)
public RiText(processing.core.PApplet pApplet,
char character,
float startXPos,
float startYPos)
public RiText(processing.core.PApplet pApplet,
java.lang.String text,
float startXPos,
float startYPos)
public RiText(processing.core.PApplet pApplet,
java.lang.String text,
float startXPos,
float startYPos,
processing.core.PFont font)
public RiText(processing.core.PApplet pApplet,
java.lang.String text,
float xPos,
float yPos,
int alignment)
public RiText(processing.core.PApplet pApplet,
java.lang.String text,
float xPos,
float yPos,
int alignment,
processing.core.PFont theFont)
| Method Detail |
|---|
public RiLerpBehavior createLerp(processing.core.PApplet pApplet,
float start,
float target,
float startOffsetSec,
float durationSec)
pApplet - The parent applet to call back tostart - the start valuetarget - the target valuestartOffsetSec - Time before the timer starts (in seconds)durationSec - The timer's period (in seconds)RiLerpBehavior.getValue()
public RiLerpBehavior createLerp(processing.core.PApplet pApplet,
float start,
float target,
float durationSec)
public RiLerpBehavior createLerp(processing.core.PApplet pApplet)
public java.awt.geom.Point2D getCenter()
public static processing.core.PFont getDefaultFont(processing.core.PApplet pApplet)
Note: This method may create one or more objects so should be used sparingly.
public float boundingBoxStrokeWeight()
public float boundingBoxPadding()
public void fill(float r,
float g,
float b,
float alpha)
r - red component (0-255)g - green component (0-255)b - blue component (0-255)alpha - transparency (0-255)public void fill(float gray)
public void fill(float gray,
float alpha)
public void fill(float r,
float g,
float b)
public void fill(float[] color)
public void fillHex(int hexColor)
public void setColor(float[] color)
r - red component (0-255)g - green component (0-255)b - blue component (0-255)alpha - transparency (0-255)
public void boundingBoxFill(float r,
float g,
float b,
float alpha)
r - red component (0-255)g - green component (0-255)b - blue component (0-255)alpha - transparency (0-255)public void boundingBoxFill(float[] color)
showBoundingBox(true) has been called.
public void boundingBoxFill(float gray)
public void boundingBoxFill(float gray,
float alpha)
public void boundingBoxFill(float r,
float g,
float b)
public void boundingBoxStroke(float r,
float g,
float b,
float alpha)
r - red component (0-255)g - green component (0-255)b - blue component (0-255)alpha - transparency (0-255)showBoundingBox(boolean),
showBoundingBoxes(boolean)public void boundingBoxStroke(float gray)
public void boundingBoxStroke(float gray,
float alpha)
public void boundingBoxStroke(float r,
float g,
float b)
public float[] getColor()
public float[] getBoundingBoxFill()
public float[] getBoundingBoxStroke()
public void boundingBoxStroke(float[] color)
showBoundingBox(true) has been called.
public void setAlpha(float alpha)
alpha - public float getAlpha()
public boolean contains(float mx,
float my)
public boolean contains3D(float mx,
float my)
PApplet.screenX(float, float, float),
PApplet.screenY(float, float, float)public void draw()
NOTE: called automatically unless disabled
disableAutoDraw()public void draw(processing.core.PGraphics p)
draw()public void render()
Note: It is preferable to override this method rather than the draw() method in subclasses to ensure proper maintenance of contained objects.
public void render(processing.core.PGraphics p)
Note: It is preferable to override this method rather than the draw() method in subclasses to ensure proper maintenance of contained objects.
public void dispose()
dispose in class RiObjectpublic RiText copy()
public static void delete(RiText rt)
public void mouseEvent(java.awt.event.MouseEvent e)
public float textWidth()
public float textHeight()
public void setMotionType(int motionType)
motionType for this for moveTo() or
moveBy() methods on this object, set via one of the following constants:
motionType - public int getMotionType()
motionType for this object,
public RiTextBehavior setCallbackTimer(float seconds)
Generates a single callback to onRiTaEvent() after the amount of time
specifed in seconds.
public RiTextBehavior setCallbackTimer(float seconds,
boolean repeat)
Generates a callback to onRiTaEvent() after the amount of time specifed in
seconds. Will repeat indefinitely if repeat is
set to true (default=true).
public int moveTo(float newX,
float newY,
float seconds)
Note: uses the current motionType for this object.
public int moveTo(float newX,
float newY,
float startTime,
float seconds)
Note: uses the current motionType for this object, starting at
'startTime' seconds in the future
public int moveTo(float[] newPosition,
float startTime,
float seconds)
Note: uses the current motionType for this object, starting at
'startTime' seconds in the future
setMotionType(int)
public int moveTo3D(float newX,
float newY,
float newZ,
float startTime,
float seconds)
Note: uses the current motionType for this object.
setMotionType(int)
public int moveTo3D(float newX,
float newY,
float newZ,
float seconds)
Note: uses the current motionType for this object.
setMotionType(int)
public int moveBy(float xOffset,
float yOffset,
float startTime,
float seconds)
public int moveBy(float xOffset,
float yOffset,
float seconds)
public int moveBy(float[] posOffset,
float startTime,
float seconds)
Note: uses the current motionType for this object.
setMotionType(int)
public int moveBy3D(float xOffset,
float yOffset,
float zOffset,
float seconds)
Note: uses the current motionType for this object.
setMotionType(int)
public int moveBy3D(float xOffset,
float yOffset,
float zOffset,
float startTime,
float seconds)
Note: uses the current motionType for this object.
setMotionType(int)public boolean isOffscreen()
public boolean isOffscreen(processing.core.PGraphics p)
public int scaleTo(float newScale,
float startTime,
float seconds)
Note: uses linear interpolation unless otherwise specified. Returns the Id of the RiTextBehavior object used for the scale.
public int scaleTo(float newScale,
float seconds)
Note: uses linear interpolation unless otherwise specified. Returns the Id of the RiTextBehavior object used for the scale.
public int scaleTo(float scaleX,
float scaleY,
float scaleZ,
float seconds)
public int scaleTo(float newScaleX,
float newScaleY,
float newScaleZ,
float startTime,
float seconds)
Returns the Id of the RiTextBehavior object used for the scale. Note: uses linear interpolation unless otherwise specified.
public int fadeIn(float startTime,
float seconds)
seconds starting at
startTime. Interpolates from the current color {r,g,b,a} to
{r,g,b,255}.
startTime - time in future to startseconds - time for fade
public int fadeIn(float seconds)
public int fadeOut(float startTime,
float seconds,
boolean removeOnComplete)
seconds starting at
startTime. Interpolates from the current color {r,g,b,a} to
{r,g,b,0}.
startTime - time in future to startseconds - time for faderemoveOnComplete - destroys the object when the behavior completes
public int fadeOut(float startTime,
float seconds)
public int fadeOut(float seconds,
boolean removeOnComplete)
public int fadeOut(float seconds)
public int fadeColor(float r,
float g,
float b,
float a,
float seconds)
seconds - time for fade
public int fadeColor(float[] color,
float seconds)
public int fadeColor(float gray,
float seconds)
public int fadeColor(float[] color,
float startTime,
float seconds)
startTime - time in future to startseconds - time for fade
public int fadeToText(java.lang.String newText,
float seconds)
newText over
seconds starting immediately
public int fadeToText(java.lang.String newText,
float startTime,
float seconds)
newText over
seconds starting at 'startTime' seconds in the future
newText - to be faded instartTime - # of seconds in the future that the fade will startseconds - time for fade
public static void setBoundingBoxStrokeWeights(float strokeWeight)
setDefaultBBoxStrokeWeight(float)
public static void setDefaultBBoxStrokeWeight(float strokeWeight)
public static void setDefaultBBoxStroke(float[] strokeColor)
public static void setDefaultBBoxStroke(float r,
float g,
float b,
float a)
public static void setDefaultBBoxFill(float[] fillColor)
public static void setDefaultBBoxFill(float r,
float g,
float b,
float a)
public static void deleteAll()
public static void removeAll(RiText[] c)
delete(RiText[])public static void removeAll(java.util.List c)
delete(List)public static void removeAll()
deleteAll()public static void delete(RiText[] c)
public static void delete(java.util.List l)
public static void setFont(processing.core.PFont pfont)
pfont - textFont(PFont),
setDefaultFont(String)public static void setFontSize(float fontSize)
fontSize - loadFont(String, float)public static void setBoundingBoxesVisible(boolean visible)
public static void showBoundingBoxes(boolean visible)
setDefaultBBoxVisibility(boolean)public static void setTextAlignment(int alignment)
alignment - textAlign(int)public static void setFont(java.lang.String fontName)
setDefaultFont(String)public static RiText[] getInstances()
public static RiText[] getPicked(float x,
float y)
Note: this will return an array even if only one item is picked, therefore, you should generally use it as follows:
RiText picked = null; RiText[] rts = RiText.getPicked(mx, my); if (rts != null) picked = rts[0];
public static void fadeAllOut(float seconds)
public static void fadeAllIn(float seconds)
public RiSample loadSample(java.lang.String sampleFileName,
int playerType,
boolean setLooping)
playerType (defaults to
Minim). Starts the sample looping if setLooping is true
RiConstants.MINIM,
RiConstants.ESS,
RiConstants.SONIA
public RiSample loadSample(java.lang.String sampleFileName,
boolean setLooping)
public RiSample loadSample(java.lang.String sampleFileName,
int playerType)
public RiSample loadSample(java.lang.String sampleFileName)
public processing.core.PFont getFont()
public void textFont(processing.core.PFont pf,
float size)
public void textFont(processing.core.PFont pf)
public processing.core.PFont loadFont(java.lang.String fontFileName)
public processing.core.PFont loadFont(java.lang.String fontFileName,
float size)
public void createFont(java.lang.String fontName,
float sz)
PApplet.createFont(String, float)public void boundingBoxStrokeWeight(float r)
public void boundingBoxPadding(float padding)
public float textSize()
public void textSize(float textSize)
public java.lang.String getText()
getText in interface FeaturedIFpublic void setText(java.lang.String _text)
public void setVisible(boolean visible)
public void setText(char ch)
public java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic float getX()
public void setX(float x)
public float getY()
public void setY(float y)
public boolean isVisible()
public RiSample getSample()
public float getImageHeight()
public float getImageWidth()
public void updateBehaviors()
public RiTextBehavior addBehavior(RiTextBehavior behavior)
public void removeBehavior(RiTextBehavior behavior)
public void completeBehaviors()
behaviorCompleted() methods.
public void pauseBehaviors(boolean paused)
public void removeBehaviors()
public void setPosition(float x,
float y)
public void setPosition(float x,
float y,
float z)
public boolean isBoundingBoxVisible()
public void showBoundingBox(boolean showBoundingBox)
public java.util.List getBehaviors()
public RiTextBehavior[] getBehaviorsByType(int type)
public static RiTextBehavior getBehaviorById(int id)
public boolean isMouseDraggable()
public void setMouseDraggable(boolean mouseDraggable)
public int getTextAlignment()
public void textAlign(int alignment)
alignment - (CENTER, RIGHT, LEFT[default])textAlign(int)public void textMode(int alignment)
alignment - (CENTER, RIGHT, LEFT[default])textAlign(int)public java.awt.geom.Rectangle2D getBoundingBox()
public static RiText[] toArray(java.util.List result)
public RiText[] splitWords()
To split into words, according to the default tokenizer, use RiTa.tokenize(String).
Note: If desired, the original RiText should be deleted explicitly (via RiText.delete(originalRiText)).
public int length()
length in interface java.lang.CharSequencepublic float positionForChar(int charIdx)
pf -
public float positionForChar(processing.core.PFont pf,
int charIdx)
pf - public processing.core.PApplet getPApplet()
getPApplet in class RiObjectpublic static void pauseAllBehaviors(boolean paused)
public static RiText[] loadStrings(processing.core.PApplet p,
java.lang.String fileName)
fileName - located in data directory
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
float startX,
float startY,
int maxCharsPerLine)
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
int x,
int y)
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String fileName,
float startX,
float startY,
int maxCharsPerLine,
float leading)
leading - pixels to add between lines (defaults to 1/2 the font-height)
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
float startX,
float startY,
int maxCharsPerLine,
float leading)
public static RiText[] createLines(processing.core.PApplet pApplet,
java.lang.String text,
float startX,
float startY,
int maxCharsPerLine,
float leading)
public static RiText[] createLines(processing.core.PApplet p,
java.lang.String text,
float startX,
float startY)
public static RiText[] createLines(processing.core.PApplet p,
java.lang.String text,
float startX,
float startY,
int maxCharsPerLine)
public static RiText[] createLines(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String text,
float startX,
float startY,
int maxCharsPerLine,
float leading)
startX - x-position for 1st line of textstartY - x-position for 1st line of textleading - # of pixels to add between lines in addition to the textAscent
(defaults to ~2x the textAscent of the current font)
public static RiText[] createLines(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
lines, re-formatting lines
according to maxCharsPerLine (using the specified 'font').
public static RiText[] createLines(processing.core.PApplet pApplet,
java.lang.String[] text,
float startX,
float startY)
public static RiText[] createLines(processing.core.PApplet pApplet,
java.lang.String[] text,
float startX,
float startY,
int maxCharsPerLine)
public static RiText[] createLetters(processing.core.PApplet pApplet,
java.lang.String theText,
int startX,
int startY)
public static RiText[] createLetters(processing.core.PApplet pApplet,
processing.core.PFont theFont,
java.lang.String theText,
int startX,
int startY)
public static RiText[] createLines(processing.core.PApplet pApplet,
java.lang.String text,
java.awt.Rectangle rectangle)
public static RiText[] createLines(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String text,
java.awt.Rectangle rectangle)
public static RiText[] createLines(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String text,
java.awt.Rectangle rectangle,
float leading)
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
java.lang.String fileName,
java.awt.Rectangle rectangle)
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String fileName,
java.awt.Rectangle rectangle)
public static RiText[] createLinesFromFile(processing.core.PApplet pApplet,
processing.core.PFont pf,
java.lang.String fileName,
java.awt.Rectangle rectangle,
float leading)
public static RiText[] popArray(RiText[] rts)
If there are no elements in the array, the original array is returned unchanged.
public static RiText[] shiftArray(RiText[] rts)
If there are no elements in the array, the original array is returned unchanged.
public RiText[] splitLetters()
public RiText[] splitLetters(processing.core.PFont pf)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String lines,
float startX,
float startY,
int maxCharsPerLine)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine,
float leading)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String[] lines,
float startX,
float startY)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String[] lines,
float startX,
float startY,
int maxCharsPerLine)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String[] lines,
float startX,
float startY)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String input,
float startX,
float startY)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String input,
java.awt.Rectangle rectangle)
public static RiText[] createWords(processing.core.PApplet pApplet,
java.lang.String input,
java.awt.Rectangle rectangle,
float leading)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String input,
java.awt.Rectangle rectangle)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String input,
java.awt.Rectangle rectangle,
float leading)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont pfont,
java.lang.String input,
float startX,
float startY)
public static RiText[] createWords(processing.core.PApplet pApplet,
processing.core.PFont font,
java.lang.String[] words,
float startX,
float startY,
int maxCharsPerLine,
float leading)
maxCharsPerLine - set to -1 to use line breaks specified in linesarrayleading - # of pixels to add between lines in addition to the textAscent
(defaults to ~2x the textAscent of the current font)
public void setAutoDraw(boolean b)
disableAutoDraw()public static void disableAutoDraw()
draw() must be explicitly called on these objects.
public static java.lang.String regexReplace(java.lang.String patternStr,
java.lang.String fullStr,
java.lang.String replaceStr)
patternStr - regexfullStr - String to checkreplaceStr - String to insertPattern
public static boolean regexMatch(java.lang.String patternStr,
java.lang.String fullStr)
patternStr - regex StringfullStr - String to checkPatternpublic static void setDefaultFont(java.lang.String defaultFontName)
Returns the PFont in case it is needed.
PApplet.loadFont(String)
public static void createDefaultFont(java.lang.String fontName,
float fontSize)
Note: this is generally a bad idea for web applets as the user's machine must have the specified font for the sketch to function.
createDefaultFont(PApplet, String, float)
public static processing.core.PFont createDefaultFont(processing.core.PApplet p,
java.lang.String fontName,
float fontSize)
Note: this is not a good idea for web-applets as the user's machine must have the specified font.
Note: same PApplet#createDefaultFont(String, float) but also returns the created font.
PApplet.createFont(String, float)public static void setDefaultBBoxVisibility(boolean show)
public static void setDefaultMouseDraggable(boolean draggable)
draggable -
public static void setDefaultColor(float r,
float g,
float b,
float alpha)
public static void setDefaultColor(float gray)
public static void setDefaultColor(float gray,
float alpha)
public static void setDefaultColor(float r,
float g,
float b)
public static void setDefaultAlignment(int defaultAlignment)
defaultAlignment - *public static void setDefaultMotionType(int defaultMotionType)
setMotionType(int)public float[] getPosition()
public float[] getScale()
public static void drawAll(processing.core.PGraphics p)
public static void drawAll()
public void addFeature(java.lang.CharSequence name,
java.lang.CharSequence value)
addFeature in interface FeaturedIFpublic void setFeatures(java.util.Map features)
features
setFeatures in interface FeaturedIFpublic boolean hasFeature(java.lang.CharSequence name)
hasFeature in interface FeaturedIFpublic void clearFeatures()
clearFeatures in interface FeaturedIFpublic java.util.Set getAvailableFeatures()
getAvailableFeatures in interface FeaturedIFpublic java.lang.String getFeature(java.lang.CharSequence name)
getFeature in interface FeaturedIFpublic java.util.Map getFeatures()
getFeatures in interface FeaturedIFpublic void removeFeature(java.lang.CharSequence name)
removeFeature in interface FeaturedIFpublic char charAt(int index)
charAt in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start,
int end)
An invocation of this method of the form
behaves in exactly the same way as the invocationstr.subSequence(begin, end)
str.substring(begin, end)
subSequence in interface java.lang.CharSequencepublic static void setDefaultColor(float[] color)
public static int getNumInstances()
public float getZ()
public void setZ(float z)
public void appendFeature(java.lang.String name,
java.lang.String value)
public int compareTo(java.lang.Object arg0)
public int compareTo(java.lang.String anotherString)
public int compareToIgnoreCase(java.lang.String str)
public java.lang.String concat(java.lang.String str)
public boolean contains(java.lang.CharSequence s)
public boolean endsWith(java.lang.String suffix)
public boolean equalsIgnoreCase(java.lang.String anotherString)
public int firstIndexOf(java.lang.String word)
public java.lang.String[] getPosArr(boolean useWordNetTags)
public java.lang.String[] getPosArr()
public java.lang.String getPos()
public java.lang.String getPos(boolean useWordNetTags)
public java.lang.String getPosAt(int wordIdx,
boolean useWordNetTags)
public java.lang.String getPosAt(int wordIdx)
public int getWordCount()
public java.lang.String[] getWords()
public int indexOf(int ch,
int fromIndex)
public int indexOf(int ch)
public int indexOf(java.lang.String str,
int fromIndex)
public int indexOf(java.lang.String str)
public boolean insertWordAt(java.lang.String newWord,
int wordIdx)
public int lastIndexOf(int ch,
int fromIndex)
public int lastIndexOf(int ch)
public int lastIndexOf(java.lang.String str,
int fromIndex)
public int lastIndexOf(java.lang.String str)
public boolean matches(java.lang.String regex)
public boolean regionMatches(boolean ignoreCase,
int toffset,
java.lang.String other,
int ooffset,
int len)
public java.lang.String replace(char oldChar,
char newChar)
public java.lang.String replace(java.lang.CharSequence target,
java.lang.CharSequence replacement)
public void replace(java.lang.String oldText,
java.lang.String newText)
public java.lang.String replaceAll(java.lang.String regex,
java.lang.String replacement)
public java.lang.String replaceByPos(java.lang.String newWord,
java.lang.String pos)
pos and
replaces a random one with newWord. Returns the
replaced word, or null if if no substitution could be made.
public java.lang.String replaceFirst(java.lang.String regex,
java.lang.String replacement)
public boolean replaceWordAt(java.lang.String newWord,
int wordIdx)
public void setString(java.lang.CharSequence[] words)
public void setString(java.lang.String newWord)
public boolean startsWith(java.lang.String prefix,
int toffset)
public boolean startsWith(java.lang.String prefix)
public java.lang.String substring(int beginIndex,
int endIndex)
public java.lang.String substring(int beginIndex)
public char[] toCharArray()
public java.lang.String toLowerCase()
public java.lang.String toLowerCase(java.util.Locale locale)
public java.lang.String toUpperCase()
public java.lang.String toUpperCase(java.util.Locale locale)
public java.lang.String trim()
public void rotateZ(float rotate)
public void rotate(float rotate)
public void rotateX(float rotate)
public void rotateY(float rotate)
public void scaleX(float scale)
public void scaleY(float scale)
public void scaleZ(float scale)
public void scale(float scale)
public void scale(float sX,
float sY,
float sZ)
public void scale(float[] scales)
public float distanceTo(RiText riText)
public boolean removeCharAt(int idx)
public boolean replaceCharAt(int idx,
char replaceWith)
If the specified 'idx' is less than zero, or beyond the length of the current text, there will be no effect. Returns true if the replacement was made
public boolean insertCharAt(int idx,
char toInsert)
public boolean insertAt(int idx,
java.lang.String toInsert)
public boolean replaceCharAt(int idx,
java.lang.String replaceWith)
public static void disableBehaviorWarnings()
public boolean isShowingBoundingBox()
public static RiText copy(RiText toCopy)
toCopy
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||