C# Class Nez.UI.Label

Inheritance: Element
Exibir arquivo Open project: prime31/Nez Class Usage Examples

Public Methods

Method Description
Label ( string text ) : System
Label ( string text, BitmapFont font ) : System
Label ( string text, BitmapFont font, Color fontColor ) : System
Label ( string text, LabelStyle style ) : System
Label ( string text, Skin skin, string styleName = null ) : System
draw ( Graphics graphics, float parentAlpha ) : void
getStyle ( ) : LabelStyle

Returns the button's style. Modifying the returned style may not have an effect until {@link #setStyle(ButtonStyle)} is called.

getText ( ) : string
invalidate ( ) : void
layout ( ) : void
setAlignment ( Align alignment ) : Label

alignment Aligns all the text within the label (default left center) and each line of text horizontally (default left)

setAlignment ( Align labelAlign, Align lineAlign ) : Label

labelAlign Aligns all the text within the label (default left center). lineAlign Aligns each line of text horizontally (default left).

setBackground ( IDrawable background ) : Label

background may be null to clear the background.

setEllipsis ( String ellipsis ) : void

When non-null the text will be truncated "..." if it does not fit within the width of the label. Wrapping will not occur when ellipsis is enabled. Default is false.

setEllipsis ( bool ellipsis ) : void

When true the text will be truncated "..." if it does not fit within the width of the label. Wrapping will not occur when ellipsis is true. Default is false.

setFontColor ( Color color ) : Label
setFontScale ( float fontScale ) : Label
setFontScale ( float fontScaleX, float fontScaleY ) : void
setStyle ( LabelStyle style ) : Label
setText ( string text ) : Label
setWrap ( bool shouldWrap ) : void

should the text be wrapped?

Private Methods

Method Description
computePrefSize ( ) : void

Method Details

Label() public method

public Label ( string text ) : System
text string
return System

Label() public method

public Label ( string text, BitmapFont font ) : System
text string
font BitmapFont
return System

Label() public method

public Label ( string text, BitmapFont font, Color fontColor ) : System
text string
font BitmapFont
fontColor Color
return System

Label() public method

public Label ( string text, LabelStyle style ) : System
text string
style LabelStyle
return System

Label() public method

public Label ( string text, Skin skin, string styleName = null ) : System
text string
skin Skin
styleName string
return System

draw() public method

public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics
parentAlpha float
return void

getStyle() public method

Returns the button's style. Modifying the returned style may not have an effect until {@link #setStyle(ButtonStyle)} is called.
public getStyle ( ) : LabelStyle
return LabelStyle

getText() public method

public getText ( ) : string
return string

invalidate() public method

public invalidate ( ) : void
return void

layout() public method

public layout ( ) : void
return void

setAlignment() public method

alignment Aligns all the text within the label (default left center) and each line of text horizontally (default left)
public setAlignment ( Align alignment ) : Label
alignment Align Alignment.
return Label

setAlignment() public method

labelAlign Aligns all the text within the label (default left center). lineAlign Aligns each line of text horizontally (default left).
public setAlignment ( Align labelAlign, Align lineAlign ) : Label
labelAlign Align Label align.
lineAlign Align Line align.
return Label

setBackground() public method

background may be null to clear the background.
public setBackground ( IDrawable background ) : Label
background IDrawable Background.
return Label

setEllipsis() public method

When non-null the text will be truncated "..." if it does not fit within the width of the label. Wrapping will not occur when ellipsis is enabled. Default is false.
public setEllipsis ( String ellipsis ) : void
ellipsis String Ellipsis.
return void

setEllipsis() public method

When true the text will be truncated "..." if it does not fit within the width of the label. Wrapping will not occur when ellipsis is true. Default is false.
public setEllipsis ( bool ellipsis ) : void
ellipsis bool Ellipsis.
return void

setFontColor() public method

public setFontColor ( Color color ) : Label
color Color
return Label

setFontScale() public method

public setFontScale ( float fontScale ) : Label
fontScale float
return Label

setFontScale() public method

public setFontScale ( float fontScaleX, float fontScaleY ) : void
fontScaleX float
fontScaleY float
return void

setStyle() public method

public setStyle ( LabelStyle style ) : Label
style LabelStyle
return Label

setText() public method

public setText ( string text ) : Label
text string
return Label

setWrap() public method

should the text be wrapped?
public setWrap ( bool shouldWrap ) : void
shouldWrap bool If set to true should wrap.
return void