TorqueScript Reference
Public Member Functions | List of all members
TextSprite Class Reference

#include <TextSprite_ScriptBinding.h>

Inherits SceneObject.

Public Member Functions

Boolean getAutoLineHeight ()
 
String getCharacterBlendColor (index)
 
Boolean getCharacterHasBlendColor (index)
 
String getCharacterOffset (index)
 
String getCharacterScale (index)
 
Float getCustomLineHeight ()
 
String getFont ()
 
Float getFontScaleX ()
 
Float getFontScaleY ()
 
Float getFontSize ()
 
Float getKerning ()
 
String getOverflowModeX ()
 
String getOverflowModeY ()
 
String getText ()
 
String getTextAlignment ()
 
String getTextVAlignment ()
 
void resetCharacterBlendColor (index)
 
void resetCharacterOffset (index)
 
void resetCharacterScale (index)
 
void resetCharacterSettings ()
 
void setAutoLineHeight (isAuto)
 
void setCharacterBlendColor (index, color)
 
void setCharacterOffset (index, offset offsetX/offsetY)
 
void setCharacterScale (index, scale scaleX/scaleY)
 
void setCustomLineHeight (lineHeight)
 
Boolean setFont (fontAssetId)
 
void setFontScaleX (scale)
 
void setFontScaleY (scale)
 
void setFontSize (size)
 
void setKerning (kerning)
 
void setOverflowModeX (mode)
 
void setOverflowModeY (mode)
 
void setText (text)
 
void setTextAlignment (alignment)
 
void setTextVAlignment (alignment)
 
- Public Member Functions inherited from SceneObject
void addToScene (Scene scene)
 
void applyAngularImpulse (impulse)
 
void applyForce (worldForce X/Y, [worldPoint X/Y])
 
void applyLinearImpulse (worldImpulse X/Y, [worldPoint X/Y])
 
void applyTorque (torque)
 
void attachGui (guiControl guiObject, SceneWindow window, [sizeControl ?=false], [offset ?=Vector2(0, 0)])
 
void cancelFadeTo ()
 
void cancelGrowTo ()
 
void cancelMoveTo ([autoStop=true])
 
void cancelRotateTo ([autoStop=true])
 
void clearCollisionShapes ()
 
void copyAllCollisionShapes (targetObject[, clearTargetShapes?])
 
Integer copyCollisionShape (int shapeIndex, targetObject)
 
Boolean copyFrom (SceneObject object, [copyDynamicFields?=false])
 
Integer createChainCollisionShape (localPointsX/Y, [adjacentLocalPositionStartX, adjacentLocalPositionStartY], [adjacentLocalPositionEndX, adjacentLocalPositionEndY])
 
Integer createCircleCollisionShape (radius, [localPositionX, localPositionY])
 
Integer createEdgeCollisionShape (localPositionStartX, localPositionStartY, localPositionEndX, localPositionEndY, [adjacentLocalPositionStartX, adjacentLocalPositionStartY], [adjacentLocalPositionEndX, adjacentLocalPositionEndY])
 
Integer createPolygonBoxCollisionShape (width, height, [localCentroidX, localCentroidY], [angle])
 
Integer createPolygonCollisionShape (localPointsX/Y)
 
Boolean deleteCollisionShape (int shapeIndex)
 
void detachAllGuiControls ()
 
void detachGui ()
 
Boolean fadeTo (targetColor red/green/blue/alpha, rate)
 
Boolean fadeToTime (targetColor red/green/blue/alpha, time)
 
String getAABB ()
 
Boolean getActive ()
 
Float getAlphaTest ()
 
Float getAngle ()
 
Float getAngularDamping ()
 
Float getAngularVelocity ()
 
String getArea ()
 
String getAreaMax (...)
 
String getAreaMin ()
 
Boolean getAutoSizing ()
 
Boolean getAwake ()
 
Float getBlendAlpha ()
 
String getBlendColor (allowColorNames)
 
Boolean getBlendMode ()
 
String getBodyType ()
 
Boolean getBullet ()
 
String getChainCollisionShapeAdjacentEnd (int shapeIndex)
 
String getChainCollisionShapeAdjacentStart (int shapeIndex)
 
Boolean getChainCollisionShapeHasAdjacentEnd (int shapeIndex)
 
