|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpslib.GenericParticle
pslib.DynamicParticle
pslib.TextParticle
public class TextParticle
TextParticle Class
The TextParticle class extends the functionality of the DynamicParticle class by allowing text to be rendered at the particle location.
This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.
Field Summary |
---|
Fields inherited from interface pslib.PSConstants |
---|
CAM2D_LOOK, CAM2D_RIGHT, CAM2D_UP, CORNER, INVERSE, INVERSE_TRIANGULAR, LEADING, LINEAR, MIDPOINT, NONE, STATIC, TRAILING, TRIANGULAR |
Constructor Summary | |
---|---|
TextParticle(java.lang.String f,
int s)
Create a new object instance with the specified variables |
|
TextParticle(java.lang.String f,
int s,
boolean aa,
boolean mm,
int d)
Create a new object instance with the specified variables |
|
TextParticle(java.lang.String f,
int s,
int d)
Create a new object instance with the specified variables |
Method Summary | |
---|---|
DynamicParticle |
copy()
Return a copy of this particle |
PSVector |
getTextBounds()
Return a vector containing the size of the text bounding box |
com.sun.opengl.util.j2d.TextRenderer |
getTextRenderer()
Return a reference to the TextRenderer object employed by this particle |
void |
render(processing.opengl.PGraphicsOpenGL pgl)
Render the text to the specified OpenGL renderer |
void |
render(processing.opengl.PGraphicsOpenGL pgl,
PSVector cpv,
PSVector ctv,
PSVector cuv)
Render the text to the specified OpenGL renderer |
void |
setAnchorPoint(int a)
Set the text anchor point (CORNER/MIDPOINT) |
void |
setOffset(PSVector v)
Set the text offset vector |
void |
setSmoothing(boolean s)
Enable/disable smoothing |
void |
setText(java.lang.String t)
Set the text string |
Methods inherited from class pslib.DynamicParticle |
---|
clearBehaviour, debug, debug, getBehaviour, getDecay, getDecayTime, getInitialDecayTime, getMass, getRenderAlpha, getRenderSize, getSnapshot, isDead, isDynamic, map, setAlphaEnvelope, setBehaviour, setBehaviour, setDecayTime, setMass, setSizeEnvelope, update |
Methods inherited from class pslib.GenericParticle |
---|
getAlpha, getColour, getPosition, getSize, getVelocity, setAlpha, setColour, setColour, setPosition, setSize, setVelocity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextParticle(java.lang.String f, int s)
f
- fonts
- font sizepublic TextParticle(java.lang.String f, int s, int d)
f
- fonts
- font sized
- decay time (ms);public TextParticle(java.lang.String f, int s, boolean aa, boolean mm, int d)
f
- fonts
- font sizeaa
- anti-aliasingmm
- mipmap generationd
- decay time (ms)Method Detail |
---|
public final void setText(java.lang.String t)
t
- text stringpublic final PSVector getTextBounds()
The bounding box differs from the rendered size, this should be calculated by scaling the returned vector by the value returned from getSize().
public final com.sun.opengl.util.j2d.TextRenderer getTextRenderer()
public final void setOffset(PSVector v)
The text offset vector specifies an offset for the render location. By default the value is (0, 0, 0) resulting in the midpoint of the text being aligned to the location vector.
v
- public final void setAnchorPoint(int a)
The anchor point defines the point of the text bounding box that is used as the origin prior to translation. The MIDPOINT value uses the midpoint of the bounding box, whilst the CORNER value uses the lower left corner.
Default: CORNER
a
- anchor pointpublic final void setSmoothing(boolean s)
s
- smoothingpublic void render(processing.opengl.PGraphicsOpenGL pgl)
render
in class DynamicParticle
pgl
- OpenGL rendererpublic void render(processing.opengl.PGraphicsOpenGL pgl, PSVector cpv, PSVector ctv, PSVector cuv)
render
in class DynamicParticle
pgl
- OpenGL renderercpv
- camera position vectorctv
- camera target vectorcuv
- camera up vectorpublic DynamicParticle copy()
copy
in class DynamicParticle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |