Catlike Coding
Unity Code Documentation
Public Member Functions | Public Attributes | Properties | List of all members
CatlikeCoding.TextBox.CharMetaData Struct Reference

Meta data of a character. More...

Public Member Functions

void AdjustPositionInBox (Vector2 delta)
 Adjust the character's position in its text box. Used by TextBox. More...
 
void AdjustPositionInBox (float xDelta, float yDelta)
 Adjust the character's position in its text box. Used by TextBox. More...
 
void EraseIfVisible ()
 Erase the character if it's visible. Used by TextBox. More...
 
void FillCharInfo (out TextBoxCharInfo charInfo, int index, int lineIndex)
 Fill character info. More...
 
char MarkAsStyleStatement (int unstyledIndex, Vector2 position)
 Mark the character as part of a style statement. Used by TextBox. More...
 
BitmapFontChar MarkAsVisible (int unstyledIndex, Vector2 position, ref AppliedTextStyle style)
 Mark the character as a visible character. Used by TextBox. More...
 
void MarkAsWhitespace (int unstyledIndex, Vector2 position, ref AppliedTextStyle style)
 Mark the character as a whitespace. Used by TextBox. More...
 
void RenderIfVisible (Vector2 offset)
 Render the character if it's visible. Used by TextBox. More...
 

Public Attributes

Color32 color
 Character color. This is a Color32 for performance. More...
 
BitmapFont font
 Font used by the character. More...
 
char id
 Character code. More...
 
Vector2 positionInBox
 Position of the character in a text box. More...
 
TextRenderer renderer
 Renderer responsible for rendering the character. More...
 
float scale
 Character scale. More...
 
CharType type
 Character type. More...
 
int unstyledIndex
 Text index of the character when styling characters are ignored. More...
 

Properties

float After [get]
 Get the horizontal position after this character. More...
 
float HorizontalMiddle [get]
 Get the horizontal position in the middle of this character. More...
 

Detailed Description

Meta data of a character.

Member Function Documentation

void CatlikeCoding.TextBox.CharMetaData.AdjustPositionInBox ( Vector2  delta)

Adjust the character's position in its text box. Used by TextBox.

Parameters
deltaPosition delta.
void CatlikeCoding.TextBox.CharMetaData.AdjustPositionInBox ( float  xDelta,
float  yDelta 
)

Adjust the character's position in its text box. Used by TextBox.

Parameters
xDeltaX position delta.
yDeltaY position delta.
void CatlikeCoding.TextBox.CharMetaData.EraseIfVisible ( )

Erase the character if it's visible. Used by TextBox.

void CatlikeCoding.TextBox.CharMetaData.FillCharInfo ( out TextBoxCharInfo  charInfo,
int  index,
int  lineIndex 
)

Fill character info.

Parameters
charInfoInfo to be filled.
indexCharacter index.
lineIndexLine index.
char CatlikeCoding.TextBox.CharMetaData.MarkAsStyleStatement ( int  unstyledIndex,
Vector2  position 
)

Mark the character as part of a style statement. Used by TextBox.

Returns
Character code.
Parameters
unstyledIndexUnstyled index for the character.
positionPosition of the character.
BitmapFontChar CatlikeCoding.TextBox.CharMetaData.MarkAsVisible ( int  unstyledIndex,
Vector2  position,
ref AppliedTextStyle  style 
)

Mark the character as a visible character. Used by TextBox.

Returns
Font character data.
Parameters
unstyledIndexUnstyled index of the character.
positionPosition of the character.
styleStyle to use.
void CatlikeCoding.TextBox.CharMetaData.MarkAsWhitespace ( int  unstyledIndex,
Vector2  position,
ref AppliedTextStyle  style 
)

Mark the character as a whitespace. Used by TextBox.

Parameters
unstyledIndexUnstyled index of the character.
positionPosition of the character.
styleStyle to use.
void CatlikeCoding.TextBox.CharMetaData.RenderIfVisible ( Vector2  offset)

Render the character if it's visible. Used by TextBox.

Parameters
offsetPositioning offset.

Member Data Documentation

Color32 CatlikeCoding.TextBox.CharMetaData.color

Character color. This is a Color32 for performance.

BitmapFont CatlikeCoding.TextBox.CharMetaData.font

Font used by the character.

char CatlikeCoding.TextBox.CharMetaData.id

Character code.

Vector2 CatlikeCoding.TextBox.CharMetaData.positionInBox

Position of the character in a text box.

TextRenderer CatlikeCoding.TextBox.CharMetaData.renderer

Renderer responsible for rendering the character.

float CatlikeCoding.TextBox.CharMetaData.scale

Character scale.

CharType CatlikeCoding.TextBox.CharMetaData.type

Character type.

int CatlikeCoding.TextBox.CharMetaData.unstyledIndex

Text index of the character when styling characters are ignored.

Property Documentation

float CatlikeCoding.TextBox.CharMetaData.After
get

Get the horizontal position after this character.

float CatlikeCoding.TextBox.CharMetaData.HorizontalMiddle
get

Get the horizontal position in the middle of this character.