Boolean getChainCollisionShapeHasAdjacentStart (int shapeIndex)
 
String getChainCollisionShapeLocalPoint (int shapeIndex, int pointIndex)
 
Integer getChainCollisionShapePointCount (int shapeIndex)
 
String getCircleCollisionShapeLocalPosition (int shapeIndex)
 
Float getCircleCollisionShapeRadius (int shapeIndex)
 
Boolean getCollisionCallback ()
 
String getCollisionGroups ()
 
String getCollisionLayers ()
 
String getCollisionMasks (...)
 
Boolean getCollisionOneWay ()
 
Float getCollisionShapeArea (int shapeIndex)
 
Integer getCollisionShapeCount ()
 
Float getCollisionShapeDensity (int shapeIndex)
 
Float getCollisionShapeFriction (int shapeIndex)
 
Boolean getCollisionShapeIsSensor (int shapeIndex)
 
Float getCollisionShapeRestitution (int shapeIndex)
 
String getCollisionShapeType (int shapeIndex)
 
Boolean getCollisionSuppress ()
 
String getContact (contactIndex)
 
Integer getContactCount ()
 
Float getDefaultDensity ()
 
Float getDefaultFriction ()
 
Float getDefaultRestitution ()
 
String getDstBlendFactor ()
 
String getEdgeCollisionShapeAdjacentEnd (int shapeIndex)
 
String getEdgeCollisionShapeAdjacentStart (int shapeIndex)
 
Boolean getEdgeCollisionShapeHasAdjacentEnd (int shapeIndex)
 
Boolean getEdgeCollisionShapeHasAdjacentStart (int shapeIndex)
 
String getEdgeCollisionShapeLocalPositionEnd (int shapeIndex)
 
String getEdgeCollisionShapeLocalPositionStart (int shapeIndex)
 
Boolean getFixedAngle ()
 
Boolean getGatherContacts ()
 
Float getGravityScale ()
 
Float getHeight ()
 
Float getInertia ()
 
Boolean getIsPointInCollisionShape (int shapeIndex, worldPointX/Y)
 
Boolean getIsPointInOOBB (worldPointX/Y)
 
Float getLifetime ()
 
Float getLinearDamping ()
 
String getLinearVelocity ()
 
String getLinearVelocityFromLocalPoint (localPointX/Y)
 
String getLinearVelocityFromWorldPoint (worldPointX/Y)
 
String getLinearVelocityPolar ()
 
Float getLinearVelocityX ()
 
Float getLinearVelocityY ()
 
String getLocalCenter ()
 
String getLocalPoint (float worldPointX/Y)
 
String getLocalVector (float worldVectorX/Y)
 
Float getMass ()
 
Boolean getPickingAllowed ()
 
String getPolygonCollisionShapeLocalPoint (int shapeIndex, int pointIndex)
 
Integer getPolygonCollisionShapePointCount (int shapeIndex)
 
String getPosition ()
 
Float getPositionX ()
 
Float getPositionY ()
 
Float getRenderAngle ()
 
String getRenderGroup ()
 
String getRenderPosition ()
 
Integer getScene ()
 
Integer getSceneGroup ()
 
Integer getSceneLayer ()
 
Float getSceneLayerDepth ()
 
String getSize ()
 
Float getSizeX ()
 
Float getSizeY ()
 
Boolean getSleepingAllowed ()
 
Boolean getSleepingCallback ()
 
String getSortPoint ()
 
Float getSortPointX ()
 
Float getSortPointY ()
 
Integer getSoundatIndex ()
 
Integer getSoundsCount ()
 
String getSrcBlendFactor ()
 
Boolean getUpdateCallback ()
 
Boolean getUseInputEvents ()
 
Boolean getVisible ()
 
Float getWidth ()
 
String getWorldCenter ()
 
String getWorldPoint (float localPointX/Y)
 
String getWorldVector (float localVectorX/Y)
 
Boolean growTo (targetSize width/height, rate rateX/rateY)
 
Boolean growToTime (targetSize width/height, time)
 
Boolean isFadeToComplete ()
 
Boolean isGrowToComplete ()
 
Boolean isMoveToComplete ()
 
Boolean isRotateToComplete ()
 
Boolean moveTo (worldPoint X/Y, speed, [autoStop=true], [snapToTarget=true], [margin=0.1])
 
