C# 클래스 NGUIText, swip3

파일 보기 프로젝트 열기: unit9/swip3 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
alignment TextAlignment
baseline float
bitmapFont UIFont,
dynamicFont Font
encoding bool
finalLineHeight float
finalSize int
finalSpacingX float
fontScale float
fontSize int
fontStyle FontStyle,
glyph GlyphInfo
gradient bool
gradientBottom Color
gradientTop Color
maxLines int
pixelDensity float
premultiply bool
rectHeight int
rectWidth int
spacingX float
spacingY float
symbolStyle SymbolStyle
tint Color
useSymbols bool

공개 메소드들

메소드 설명
Align ( BetterList verts, int indexOffset, float offset ) : void

Align the vertices to be right or center-aligned given the line width specified by NGUIText.lineWidth.

CalculateOffsetToFit ( string text ) : int

Calculate the character index offset required to print the end of the specified text.

CalculatePrintedSize ( string text ) : Vector2

Get the printed size of the specified string. The returned value is in pixels.

EncodeColor ( Color c ) : string

The reverse of ParseColor -- encodes a color in RrGgBb format.

EndLine ( StringBuilder &s ) : void

Convenience function that ends the line by either appending a new line character or replacing a space with one.

GetClosestCharacter ( BetterList verts, Vector2 pos ) : int

Get the index of the closest character within the provided list of values. This function first sorts by Y, and only then by X.

GetEndOfLineThatFits ( string text ) : string

Get the end of line that would fit into a field of given width.

GetGlyph ( int ch, int prev ) : GlyphInfo

Get the specified glyph.

GetGlyphWidth ( int ch, int prev ) : float

Get the width of the specified glyph. Returns zero if the glyph could not be retrieved.

GetSymbol ( string text, int index, int textLength ) : BMSymbol,

Get the specified symbol.

ParseColor ( string text, int offset ) : Color

Parse a RrGgBb color encoded in the string.

ParseSymbol ( string text, int &index ) : bool

Parse an embedded symbol, such as [FFAA00] (set color) or [-] (undo color change). Returns whether the index was adjusted.

ParseSymbol ( string text, int &index, BetterList colors, bool premultiply, int &sub, bool &bold, bool &italic, bool &underline, bool &strike ) : bool

Parse the symbol, if possible. Returns 'true' if the 'index' was adjusted. Advanced symbol support contributed by Rudy Pangestu.

Prepare ( string text ) : void

Prepare to use the specified text.

Print ( string text, BetterList verts, BetterList uvs, BetterList cols ) : void

Print the specified text into the buffers.

PrintCaretAndSelection ( string text, int start, int end, BetterList caret, BetterList highlight ) : void

Print the caret and selection vertices. Note that it's expected that 'text' has been stripped clean of symbols.

PrintCharacterPositions ( string text, BetterList verts, BetterList indices ) : void

Print character positions and indices into the specified buffer. Meant to be used with the "find closest vertex" calculations.

RequestCharactersInTexture ( Font font, string text ) : void

Ensure that we have the requested characters present.

StripSymbols ( string text ) : string

Runs through the specified string and removes all color-encoding symbols.

Update ( ) : void

Recalculate the 'final' values.

Update ( bool request ) : void

Recalculate the 'final' values.

WrapText ( string text, string &finalText ) : bool

Text wrapping functionality. The 'width' and 'height' should be in pixels.

WrapText ( string text, string &finalText, bool keepCharCount ) : bool

Text wrapping functionality. The 'width' and 'height' should be in pixels.

비공개 메소드들

메소드 설명
ReplaceSpaceWithNewline ( StringBuilder &s ) : void

Convenience function that ends the line by replacing a space with a newline character.

메소드 상세

Align() 정적인 공개 메소드

Align the vertices to be right or center-aligned given the line width specified by NGUIText.lineWidth.
static public Align ( BetterList verts, int indexOffset, float offset ) : void
verts BetterList
indexOffset int
offset float
리턴 void

CalculateOffsetToFit() 정적인 공개 메소드

Calculate the character index offset required to print the end of the specified text.
static public CalculateOffsetToFit ( string text ) : int
text string
리턴 int

CalculatePrintedSize() 정적인 공개 메소드

Get the printed size of the specified string. The returned value is in pixels.
static public CalculatePrintedSize ( string text ) : Vector2
text string
리턴 Vector2

EncodeColor() 정적인 공개 메소드

The reverse of ParseColor -- encodes a color in RrGgBb format.
static public EncodeColor ( Color c ) : string
c Color
리턴 string

EndLine() 정적인 공개 메소드

Convenience function that ends the line by either appending a new line character or replacing a space with one.
static public EndLine ( StringBuilder &s ) : void
s StringBuilder
리턴 void

GetClosestCharacter() 정적인 공개 메소드

Get the index of the closest character within the provided list of values. This function first sorts by Y, and only then by X.
static public GetClosestCharacter ( BetterList verts, Vector2 pos ) : int
verts BetterList
pos Vector2
리턴 int

GetEndOfLineThatFits() 정적인 공개 메소드

Get the end of line that would fit into a field of given width.
static public GetEndOfLineThatFits ( string text ) : string
text string
리턴 string

GetGlyph() 정적인 공개 메소드

Get the specified glyph.
static public GetGlyph ( int ch, int prev ) : GlyphInfo
ch int
prev int
리턴 GlyphInfo

GetGlyphWidth() 정적인 공개 메소드

Get the width of the specified glyph. Returns zero if the glyph could not be retrieved.
static public GetGlyphWidth ( int ch, int prev ) : float
ch int
prev int
리턴 float

GetSymbol() 정적인 공개 메소드

Get the specified symbol.
static public GetSymbol ( string text, int index, int textLength ) : BMSymbol,
text string
index int
textLength int
리턴 BMSymbol,

