Class ccui.Layout
- Defined in: UILayout.js
- Extends ccui.Widget
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for ccui.Layout
|
Method Summary
Class Detail
ccui.Layout()
Base class for ccui.Layout
Field Detail
{Boolean}
clippingEnabled
- Indicate whether clipping is enabled
{ccui.Layout.CLIPPING_STENCIL|ccui.Layout.CLIPPING_SCISSOR}
clippingType
{ccui.Layout.ABSOLUTE|ccui.Layout.LINEAR_VERTICAL|ccui.Layout.LINEAR_HORIZONTAL|ccui.Layout.RELATIVE}
layoutType
Method Detail
-
addBackGroundImage()init background image renderer.
-
addChild(widget, zOrder, tag)Adds a widget to the container.
- Parameters:
- {ccui.Widget} widget
- {Number} zOrder
- {Number} tag
-
allocates and initializes a UILayout.
// example var uiLayout = ccui.Layout.create();
- Returns:
- {ccui.Layout}
-
{cc.Color} getBackGroundColor()Get back ground color
- Returns:
- {cc.Color}
-
{Number} getBackGroundColorOpacity()Get background opacity value.
- Returns:
- {Number}
-
{ccui.Layout.BG_COLOR_NONE|ccui.Layout.BG_COLOR_SOLID|ccui.Layout.BG_COLOR_GRADIENT} getBackGroundColorType()Get color type.
- Returns:
- {ccui.Layout.BG_COLOR_NONE|ccui.Layout.BG_COLOR_SOLID|ccui.Layout.BG_COLOR_GRADIENT}
-
{cc.Point} getBackGroundColorVector()Get background color value.
- Returns:
- {cc.Point}
-
{cc.Color} getBackGroundEndColor()Get back ground end color
- Returns:
- {cc.Color}
-
{cc.Rect} getBackGroundImageCapInsets()Get background image cap insets.
- Returns:
- {cc.Rect}
-
{cc.Color} getBackGroundImageColor()Get backGround image color
- Returns:
- {cc.Color}
-
{Number} getBackGroundImageOpacity()Get backGround image opacity
- Returns:
- {Number}
-
{cc.Size} getBackGroundImageTextureSize()Gets background image texture size.
- Returns:
- {cc.Size}
-
{cc.Color} getBackGroundStartColor()Get back ground start color
- Returns:
- {cc.Color}
-
{ccui.Layout.CLIPPING_STENCIL|ccui.Layout.CLIPPING_SCISSOR} getClippingType()Get clipping type
- Returns:
- {ccui.Layout.CLIPPING_STENCIL|ccui.Layout.CLIPPING_SCISSOR}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{null} getLayoutType()Gets LayoutType.
- Returns:
- {null}
-
{Boolean} isBackGroundImageScale9Enabled()Get background image is use scale9 renderer.
- Returns:
- {Boolean}
-
{Boolean} isClippingEnabled()Gets if layout is clipping enabled.
- Returns:
- {Boolean}
-
removeAllChildren(cleanup)Remove all widget
- Parameters:
- {Boolean} cleanup
-
removeBackGroundImage()Remove the background image of layout.
-
removeChild(widget, cleanup)Remove widget
- Parameters:
- {ccui.Widget} widget
- {Boolean} cleanup
-
requestDoLayout()request do layout
-
setBackGroundColor(color, endColor)Sets background color for layout, if color type is Layout.COLOR_SOLID
-
setBackGroundColorOpacity(opacity)Sets background opacity layout.
- Parameters:
- {number} opacity
-
setBackGroundColorType(type)Sets Color Type for layout.
- Parameters:
- {ccui.Layout.BG_COLOR_NONE|ccui.Layout.BG_COLOR_SOLID|ccui.Layout.BG_COLOR_GRADIENT} type
-
setBackGroundColorVector(vector)Sets background color vector for layout, if color type is Layout.COLOR_GRADIENT
- Parameters:
- {cc.Point} vector
-
setBackGroundImage(fileName, texType)Sets a background image for layout
- Parameters:
- {String} fileName
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
setBackGroundImageCapInsets(capInsets)Sets a background image capinsets for layout, if the background image is a scale9 render.
- Parameters:
- {cc.Rect} capInsets
-
setBackGroundImageColor(color)Set backGround image color
- Parameters:
- {cc.Color} color
-
setBackGroundImageOpacity(opacity)Get backGround image color
- Parameters:
- {Number} opacity
-
setBackGroundImageScale9Enabled(able)Sets background image use scale9 renderer.
- Parameters:
- {Boolean} able
-
setClippingEnabled(able)Changes if layout can clip it's content and locChild.
- Parameters:
- {Boolean} able
-
setClippingType(type)Set clipping type
- Parameters:
- {ccui.Layout.CLIPPING_STENCIL|ccui.Layout.CLIPPING_SCISSOR} type
-
setLayoutType(type)Sets LayoutType.
- Parameters:
- {ccui.Layout.ABSOLUTE|ccui.Layout.LINEAR_VERTICAL|ccui.Layout.LINEAR_HORIZONTAL|ccui.Layout.RELATIVE} type