Integer playSound ()
 
void removeFromScene ()
 
Boolean rotateTo (angle, speed, [autoStop=true], [warpToTarget=true])
 
void safeDelete ()
 
void setActive ([bool status?])
 
void setAlphaTest (float alpha)
 
void setAngle (float angle)
 
void setAngularDamping (float damping)
 
void setAngularVelocity (float velocity)
 
void setArea (float x1, float y1, float x2, float y2)
 
void setAwake ([bool status?])
 
void setBlendAlpha (float alpha)
 
void setBlendColor (float red, float green, float blue, [float alpha=1.0])
 
void setBlendMode (bool blendMode)
 
void setBodyType (bodyType type)
 
void setBullet ([bool status?])
 
void setCollisionAgainst (SceneObject object, [clearMasks?=false])
 
void setCollisionCallback ([bool status?])
 
void setCollisionGroups (groups)
 
void setCollisionLayers (layers)
 
void setCollisionMasks (groupMask, [layerMask])
 
void setCollisionOneWay ([bool status?])
 
void setCollisionShapeDensity (int shapeIndex, float density)
 
void setCollisionShapeFriction (int shapeIndex, float friction)
 
void setCollisionShapeIsSensor (int shapeIndex, bool status)
 
void setCollisionShapeRestitution (int shapeIndex, float restitution)
 
void setCollisionSuppress ([bool status?])
 
void setDebugOff (debugOptions)
 
void setDebugOn (debugOptions)
 
void setDefaultDensity (float density, [bool updateShapes])
 
void setDefaultFriction (float friction, [bool updateShapes])
 
void setDefaultRestitution (float restitution, [bool updateShapes])
 
void setDstBlendFactor (dstBlend)
 
void setEnabled (bool status)
 
void setFixedAngle (bool status?)
 
void setGatherContacts (bool gatherContacts)
 
void setGravityScale (float scale)
 
void setHeight (float height)
 
void setLifetime (float lifetime)
 
void setLinearDamping (float damping)
 
void setLinearVelocity (float velocityX, float velocityY)
 
void setLinearVelocityPolar (float angle, float speed)
 
void setLinearVelocityX (float velocityX)
 
void setLinearVelocityY (float velocityY)
 
void setPickingAllowed (bool pickingAllowed)
 
void setPosition (float x, float y)
 
void setPositionX (float x)
 
void setPositionY (float y)
 
void setRenderGroup (renderGroup)
 
void setSceneGroup (integer group)
 
void setSceneLayer (integer layer)
 
void setSceneLayerDepth (float layerDepth)
 
Boolean setSceneLayerDepthBack ()
 
Boolean setSceneLayerDepthBackward ()
 
Boolean setSceneLayerDepthForward ()
 
Boolean setSceneLayerDepthFront ()
 
void setSize (float width, float height)
 
void setSizeX (float width)
 
void setSizeY (float height)
 
void setSleepingAllowed ([bool status?])
 
void setSleepingCallback ([bool status?])
 
void setSortPoint (float x, float y)
 
void setSortPointX (float x)
 
void setSortPointY (float y)
 
void setSrcBlendFactor (srcBlend)
 
void setUpdateCallback ([bool status?])
 
void setUseInputEvents (bool inputStatus)
 
void setVisible (bool status)
 
void setWidth (float width)
 
void stopSound (S32 index)
 
- Public Member Functions inherited from BehaviorComponent
Boolean addBehavior (BehaviorInstance bi)
 
void clearBehaviors ()
 
Boolean connect (outputBehavior, inputBehavior, outputName, inputName)
 
Boolean disconnect (outputBehavior, inputBehavior, outputName, inputName)
 
Integer getBehavior (string BehaviorTemplateName)
 
Integer getBehaviorByIndex (int index)
 
String getBehaviorConnection (outputBehavior, outputName, connectionIndex)
 
Integer getBehaviorConnectionCount (outputBehavior, outputName)
 
Integer getBehaviorCount ()
 
Boolean raise (outputBehavior, outputName, [deltaTime])
 
Boolean removeBehavior (BehaviorInstance bi, [bool deleteBehavior=true])
 
Boolean reOrder (BehaviorInstance inst, [int desiredIndex=0])
 
- Public Member Functions inherited from DynamicConsoleMethodComponent
String callOnBehaviors (methodName, argi)
 
