Module flower.widget.UILabel
It is a class that displays the text.
Extends:
Info:
- Release: V3.0.0
- Author: Makoto
Functions
Fields
STYLE_FONT_NAME | Style: fontName |
STYLE_TEXT_SIZE | Style: textSize |
STYLE_TEXT_COLOR | Style: textColor |
STYLE_TEXT_ALIGN | Style: textSize |
STYLE_TEXT_PADDING | Style: textPadding |
STYLE_TEXT_RESIZE_POLICY | Style: textResizePolicy |
RESIZE_POLICY_NONE | textResizePolicy : none |
RESIZE_POLICY_AUTO | textResizePolicy : auto |
Functions
- UILabel:_initInternal ()
- Initialize a variables
- UILabel:_createChildren ()
- Create a children object.
- UILabel:_updateLabel ()
- Update the UILabel.
- UILabel:_updateLabelSize ()
- Update the UILabel size.
- UILabel:updateDisplay ()
- Update the display objects.
- UILabel:fitSize (length, maxWidth, maxHeight, padding)
-
Sets the fit size.
Parameters:
- length (Option)Length of the text.
- maxWidth (Option)maxWidth of the text.
- maxHeight (Option)maxHeight of the text.
- padding (Option)padding of the text.
- UILabel:fitHeight (length, maxHeight, padding)
-
Sets the fit height.
Parameters:
- length (Option)Length of the text.
- maxHeight (Option)maxHeight of the text.
- padding (Option)padding of the text.
- UILabel:fitWidth (length, maxWidth, padding)
-
Sets the fit height.
Parameters:
- length (Option)Length of the text.
- maxWidth (Option)maxWidth of the text.
- padding (Option)padding of the text.
- UILabel:getLabel ()
-
Return the label.
Returns:
-
label
- UILabel:setText (text)
-
Sets the text.
Parameters:
- text text
- UILabel:addText (text)
-
Adds the text.
Parameters:
- text text
- UILabel:getText ()
-
Returns the text.
Returns:
-
text
- UILabel:setTextResizePolicy (widthPolicy, heightPolicy)
-
Sets the size policy of label.
Parameters:
- widthPolicy width policy
- heightPolicy height policy
- UILabel:getTextResizePolicy ()
-
Returns the size policy of label.
Returns:
- width policy
- height policy
- UILabel:setTextSize (textSize)
-
Sets the textSize.
Parameters:
- textSize textSize
- UILabel:getTextSize ()
-
Returns the textSize.
Returns:
-
textSize
- UILabel:setFontName (fontName)
-
Sets the fontName.
Parameters:
- fontName fontName
- UILabel:getFontName ()
-
Returns the font name.
Returns:
-
font name
- UILabel:getFont ()
-
Returns the font.
Returns:
-
font
- UILabel:setTextAlign (horizontalAlign, verticalAlign)
-
Sets the text align.
Parameters:
- horizontalAlign horizontal align(left, center, top)
- verticalAlign vertical align(top, center, bottom)
- UILabel:getTextAlign ()
-
Returns the text align.
Returns:
- horizontal align(left, center, top)
- vertical align(top, center, bottom)
- UILabel:getAlignment ()
-
Returns the text align for MOAITextBox.
Returns:
- horizontal align
- vertical align
- UILabel:setTextColor (red, green, blue, alpha)
-
Sets the text align.
Parameters:
- red red(0 ... 1)
- green green(0 ... 1)
- blue blue(0 ... 1)
- alpha alpha(0 ... 1)
- UILabel:getTextColor ()
-
Returns the text color.
Returns:
- red(0 ... 1)
- green(0 ... 1)
- blue(0 ... 1)
- alpha(0 ... 1)
- UILabel:setTextPadding (left, top, right, bottom)
-
Set textbox padding by label's setRect method, it will set 4 direction padding
Parameters:
- left padding for left
- top padding for top
- right padding for right
- bottom padding for bottom
- UILabel:getTextPadding ()
-
Returns the text padding.
Returns:
- padding for left
- padding for top
- padding for right
- padding for bottom
Fields
- STYLE_FONT_NAME
- Style: fontName
- STYLE_TEXT_SIZE
- Style: textSize
- STYLE_TEXT_COLOR
- Style: textColor
- STYLE_TEXT_ALIGN
- Style: textSize
- STYLE_TEXT_PADDING
- Style: textPadding
- STYLE_TEXT_RESIZE_POLICY
- Style: textResizePolicy
- RESIZE_POLICY_NONE
- textResizePolicy : none
- RESIZE_POLICY_AUTO
- textResizePolicy : auto