Property | Type | Description | |
---|---|---|---|
alignment | Alignment_Type | ||
anchor | Anchor_Pos | ||
characterSize | float | ||
characterSpacing | float | ||
color | Color | ||
dynamicLength | bool | ||
font | |||
hideAtStart | bool | ||
ignoreClipping | bool | ||
lineSpacing | float | ||
maskingCharacter | string | ||
maxWidth | float | ||
multiline | bool | ||
offsetZ | float | ||
parseColorTags | bool | ||
password | bool | ||
persistent | bool | ||
pixelPerfect | bool | ||
removeUnsupportedCharacters | bool | ||
renderCamera | Camera | ||
tabSize | int | ||
text | string |
Property | Type | Description | |
---|---|---|---|
UVs | Vector2[] | ||
capacity | int | ||
clipped | bool | ||
clippingRect | Rect3D | ||
colDel | string[] | ||
colors | Color[] | ||
commaDelimiter | char[] | ||
displayString | string | ||
faces | int[] | ||
lineSpaceSize | float | ||
localClipRect | Rect | ||
m_awake | bool | ||
m_hidden | bool | ||
m_started | bool | ||
mesh | Mesh | ||
meshColors | Color[] | ||
meshFilter | |||
meshRenderer | |||
meshString | string | ||
mirror | SpriteTextMirror, | ||
newLineDelimiter | char[] | ||
newLineInserts | List |
||
oldMesh | Mesh | ||
plainText | string | ||
screenPlacer | EZScreenPlacement, | ||
screenSize | Vector2 | ||
spriteFont | SpriteFont, | ||
stringContentChanged | bool | ||
tabSpaces | string | ||
texture | Texture | ||
topLeft | Vector3 | ||
totalWidth | float | ||
unclippedTL | Vector3 | ||
updateClipping | bool | ||
updateColors | bool | ||
vertices | Vector3[] | ||
worldUnitsPerScreenPixel | float | ||
worldUnitsPerTexel | float | ||
worldUnitsPerUV | Vector2 |
Method | Description | |
---|---|---|
CalcSize ( ) : void | ||
Copy ( SpriteText, s ) : void |
Duplicates the settings of another SpriteText object.
|
|
Delete ( ) : void |
Call Delete() before destroying this component or the GameObject to which it is attached. Memory leaks can ensue otherwise.
|
|
DisplayIndexToPlainIndex ( int dispCharIndex ) : int |
Converts a character index in the display text string to a corresponding index in the plain text string.
|
|
DoMirror ( ) : void | ||
GetCenterPoint ( ) : Vector3 |
Gets the center point of the text's extents in local space.
|
|
GetDisplayLineCount ( ) : int |
Returns the number of lines actually being displayed, as opposed to the number of lines in the string assigned to the object. In other words, if word-wrapping is being used, the number of actual lines displayed may be more than the number of lines in the actual string.
|
|
GetDisplayLineCount ( int charIndex, int &charLine, int &lineStart, int &lineEnd ) : int |
Returns the number of lines actually being displayed, as opposed to the number of lines in the string assigned to the object. In other words, if word-wrapping is being used, the number of actual lines displayed may be more than the number of lines in the actual string. It also stores the line number of the character at the specified index in the string.
|
|
GetInsertionPointPos ( int charIndex ) : Vector3 |
Returns the position, in world space, of the insertion point relative to a specified character (specified by index). The position returned is at the left edge of, and the baseline of, the specified character.
|
|
GetNearestInsertionPoint ( Vector3 point ) : int |
Returns both the world-space position of the insertion point most nearly matching the specified point, as well as the index of the character to the left of which the insertion point corresponds.
|
|
GetNearestInsertionPointPos ( Vector3 point, int &insertionPt ) : Vector3 |
Returns both the world-space position of the insertion point most nearly matching the specified point, as well as the index of the character to the left of which the insertion point corresponds.
|
|
GetScreenWidth ( string s ) : float |
Returns the width, in screen pixels, of the specified string were it to be rendered using the current font and settings. NOTE: Assumes the string is a single line.
|
|
GetVertices ( ) : Vector3[] |
Returns a reference to the text's vertices.
|
|
GetWidth ( string s ) : float |
Returns the width, in world units, of the specified string were it to be rendered using the current font and settings. NOTE: Assumes the string is a single line.
|
|
Hide ( bool tf ) : void |
Hides or displays the text by disabling/enabling the mesh renderer component.
|
|
IsHidden ( ) : bool |
Returns whether the text is currently set to be hidden (whether its mesh renderer component is enabled).
|
|
OnDestroy ( ) : void | ||
OnDrawGizmos ( ) : void | ||
OnDrawGizmosSelected ( ) : void | ||
OnEnable ( ) : void | ||
PixelCoordToUVCoord ( Vector2 xy ) : Vector2 |
Converts pixel coordinates to UV coordinates according to the currently assigned material. NOTE: This is for converting coordinates and will reverse the Y component accordingly. For converting widths and heights, use PixelSpaceToUVSpace()!
|
|
PixelCoordToUVCoord ( int x, int y ) : Vector2 |
Converts pixel coordinates to UV coordinates according to the currently assigned material. NOTE: This is for converting coordinates and will reverse the Y component accordingly. For converting widths and heights, use PixelSpaceToUVSpace()!
|
|
PixelSpaceToUVSpace ( Vector2 xy ) : Vector2 |
Converts pixel-space values to UV-space scalar values according to the currently assigned material. NOTE: This is for converting widths and heights-not coordinates (which have reversed Y-coordinates). For coordinates, use PixelCoordToUVCoord()!
|
|
PixelSpaceToUVSpace ( int x, int y ) : Vector2 |
Converts pixel-space values to UV-space scalar values according to the currently assigned material. NOTE: This is for converting widths and heights-not coordinates (which have reversed Y-coordinates). For coordinates, use PixelCoordToUVCoord()!
|
|
PlainIndexToDisplayIndex ( int plainCharIndex ) : int |
Converts a character index in the plain text string to a corresponding index in the display string.
|
|
SetAlignment ( Alignment_Type a ) : void |
Sets the alignment of the text (left, right, center).
|
|
SetAnchor ( Anchor_Pos a ) : void |
Sets the anchor type to use. See Anchor_Pos
|
|
SetCamera ( ) : void |
A no-argument version of SetCamera() that simply re-assigns the same camera to the object, forcing it to recalculate all camera-dependent calculations.
|
|
SetCamera ( Camera c ) : void |
Sets the camera to use when calculating a pixel-perfect character size.
|
|
SetCharacterSize ( float size ) : void |
Sets the size (height) of the text such that a capital character that extends from the baseline to the absolute top of the line will be the specified height in world units. All other characters will be sized proportionately. If called while set to pixel perfect, pixel-perfect will be automatically disabled.
|
|
SetColor ( Color c ) : void |
Sets the text's color to the specified color. NOTE: Will not override color tags in the text itself.
|
|
SetFont ( SpriteFont, newFont, Material fontMaterial ) : void |
Changes the font to be used for this text object.
|
|
SetFont ( |
Changes the font to be used for this text object.
|
|
SetLineSpacing ( float spacing ) : void |
Sets the spacing between lines as a percentage of the character size. i.e. a value of 1.1 means 10% of the height of a full-height character will be placed between lines.
|
|
SetPixelToUV ( Texture tex ) : void | ||
SetPixelToUV ( int texWidth, int texHeight ) : void | ||
Start ( ) : void | ||
Unclip ( ) : void |
Removes any clipping that is being applied to the text object.
|
|
Update ( ) : void | ||
UpdateCamera ( ) : void |
Updates any camera-dependent settings, such as the calculated pixel-perfect size. Use this with BroadcastMessage() to do bulk re-calculation of object sizes whenever your screensize/resolution changes at runtime.
|
|
UpdateMesh ( ) : void |
Method | Description | |
---|---|---|
Awake ( ) : void | ||
BuildCharacter ( int vertNum, int charNum, Vector3 upperLeft, SpriteChar &ch ) : void | ||
ClearMesh ( ) : void | ||
CreateMesh ( ) : void | ||
DoSingleLineTruncation ( ) : void | ||
EnlargeMesh ( ) : void | ||
GetLineBaseline ( int numLines, int lineNum ) : float | ||
GetStartPos_SingleLine ( float baseHeight, float width ) : Vector3 | ||
Init ( ) : void | ||
LayoutText ( ) : void | ||
Layout_Line ( Vector3 startPos, string txt, int charIdx ) : void | ||
Layout_Multiline ( string lines ) : void | ||
Layout_Single_Line ( ) : void | ||
OnDisable ( ) : void | ||
ParseColor ( string str ) : Color | ||
ParseHexColor ( string str ) : Color | ||
ProcessString ( string str ) : void | ||
ZeroQuad ( int i ) : void |
protected BuildCharacter ( int vertNum, int charNum, Vector3 upperLeft, SpriteChar &ch ) : void | ||
vertNum | int | |
charNum | int | |
upperLeft | Vector3 | |
ch | SpriteChar | |
return | void |
public Copy ( SpriteText, s ) : void | ||
s | SpriteText, | The SpriteText object to be copied. |
return | void |
public DisplayIndexToPlainIndex ( int dispCharIndex ) : int | ||
dispCharIndex | int | |
return | int |
public GetDisplayLineCount ( int charIndex, int &charLine, int &lineStart, int &lineEnd ) : int | ||
charIndex | int | The index of the character sought. |
charLine | int | OUT: The 1-based line number on which the character /// at charIndex sits. |
lineStart | int | OUT: The index of the first character on the same line as the character at the specified index. |
lineEnd | int | OUT: The index of the last character on the same line as the character at the specified index (excludes ending newline character). |
return | int |
public GetInsertionPointPos ( int charIndex ) : Vector3 | ||
charIndex | int | The 0-based index of the character to the right of /// where you want an insertion point. 0 indicates the very beginning, /// and an index equal to the string's length indicates an insertion point /// at the very end of the string. |
return | Vector3 |
protected GetLineBaseline ( int numLines, int lineNum ) : float | ||
numLines | int | |
lineNum | int | |
return | float |
public GetNearestInsertionPoint ( Vector3 point ) : int | ||
point | Vector3 | A point, in world space, from which you want to find /// the nearest insertion point. |
return | int |
public GetNearestInsertionPointPos ( Vector3 point, int &insertionPt ) : Vector3 | ||
point | Vector3 | A point, in world space, from which you want to find /// the nearest insertion point. |
insertionPt | int | OUT: Will hold the index of the character to /// the left of which the insertion point will be. If the insertion point is /// at the end of the string, this value will be one greater than the index /// of the last character. |
return | Vector3 |
public GetScreenWidth ( string s ) : float | ||
s | string | The string to measure. |
return | float |
protected GetStartPos_SingleLine ( float baseHeight, float width ) : Vector3 | ||
baseHeight | float | |
width | float | |
return | Vector3 |
public GetWidth ( string s ) : float | ||
s | string | The string to measure. |
return | float |
public Hide ( bool tf ) : void | ||
tf | bool | When true, the text is hidden, when false, the text will be displayed. |
return | void |
protected Layout_Line ( Vector3 startPos, string txt, int charIdx ) : void | ||
startPos | Vector3 | |
txt | string | |
charIdx | int | |
return | void |
protected Layout_Multiline ( string lines ) : void | ||
lines | string | |
return | void |
protected ParseHexColor ( string str ) : Color | ||
str | string | |
return | Color |
public PixelCoordToUVCoord ( Vector2 xy ) : Vector2 | ||
xy | Vector2 | The coordinates to convert. |
return | Vector2 |
public PixelCoordToUVCoord ( int x, int y ) : Vector2 | ||
x | int | The x-coordinate to convert. |
y | int | The y-coordinate to convert. |
return | Vector2 |
public PixelSpaceToUVSpace ( Vector2 xy ) : Vector2 | ||
xy | Vector2 | The values to convert. |
return | Vector2 |
public PixelSpaceToUVSpace ( int x, int y ) : Vector2 | ||
x | int | The X-value to convert. |
y | int | The Y-value to convert. |
return | Vector2 |
public PlainIndexToDisplayIndex ( int plainCharIndex ) : int | ||
plainCharIndex | int | The index in the plain string to be converted. |
return | int |
protected ProcessString ( string str ) : void | ||
str | string | |
return | void |
public SetAlignment ( Alignment_Type a ) : void | ||
a | Alignment_Type | The alignment to use. |
return | void |
public SetAnchor ( Anchor_Pos a ) : void | ||
a | Anchor_Pos | The anchor method to use. |
return | void |
public SetCharacterSize ( float size ) : void | ||
size | float | The size of a full-height character, in world units. |
return | void |
public SetColor ( Color c ) : void | ||
c | Color | Color to shade the text. |
return | void |
public SetFont ( SpriteFont, newFont, Material fontMaterial ) : void | ||
newFont | SpriteFont, | Reference to the SpriteFont to be used for this text object. |
fontMaterial | Material | The material to use for the new font. |
return | void |
public SetFont ( |
||
newFont | The TextAsset that defines the font to be used. | |
fontMaterial | Material | The material to use for the new font. |
return | void |
public SetLineSpacing ( float spacing ) : void | ||
spacing | float | Percentage of the line height to place between lines. |
return | void |
public SetPixelToUV ( int texWidth, int texHeight ) : void | ||
texWidth | int | |
texHeight | int | |
return | void |
protected MeshFilter,UnityEngine meshFilter | ||
return |
protected MeshRenderer,UnityEngine meshRenderer | ||
return |
protected static char[] newLineDelimiter | ||
return | char[] |
protected EZScreenPlacement, screenPlacer | ||
return | EZScreenPlacement, |
protected float worldUnitsPerScreenPixel | ||
return | float |