- Public Member Functions inherited from SimComponent
Boolean addComponents (compObjName, compObjName2,...)
 
Integer getComponent (idx)
 
Integer getComponentCount ()
 
Boolean isEnabled ()
 
Boolean removeComponents (compObjName, compObjName2,...)
 
void setEnabled (enabled)
 
- Public Member Functions inherited from SimObject
void assignFieldsFrom (SimObject)
 
Integer clone ([copyDynamicFields=false]?)
 
void delete ()
 
Integer getId ()
 
void setName (newName)
 
String getName ()
 
String getClassNamespace ()
 
String getSuperClassNamespace ()
 
void setClassNamespace (nameSpace)
 
void setSuperClassNamespace ()
 
Boolean isMethod (string methodName)
 
String call (methodName, [args] *)
 
void dumpClassHierarchy ()
 
void dump ()
 
Boolean isMemberOfClass (string classname)
 
String getClassName ()
 
String getFieldValue (fieldName)
 
Boolean setFieldValue (fieldName, value)
 
Boolean setEditFieldValue (fieldName, value)
 
Integer getDynamicFieldCount ()
 
String getDynamicField (index)
 
Integer getFieldCount ()
 
String getField (int index)
 
void setProgenitorFile (file)
 
String getProgenitorFile ()
 
Integer getType ()
 
String getFieldType (fieldName)
 
void setInternalName (string InternalName)
 
String getInternalName ()
 
Boolean isChildOfGroup (groupID)
 
Integer getGroup ()
 
Boolean startTimer (callbackFunction, float timePeriod, [repeat]?)
 
void stopTimer ()
 
Boolean isTimerActive ()
 
