C# 클래스 UILabel, TheUnseen

상속: UIWidget
파일 보기 프로젝트 열기: henryj41043/TheUnseen 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
keepCrispWhenShrunk Crispness

Private Properties

프로퍼티 타입 설명
GetCharacterIndex int
GetCharacterIndex int
OnFontTextureChanged void

공개 메소드들

메소드 설명
ApplyShadow ( BetterList verts, BetterList uvs, BetterList cols, int start, int end, float x, float y ) : void

Apply a shadow effect to the buffer.

AssumeNaturalSize ( ) : void

Make the label assume its natural size.

CalculateOffsetToFit ( string text ) : int

Calculate the character index offset necessary in order to print the end of the specified text.

GetCharacterIndex ( int currentIndex, KeyCode, key ) : int

Get the index of the character on the line directly above or below the current index.

GetCharacterIndexAtPosition ( Vector2 localPos ) : int

Return the index of the character at the specified local position.

GetCharacterIndexAtPosition ( Vector3 worldPos ) : int

Return the index of the character at the specified world position.

GetSides ( Transform relativeTo ) : Vector3[]

Get the sides of the rectangle relative to the specified transform. The order is left, top, right, bottom.

GetUrlAtCharacterIndex ( int characterIndex ) : string

Retrieve the URL right under the specified character index.

GetUrlAtPosition ( Vector2 localPos ) : string

Retrieve the URL directly below the specified relative-to-label position.

GetUrlAtPosition ( Vector3 worldPos ) : string

Retrieve the URL directly below the specified world-space position.

GetWordAtCharacterIndex ( int characterIndex ) : string

Retrieve the word right under the specified character index.

GetWordAtPosition ( Vector2 localPos ) : string

Retrieve the word directly below the specified relative-to-label position.

GetWordAtPosition ( Vector3 worldPos ) : string

Retrieve the word directly below the specified world-space position.

MakePixelPerfect ( ) : void

Text is pixel-perfect when its scale matches the size.

MarkAsChanged ( ) : void

UILabel needs additional processing when something changes.

OnFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Draw the label.

PrintOverlay ( int start, int end, UIGeometry, caret, UIGeometry, highlight, Color caretColor, Color highlightColor ) : void

Fill the specified geometry buffer with vertices that would highlight the current selection.

ProcessAndRequest ( ) : void

Request the needed characters in the texture.

ProcessText ( ) : void

Process the raw text, called when something changes.

ProcessText ( bool legacyMode ) : void

Process the raw text, called when something changes.

SetCurrentPercent ( ) : void

Convenience function, in case you wanted to associate progress bar, slider or scroll bar's OnValueChanged function in inspector with a label.

SetCurrentProgress ( ) : void

Convenience function, in case you wanted to associate progress bar, slider or scroll bar's OnValueChanged function in inspector with a label.

SetCurrentSelection ( ) : void

Convenience function, in case you wanted to automatically set some label's text by selecting a value in the UIPopupList.

UpdateNGUIText ( ) : void

Update NGUIText.current with all the properties from this label.

UpdateNGUIText ( int size, int lineWidth, int lineHeight ) : void

Update NGUIText.current with all the properties from this label.

Wrap ( string text, string &final ) : bool

Convenience function -- wrap the current text given the label's settings and unlimited height.

Wrap ( string text, string &final, int height ) : bool

Convenience function -- wrap the current text given the label's settings and the given height.

보호된 메소드들

메소드 설명
ApplyOffset ( BetterList verts, int start ) : Vector2

Align the vertices, making the label positioned correctly based on the pivot. Returns the offset that was applied.

OnAnchor ( ) : void

If the label is anchored it should not auto-resize.

OnDisable ( ) : void

Remove the font texture change listener.

OnInit ( ) : void

Register the font texture change listener.

OnStart ( ) : void

Determine start-up values.

OnValidate ( ) : void

Validate the properties.

SetActiveFont ( Font fnt ) : void

Set the active font, correctly setting and clearing callbacks.

UpgradeFrom265 ( ) : void

Upgrading labels is a bit different.

비공개 메소드들

메소드 설명
GetCharacterIndex ( Vector2 localPos ) : int
GetCharacterIndex ( Vector3 worldPos ) : int
OnFontTextureChanged ( ) : void

Notification called when the Unity's font's texture gets rebuilt. Unity's font has a nice tendency to simply discard other characters when the texture's dimensions change. By requesting them inside the notification callback, we immediately force them back in. Originally I was subscribing each label to the font individually, but as it turned out mono's delegate system causes an insane amount of memory allocations when += or -= to a delegate. So... queue yet another work-around.

메소드 상세

ApplyOffset() 보호된 메소드

Align the vertices, making the label positioned correctly based on the pivot. Returns the offset that was applied.
protected ApplyOffset ( BetterList verts, int start ) : Vector2
verts BetterList
start int
리턴 Vector2

ApplyShadow() 공개 메소드

Apply a shadow effect to the buffer.
public ApplyShadow ( BetterList verts, BetterList uvs, BetterList cols, int start, int end, float x, float y ) : void
verts BetterList
uvs BetterList
cols BetterList
start int
end int
x float
y float
리턴 void

AssumeNaturalSize() 공개 메소드

Make the label assume its natural size.
public AssumeNaturalSize ( ) : void
리턴 void

CalculateOffsetToFit() 공개 메소드

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

GetCharacterIndex() 공개 메소드

Get the index of the character on the line directly above or below the current index.
public GetCharacterIndex ( int currentIndex, KeyCode, key ) : int
currentIndex int
key KeyCode,
리턴 int