ParseColor() 정적인 공개 메소드

Parse a RrGgBb color encoded in the string.
static public ParseColor ( string text, int offset ) : Color
text string
offset int
리턴 Color

ParseSymbol() 정적인 공개 메소드

Parse an embedded symbol, such as [FFAA00] (set color) or [-] (undo color change). Returns whether the index was adjusted.
static public ParseSymbol ( string text, int &index ) : bool
text string
index int
리턴 bool

ParseSymbol() 정적인 공개 메소드

Parse the symbol, if possible. Returns 'true' if the 'index' was adjusted. Advanced symbol support contributed by Rudy Pangestu.
static public ParseSymbol ( string text, int &index, BetterList colors, bool premultiply, int &sub, bool &bold, bool &italic, bool &underline, bool &strike ) : bool
text string
index int
colors BetterList
premultiply bool
sub int
bold bool
italic bool
underline bool
strike bool
리턴 bool

Prepare() 정적인 공개 메소드

Prepare to use the specified text.
static public Prepare ( string text ) : void
text string
리턴 void

Print() 정적인 공개 메소드

Print the specified text into the buffers.
static public Print ( string text, BetterList verts, BetterList uvs, BetterList cols ) : void
text string
verts BetterList
uvs BetterList
cols BetterList
리턴 void

PrintCaretAndSelection() 정적인 공개 메소드

Print the caret and selection vertices. Note that it's expected that 'text' has been stripped clean of symbols.
static public PrintCaretAndSelection ( string text, int start, int end, BetterList caret, BetterList highlight ) : void
text string
start int
end int
caret BetterList
highlight BetterList
리턴 void

PrintCharacterPositions() 정적인 공개 메소드

Print character positions and indices into the specified buffer. Meant to be used with the "find closest vertex" calculations.
static public PrintCharacterPositions ( string text, BetterList verts, BetterList indices ) : void
text string
verts BetterList
indices BetterList
리턴 void

RequestCharactersInTexture() 정적인 공개 메소드

Ensure that we have the requested characters present.
static public RequestCharactersInTexture ( Font font, string text ) : void
font Font
text string
리턴 void

StripSymbols() 정적인 공개 메소드

Runs through the specified string and removes all color-encoding symbols.
static public StripSymbols ( string text ) : string
text string
리턴 string

Update() 정적인 공개 메소드

Recalculate the 'final' values.
static public Update ( ) : void
리턴 void

Update() 정적인 공개 메소드

Recalculate the 'final' values.
static public Update ( bool request ) : void
request bool
리턴 void

WrapText() 정적인 공개 메소드

Text wrapping functionality. The 'width' and 'height' should be in pixels.
static public WrapText ( string text, string &finalText ) : bool
text string
finalText string
리턴 bool

WrapText() 정적인 공개 메소드

Text wrapping functionality. The 'width' and 'height' should be in pixels.
static public WrapText ( string text, string &finalText, bool keepCharCount ) : bool
text string
finalText string
keepCharCount bool
리턴 bool

프로퍼티 상세

alignment 정적으로 공개적으로 프로퍼티

static public TextAlignment alignment
리턴 TextAlignment

baseline 정적으로 공개적으로 프로퍼티

static public float baseline
리턴 float

bitmapFont 정적으로 공개적으로 프로퍼티

When printing text, a lot of additional data must be passed in. In order to save allocations, this data is not passed at all, but is rather set in a single place before calling the functions that use it.
static public UIFont, bitmapFont
리턴 UIFont,

dynamicFont 정적으로 공개적으로 프로퍼티

static public Font dynamicFont
리턴 Font

encoding 정적으로 공개적으로 프로퍼티

static public bool encoding
리턴 bool

finalLineHeight 정적으로 공개적으로 프로퍼티

static public float finalLineHeight
리턴 float

finalSize 정적으로 공개적으로 프로퍼티

static public int finalSize
리턴 int

finalSpacingX 정적으로 공개적으로 프로퍼티

static public float finalSpacingX
리턴 float

fontScale 정적으로 공개적으로 프로퍼티

static public float fontScale
리턴 float

fontSize 정적으로 공개적으로 프로퍼티

static public int fontSize
리턴 int

fontStyle 정적으로 공개적으로 프로퍼티

static public FontStyle, fontStyle
리턴 FontStyle,

glyph 정적으로 공개적으로 프로퍼티

static public GlyphInfo glyph
리턴 GlyphInfo

gradient 정적으로 공개적으로 프로퍼티

static public bool gradient
리턴 bool

gradientBottom 정적으로 공개적으로 프로퍼티

static public Color gradientBottom
리턴 Color

gradientTop 정적으로 공개적으로 프로퍼티

static public Color gradientTop
리턴 Color

maxLines 정적으로 공개적으로 프로퍼티

static public int maxLines
리턴 int

pixelDensity 정적으로 공개적으로 프로퍼티

static public float pixelDensity
리턴 float

premultiply 정적으로 공개적으로 프로퍼티

static public bool premultiply
리턴 bool

rectHeight 정적으로 공개적으로 프로퍼티

static public int rectHeight
리턴 int

rectWidth 정적으로 공개적으로 프로퍼티

static public int rectWidth
리턴 int

spacingX 정적으로 공개적으로 프로퍼티

static public float spacingX
리턴 float

spacingY 정적으로 공개적으로 프로퍼티

static public float spacingY
리턴 float

symbolStyle 정적으로 공개적으로 프로퍼티

static public SymbolStyle symbolStyle
리턴 SymbolStyle

tint 정적으로 공개적으로 프로퍼티

static public Color tint
리턴 Color

useSymbols 정적으로 공개적으로 프로퍼티

static public bool useSymbols
리턴 bool