Class ccs.Label
- Defined in: UILabel.js
- Extends ccs.Widget
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for ccs.Button
|
Method Summary
Class Detail
ccs.Label()
Base class for ccs.Button
Method Detail
-
allocates and initializes a UILabel.
// example var uiLabel = ccs.Label.create();
- Returns:
- {ccs.Label}
-
{cc.Size} getContentSize()override "getContentSize" method of widget.
- Returns:
- {cc.Size}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{string} getFontName()Get font name
- Returns:
- {string}
-
{Number} getFontSize()Get font Size
- Returns:
- {Number}
-
{Number} getStringLength()Gets the string length of label.
- Returns:
- {Number}
-
{String} getStringValue()Gets the string value of label.
- Returns:
- {String}
-
{cc.Size} getTextAreaSize()Get textArea size
- Returns:
- {cc.Size}
-
{TEXT_ALIGNMENT_LEFT|TEXT_ALIGNMENT_CENTER|TEXT_ALIGNMENT_RIGHT} getTextHorizontalAlignment()return Horizontal Alignment of cc.LabelTTF
- Returns:
- {TEXT_ALIGNMENT_LEFT|TEXT_ALIGNMENT_CENTER|TEXT_ALIGNMENT_RIGHT}
-
{VERTICAL_TEXT_ALIGNMENT_TOP|VERTICAL_TEXT_ALIGNMENT_CENTER|VERTICAL_TEXT_ALIGNMENT_BOTTOM} getTextVerticalAlignment()Get text vertical alignment.
- Returns:
- {VERTICAL_TEXT_ALIGNMENT_TOP|VERTICAL_TEXT_ALIGNMENT_CENTER|VERTICAL_TEXT_ALIGNMENT_BOTTOM}
-
{Boolean} getTouchScaleChangeAble()Gets the touch scale enabled of label.
- Returns:
- {Boolean}
-
{cc.Node} getVirtualRenderer()override "getVirtualRenderer" method of widget.
- Returns:
- {cc.Node}
-
{Boolean} isTouchScaleChangeEnabled()Gets the touch scale enabled of label.
- Returns:
- {Boolean}
-
setAnchorPoint(point, y)override "setAnchorPoint" of widget.
- Parameters:
- {cc.Point|Number} point
- The anchor point of UILabel or The anchor point.x of UILabel.
- {Number} y Optional
- The anchor point.y of UILabel.
-
setFontName(name)set fontName
- Parameters:
- {String} name
-
setFontSize(size)set fontSize
- Parameters:
- {Number} size
-
setText(text)Changes the string value of label.
- Parameters:
- {String} text
-
setTextAreaSize(size)set textAreaSize
- Parameters:
- {cc.Size} size
-
setTextHorizontalAlignment(alignment)set Horizontal Alignment of cc.LabelTTF
- Parameters:
- {cc.TEXT_ALIGNMENT_LEFT|cc.TEXT_ALIGNMENT_CENTER|cc.TEXT_ALIGNMENT_RIGHT} alignment
- Horizontal Alignment
-
setTextVerticalAlignment(verticalAlignment)set Vertical Alignment of cc.LabelTTF
- Parameters:
- {cc.VERTICAL_TEXT_ALIGNMENT_TOP|cc.VERTICAL_TEXT_ALIGNMENT_CENTER|cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM} verticalAlignment
-
setTouchScaleChangeEnabled(enable)Sets the touch scale enabled of label.
- Parameters:
- {Boolean} enable