Integer schedule (time, command, [arg] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Member Function Documentation

◆ getAutoLineHeight()

Boolean getAutoLineHeight ( )

Gets whether the line height is automatically calculated.

Returns
True if the line height is automatically calculated or false if the custom line height is used.

◆ getCharacterBlendColor()

String getCharacterBlendColor ( index  )

Gets the blend color for an individual character if set or the blend color for the sprite.

Parameters
indexThe zero based index for the character.
Returns
The blend color for the character or the sprite.

◆ getCharacterHasBlendColor()

Boolean getCharacterHasBlendColor ( index  )

Gets if the character is using a custom blend color.

Parameters
indexThe zero based index for the character.
Returns
True if the character is using a custom blend color or false if the character uses the sprite's blend color.

◆ getCharacterOffset()

String getCharacterOffset ( index  )

Gets offset of a given character.

Parameters
indexThe zero based index for the character.
Returns
(offsetX / offsetY) The offset of the character.

◆ getCharacterScale()

String getCharacterScale ( index  )

Gets scale of a given character.

Parameters
indexThe zero based index for the character.
Returns
(scaleX / scaleY) The scale of the character.

◆ getCustomLineHeight()

Float getCustomLineHeight ( )

Gets the custom line height.

Returns
The distance between the top and the bottom of a line.

◆ getFont()

String getFont ( )

Gets current font asset..

Returns
The current font asset.

◆ getFontScaleX()

Float getFontScaleX ( )

Gets the scale of the font in the X direction.

Returns
The scale of the of the font in the X direction.

◆ getFontScaleY()

Float getFontScaleY ( )

Gets the scale of the font in the Y direction.

Returns
The scale of the of the font in the Y direction.

◆ getFontSize()

Float getFontSize ( )

Gets the size of the font.

Returns
The size of the font.

◆ getKerning()

Float getKerning ( )

Gets the kerning amount.

Returns
The amount each character is moved closer together.

◆ getOverflowModeX()

String getOverflowModeX ( )

Gets the overflow mode X.

Returns
The overflow mode X of 'wrap', 'visible', 'hidden', or 'shrink'.

◆ getOverflowModeY()

String getOverflowModeY ( )

Gets the overflow mode Y.

Returns
The overflow mode Y of 'visible', 'hidden', or 'shrink'.

◆ getText()

String getText ( )

Gets the text being rendered.

◆ getTextAlignment()

String getTextAlignment ( )

Gets the horizontal text alignment.

Returns
The text alignment of 'left', 'center', 'right', or 'justify'.

◆ getTextVAlignment()

String getTextVAlignment ( )

Gets the vertical text alignment.

Returns
The vertical text alignment of 'top', 'middle', or 'bottom'.

◆ resetCharacterBlendColor()

void resetCharacterBlendColor ( index  )

Resets the blend color for a character so that it uses the sprite's blend color.

Parameters
indexThe zero based index for the character.
Returns
No return value.

◆ resetCharacterOffset()

void resetCharacterOffset ( index  )

Resets the offset of a given character.

Parameters
indexThe zero based index for the character.
Returns
No return value.

◆ resetCharacterScale()

void resetCharacterScale ( index  )

Resets the scale of a given character.

Parameters
indexThe zero based index for the character.
Returns
No return value.

◆ resetCharacterSettings()

void resetCharacterSettings ( )

Resets the blend color, scale, and offset for all characters'.

Returns
No return value.

◆ setAutoLineHeight()

void setAutoLineHeight ( isAuto  )

Sets if the line height should be automatically calculated.

Parameters
isAutoTrue if the line height automatically calculated or false to use the custom line height.
Returns
No return value.

◆ setCharacterBlendColor()

void setCharacterBlendColor ( index  ,
color   
)

Sets the blend color for an individual character.

Parameters
indexThe zero based index for the character.
colorThe blend color to use for character.
Returns
No return value.

◆ setCharacterOffset()

void setCharacterOffset ( index  ,
offset offsetX/  offsetY 
)

Sets the offset of a given character.

Parameters
indexThe zero based index for the character.
(offsetX/ offsetY) The amount to move a character from it's calculated position.
Returns
No return value.

◆ setCharacterScale()

void setCharacterScale ( index  ,
scale scaleX/  scaleY 
)

Sets the scale of a given character. This is multiplied by the scale of the font to get the total scale.

Parameters
indexThe zero based index for the character.
(scaleX/ scaleY) The amount to multiply the size of the character by. Default value is 1.
Returns
No return value.

◆ setCustomLineHeight()

void setCustomLineHeight ( lineHeight  )

Sets the custom line height and disables the auto line height.

Parameters
lineHeightThe distance between the top and the bottom of a line before adjusting by the fontScaleY.
Returns
No return value.

◆ setFont()

Boolean setFont ( fontAssetId  )

Sets the image asset to use..

Parameters
fontNameThe font asset to use.
Returns
Returns true on success.

◆ setFontScaleX()

void setFontScaleX ( scale  )

Sets the scale of the font in the X direction.

Parameters
scaleThe amount to multiply the width of the text by.
Returns
No return value.

◆ setFontScaleY()

void setFontScaleY ( scale  )

Sets the scale of the font in the Y direction.

Parameters
scaleThe amount to multiply the height of the text by.
Returns
No return value.

◆ setFontSize()

void setFontSize ( size  )

Sets the size of the font.

Parameters
sizeThe distance between the top of a line of text and the bottom.
Returns
No return value.

◆ setKerning()

void setKerning ( kerning  )

Sets kerning to be used between each character. Kerning is ignored when using alignment of 'justify'.

Parameters
kerningThe amount to decrease the distance by between each character. Positive valus move the characters closer together and negative values move them apart.
Returns
No return value.

◆ setOverflowModeX()

void setOverflowModeX ( mode  )

Sets the overflow mode X to 'wrap', 'visible', 'hidden', or 'shrink'.

Parameters
modeThe overflow mode X of 'wrap', 'visible', 'hidden', or 'shrink'.
Returns
No return value.

◆ setOverflowModeY()

void setOverflowModeY ( mode  )

Sets the overflow mode Y to 'visible', 'hidden', or 'shrink'.

Parameters
modeThe overflow mode Y of 'visible', 'hidden', or 'shrink'.
Returns
No return value.

◆ setText()

void setText ( text  )

Sets the text to render.

◆ setTextAlignment()

void setTextAlignment ( alignment  )

Sets the horizontal text alignment to 'left', 'center', 'right', or 'justify'.

Parameters
alignmentThe text alignment of 'left', 'center', 'right', or 'justify'.
Returns
No return value.

◆ setTextVAlignment()

void setTextVAlignment ( alignment  )

Sets the vertical text alignment to 'top', 'middle', or 'bottom'.

Parameters
alignmentThe vertical text alignment of 'top', 'middle', or 'bottom'.
Returns
No return value.