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 Optional
- {Number} tag Optional
-
allocates and initializes a UILayout.
// example var uiLayout = ccui.Layout.create();
- Returns:
- {ccui.Layout}
-
ctor()allocates and initializes a UILayout. Constructor of ccui.Layout
// example var uiLayout = new ccui.Layout();
-
{ccui.Widget} findNextFocusedWidget(direction, current)When a widget is in a layout, you could call this method to get the next focused widget within a specified direction. If the widget is not in a layout, it will return itself
- Parameters:
- direction
- the direction to look for the next focused widget in a layout
- current
- the current focused widget
- Returns:
- {ccui.Widget} return the index of widget in the 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()Gets 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}
-
{boolean} isLoopFocus()Gets whether enable focus loop
- Returns:
- {boolean} If focus loop is enabled, then it will return true, otherwise it returns false. The default value is false.
-
{boolean} isPassFocusToChild()
- Returns:
- {boolean} To query whether the layout will pass the focus to its children or not. The default value is true
-
removeAllChildren(cleanup)Removes all children from the container with a cleanup.
- Parameters:
- {Boolean} cleanup
-
removeAllChildrenWithCleanup(cleanup)Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.
- Parameters:
- {Boolean} cleanup
- true if all running actions on all children nodes should be cleanup, false otherwise.
-
removeBackGroundImage()Remove the background image of layout.
-
removeChild(widget, cleanup)Remove child widget from ccui.Layout
- 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
-
setLoopFocus(loop)If a layout is loop focused which means that the focus movement will be inside the layout
- Parameters:
- {Boolean} loop
- pass true to let the focus movement loop inside the layout
-
setPassFocusToChild(pass)
- Parameters:
- pass
- To specify whether the layout pass its focus to its child