GetCharacterIndexAtPosition() 공개 메소드

Return the index of the character at the specified local position.
public GetCharacterIndexAtPosition ( Vector2 localPos ) : int
localPos Vector2
리턴 int

GetCharacterIndexAtPosition() 공개 메소드

Return the index of the character at the specified world position.
public GetCharacterIndexAtPosition ( Vector3 worldPos ) : int
worldPos Vector3
리턴 int

GetSides() 공개 메소드

Get the sides of the rectangle relative to the specified transform. The order is left, top, right, bottom.
public GetSides ( Transform relativeTo ) : Vector3[]
relativeTo Transform
리턴 Vector3[]

GetUrlAtCharacterIndex() 공개 메소드

Retrieve the URL right under the specified character index.
public GetUrlAtCharacterIndex ( int characterIndex ) : string
characterIndex int
리턴 string

GetUrlAtPosition() 공개 메소드

Retrieve the URL directly below the specified relative-to-label position.
public GetUrlAtPosition ( Vector2 localPos ) : string
localPos Vector2
리턴 string

GetUrlAtPosition() 공개 메소드

Retrieve the URL directly below the specified world-space position.
public GetUrlAtPosition ( Vector3 worldPos ) : string
worldPos Vector3
리턴 string

GetWordAtCharacterIndex() 공개 메소드

Retrieve the word right under the specified character index.
public GetWordAtCharacterIndex ( int characterIndex ) : string
characterIndex int
리턴 string

GetWordAtPosition() 공개 메소드

Retrieve the word directly below the specified relative-to-label position.
public GetWordAtPosition ( Vector2 localPos ) : string
localPos Vector2
리턴 string

GetWordAtPosition() 공개 메소드

Retrieve the word directly below the specified world-space position.
public GetWordAtPosition ( Vector3 worldPos ) : string
worldPos Vector3
리턴 string

MakePixelPerfect() 공개 메소드

Text is pixel-perfect when its scale matches the size.
public MakePixelPerfect ( ) : void
리턴 void

MarkAsChanged() 공개 메소드

UILabel needs additional processing when something changes.
public MarkAsChanged ( ) : void
리턴 void

OnAnchor() 보호된 메소드

If the label is anchored it should not auto-resize.
protected OnAnchor ( ) : void
리턴 void

OnDisable() 보호된 메소드

Remove the font texture change listener.
protected OnDisable ( ) : void
리턴 void

OnFill() 공개 메소드

Draw the label.
public OnFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
리턴 void

OnInit() 보호된 메소드

Register the font texture change listener.
protected OnInit ( ) : void
리턴 void

OnStart() 보호된 메소드

Determine start-up values.
protected OnStart ( ) : void
리턴 void

OnValidate() 보호된 메소드

Validate the properties.
protected OnValidate ( ) : void
리턴 void

PrintOverlay() 공개 메소드

Fill the specified geometry buffer with vertices that would highlight the current selection.
public PrintOverlay ( int start, int end, UIGeometry, caret, UIGeometry, highlight, Color caretColor, Color highlightColor ) : void
start int
end int
caret UIGeometry,
highlight UIGeometry,
caretColor Color
highlightColor Color
리턴 void

ProcessAndRequest() 공개 메소드

Request the needed characters in the texture.
public ProcessAndRequest ( ) : void
리턴 void

ProcessText() 공개 메소드

Process the raw text, called when something changes.
public ProcessText ( ) : void
리턴 void

ProcessText() 공개 메소드

Process the raw text, called when something changes.
public ProcessText ( bool legacyMode ) : void
legacyMode bool
리턴 void

SetActiveFont() 보호된 메소드

Set the active font, correctly setting and clearing callbacks.
protected SetActiveFont ( Font fnt ) : void
fnt Font
리턴 void

SetCurrentPercent() 공개 메소드

Convenience function, in case you wanted to associate progress bar, slider or scroll bar's OnValueChanged function in inspector with a label.
public SetCurrentPercent ( ) : void
리턴 void

SetCurrentProgress() 공개 메소드

Convenience function, in case you wanted to associate progress bar, slider or scroll bar's OnValueChanged function in inspector with a label.
public SetCurrentProgress ( ) : void
리턴 void

SetCurrentSelection() 공개 메소드

Convenience function, in case you wanted to automatically set some label's text by selecting a value in the UIPopupList.
public SetCurrentSelection ( ) : void
리턴 void

UpdateNGUIText() 공개 메소드

Update NGUIText.current with all the properties from this label.
public UpdateNGUIText ( ) : void
리턴 void

UpdateNGUIText() 공개 메소드

Update NGUIText.current with all the properties from this label.
public UpdateNGUIText ( int size, int lineWidth, int lineHeight ) : void
size int
lineWidth int
lineHeight int
리턴 void

UpgradeFrom265() 보호된 메소드

Upgrading labels is a bit different.
protected UpgradeFrom265 ( ) : void
리턴 void

Wrap() 공개 메소드

Convenience function -- wrap the current text given the label's settings and unlimited height.
public Wrap ( string text, string &final ) : bool
text string
final string
리턴 bool

Wrap() 공개 메소드

Convenience function -- wrap the current text given the label's settings and the given height.
public Wrap ( string text, string &final, int height ) : bool
text string
final string
height int
리턴 bool

프로퍼티 상세

keepCrispWhenShrunk 공개적으로 프로퍼티

Whether the label will keep its content crisp even when shrunk. You may want to turn this off on mobile devices.
public Crispness keepCrispWhenShrunk
리턴 Crispness