2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module Widget
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @extend ProtectedNode,LayoutParameterProtocol
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module ccui
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-12-24 14:42:09 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Toggle layout component enable.<br>
|
2014-12-24 14:42:09 +08:00
|
|
|
-- param enable Layout Component of a widget<br>
|
|
|
|
-- return void
|
|
|
|
-- @function [parent=#Widget] setLayoutComponentEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @param #bool enable
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-12-24 14:42:09 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Changes the percent that is widget's percent size<br>
|
|
|
|
-- param percent that is widget's percent size
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setSizePercent
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table percent
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Get the user defined widget size.<br>
|
|
|
|
-- return User defined size.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] getCustomSize
|
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets the left boundary position of this widget in parent's coordination system.<br>
|
|
|
|
-- return The left boundary position of this widget.
|
2014-08-22 19:25:33 +08:00
|
|
|
-- @function [parent=#Widget] getLeftBoundary
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-08-22 19:25:33 +08:00
|
|
|
-- @return float#float ret (return value: float)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets whether the widget should be flipped horizontally or not.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param flippedX true if the widget should be flipped horizaontally, false otherwise.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setFlippedX
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool flippedX
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-12-04 10:11:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Set callback name.<br>
|
|
|
|
-- param callbackName A string representation of callback name.
|
2014-12-04 10:11:58 +08:00
|
|
|
-- @function [parent=#Widget] setCallbackName
|
|
|
|
-- @param self
|
|
|
|
-- @param #string callbackName
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-12-04 10:11:58 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets the inner Renderer node of widget.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- For example, a button's Virtual Renderer is it's texture renderer.<br>
|
|
|
|
-- return Node pointer.
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @function [parent=#Widget] getVirtualRenderer
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @return Node#Node ret (return value: cc.Node)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-18 23:26:32 +08:00
|
|
|
--------------------------------
|
2014-09-17 11:35:46 +08:00
|
|
|
-- brief Allow widget touch events to propagate to its parents. Set false will disable propagation<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param isPropagate True to allow propagation, false otherwise.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- since v3.3
|
2014-08-18 23:26:32 +08:00
|
|
|
-- @function [parent=#Widget] setPropagateTouchEvents
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool isPropagate
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-08-18 23:26:32 +08:00
|
|
|
|
2014-12-08 18:14:41 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query whether unify size enable state. <br>
|
2014-12-08 18:14:41 +08:00
|
|
|
-- return true represent the widget use Unify Size, false represent the widget couldn't use Unify Size
|
|
|
|
-- @function [parent=#Widget] isUnifySizeEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Get size percent of widget.<br>
|
|
|
|
-- return Percent size.
|
2014-06-24 18:48:02 +08:00
|
|
|
-- @function [parent=#Widget] getSizePercent
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-06-24 18:48:02 +08:00
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Set the percent(x,y) of the widget in OpenGL coordinates<br>
|
|
|
|
-- param percent The percent (x,y) of the widget in OpenGL coordinates
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setPositionPercent
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table percent
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-18 23:26:32 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Toggle widget swallow touch option.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- brief Specify widget to swallow touches or not<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param swallow True to swallow touch, false otherwise.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- since v3.3
|
2014-08-18 23:26:32 +08:00
|
|
|
-- @function [parent=#Widget] setSwallowTouches
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool swallow
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-08-18 23:26:32 +08:00
|
|
|
|
2014-03-13 11:37:37 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Get the content size of widget.<br>
|
|
|
|
-- warning This API exists mainly for keeping back compatibility.<br>
|
|
|
|
-- return
|
2014-03-13 11:37:37 +08:00
|
|
|
-- @function [parent=#Widget] getLayoutSize
|
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets whether the widget is hilighted<br>
|
|
|
|
-- The default value is false, a widget is default to not hilighted<br>
|
|
|
|
-- param hilight true if the widget is hilighted, false if the widget is not hilighted.
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @function [parent=#Widget] setHighlighted
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool hilight
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-05-08 14:03:37 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Changes the position type of the widget<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- see `PositionType`<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param type the position type of widget
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setPositionType
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int type
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Query whether the widget ignores user deinfed content size or not<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- return True means ignore user defined content size, false otherwise.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] isIgnoreContentAdaptWithSize
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Get the virtual renderer's size<br>
|
|
|
|
-- return Widget virtual renderer size.
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @function [parent=#Widget] getVirtualRendererSize
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Determines if the widget is highlighted<br>
|
|
|
|
-- return true if the widget is highlighted, false if the widget is not hignlighted .
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @function [parent=#Widget] isHighlighted
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Gets LayoutParameter of widget.<br>
|
|
|
|
-- see LayoutParameter<br>
|
|
|
|
-- return LayoutParameter
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] getLayoutParameter
|
|
|
|
-- @param self
|
|
|
|
-- @return LayoutParameter#LayoutParameter ret (return value: ccui.LayoutParameter)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Gets the position type of the widget<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- see `PositionType`<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return type the position type of widget
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] getPositionType
|
|
|
|
-- @param self
|
2014-07-17 22:20:04 +08:00
|
|
|
-- @return int#int ret (return value: int)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-26 13:44:22 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets the top boundary position of this widget in parent's coordination system.<br>
|
|
|
|
-- return The top boundary position of this widget.
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @function [parent=#Widget] getTopBoundary
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Toggle whether ignore user defined content size for widget.<br>
|
|
|
|
-- Set true will ignore user defined content size which means <br>
|
2015-03-27 00:17:35 +08:00
|
|
|
-- the widget size is always equal to the return value of `getVirtualRendererSize`.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param ignore set member variabl _ignoreSize to ignore
|
2014-06-18 11:44:06 +08:00
|
|
|
-- @function [parent=#Widget] ignoreContentAdaptWithSize
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool ignore
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-22 19:25:33 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- When a widget is in a layout, you could call this method to get the next focused widget within a specified direction. <br>
|
|
|
|
-- If the widget is not in a layout, it will return itself<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param direction the direction to look for the next focused widget in a layout<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param current the current focused widget<br>
|
|
|
|
-- return the next focused widget in a layout
|
2014-08-22 19:25:33 +08:00
|
|
|
-- @function [parent=#Widget] findNextFocusedWidget
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int direction
|
|
|
|
-- @param #ccui.Widget current
|
2014-08-22 19:25:33 +08:00
|
|
|
-- @return Widget#Widget ret (return value: ccui.Widget)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Determines if the widget is enabled or not.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return true if the widget is enabled, false if the widget is disabled.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] isEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query whether widget is focused or not.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return whether the widget is focused or not
|
2014-03-25 16:13:42 +08:00
|
|
|
-- @function [parent=#Widget] isFocused
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-03-25 16:13:42 +08:00
|
|
|
-- @return bool#bool ret (return value: bool)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets the touch began point of widget when widget is selected.<br>
|
|
|
|
-- return the touch began point.
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @function [parent=#Widget] getTouchBeganPosition
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @param self
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-05-08 14:03:37 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Determines if the widget is touch enabled<br>
|
|
|
|
-- return true if the widget is touch enabled, false if the widget is touch disabled.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] isTouchEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-12-04 10:11:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query callback name.<br>
|
|
|
|
-- return The callback name.
|
2014-12-04 10:11:58 +08:00
|
|
|
-- @function [parent=#Widget] getCallbackName
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Get the action tag.<br>
|
|
|
|
-- return Action tag.
|
2014-04-18 10:51:14 +08:00
|
|
|
-- @function [parent=#Widget] getActionTag
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-04-18 10:51:14 +08:00
|
|
|
-- @return int#int ret (return value: int)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets position of widget in world space.<br>
|
|
|
|
-- return Position of widget in world space.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] getWorldPosition
|
|
|
|
-- @param self
|
2014-05-27 14:31:18 +08:00
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-18 23:26:32 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query widget's focus enable state.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return true represent the widget could accept focus, false represent the widget couldn't accept focus
|
2014-08-18 23:26:32 +08:00
|
|
|
-- @function [parent=#Widget] isFocusEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Toggle widget focus status.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param focus pass true to let the widget get focus or pass false to let the widget lose focus<br>
|
|
|
|
-- return void
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setFocused
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool focus
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-26 13:44:22 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Set the tag of action.<br>
|
|
|
|
-- param tag A integer tag value.
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @function [parent=#Widget] setActionTag
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int tag
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-05-26 13:44:22 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-31 12:01:57 +08:00
|
|
|
-- Sets whether the widget is touch enabled.<br>
|
|
|
|
-- The default value is false, a widget is default to touch disabled.<br>
|
|
|
|
-- param enabled True if the widget is touch enabled, false if the widget is touch disabled.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setTouchEnabled
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool enabled
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets whether the widget should be flipped vertically or not.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param flippedY true if the widget should be flipped vertically, flase otherwise.
|
2014-08-22 19:25:33 +08:00
|
|
|
-- @function [parent=#Widget] setFlippedY
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool flippedY
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets whether the widget is enabled<br>
|
|
|
|
-- true if the widget is enabled, widget may be touched , false if the widget is disabled, widget cannot be touched.<br>
|
2015-03-27 00:17:35 +08:00
|
|
|
-- Note: If you want to change the widget's appearance to disabled state, you should also call `setBright(false)`.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- The default value is true, a widget is default to enable touch.<br>
|
|
|
|
-- param enabled Set to true to enable touch, false otherwise.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setEnabled
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool enabled
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets the right boundary position of this widget in parent's coordination system.<br>
|
|
|
|
-- return The right boundary position of this widget.
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @function [parent=#Widget] getRightBoundary
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @return float#float ret (return value: float)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- To set the bright style of widget.<br>
|
|
|
|
-- see BrightStyle<br>
|
|
|
|
-- param style BrightStyle::NORMAL means the widget is in normal state, BrightStyle::HIGHLIGHT means the widget is in highlight state.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setBrightStyle
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int style
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets a LayoutParameter to widget.<br>
|
|
|
|
-- see LayoutParameter<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param parameter LayoutParameter pointer
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setLayoutParameter
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #ccui.LayoutParameter parameter
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Create a new widget copy of the original one.<br>
|
|
|
|
-- return A cloned widget copy of original.
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @function [parent=#Widget] clone
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @return Widget#Widget ret (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Allow widget to accept focus.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param enable pass true/false to enable/disable the focus ability of a widget<br>
|
|
|
|
-- return void
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @function [parent=#Widget] setFocusEnabled
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool enable
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-05-08 14:03:37 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Gets the bottom boundary position of this widget in parent's coordination system.<br>
|
|
|
|
-- return The bottom boundary position of this widget.
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @function [parent=#Widget] getBottomBoundary
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-05-26 13:44:22 +08:00
|
|
|
-- @return float#float ret (return value: float)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Determines if the widget is bright<br>
|
|
|
|
-- return true if the widget is bright, false if the widget is dark.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] isBright
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-10-14 14:32:12 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Toggle use unify size.<br>
|
|
|
|
-- param enable True to use unify size, false otherwise.<br>
|
2014-10-14 14:32:12 +08:00
|
|
|
-- return void
|
|
|
|
-- @function [parent=#Widget] setUnifySizeEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @param #bool enable
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-10-14 14:32:12 +08:00
|
|
|
|
2014-08-18 23:26:32 +08:00
|
|
|
--------------------------------
|
2014-09-17 11:35:46 +08:00
|
|
|
-- Return whether the widget is propagate touch events to its parents or not<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- return whether touch event propagation is allowed or not.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- since v3.3
|
2014-08-18 23:26:32 +08:00
|
|
|
-- @function [parent=#Widget] isPropagateTouchEvents
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return a current focused widget in your UI scene.<br>
|
|
|
|
-- No matter what widget object you call this method on , it will return you the exact one focused widget.
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @function [parent=#Widget] getCurrentFocusedWidget
|
|
|
|
-- @param self
|
|
|
|
-- @return Widget#Widget ret (return value: ccui.Widget)
|
|
|
|
|
2014-12-04 10:11:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Checks a point is in widget's content space.<br>
|
|
|
|
-- This function is used for determining touch area of widget.<br>
|
|
|
|
-- param pt The point in `Vec2`.<br>
|
|
|
|
-- return true if the point is in widget's content space, flase otherwise.
|
2014-12-04 10:11:58 +08:00
|
|
|
-- @function [parent=#Widget] hitTest
|
|
|
|
-- @param self
|
|
|
|
-- @param #vec2_table pt
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-12-24 14:42:09 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query whether layout component is enabled or not. <br>
|
2014-12-24 14:42:09 +08:00
|
|
|
-- return true represent the widget use Layout Component, false represent the widget couldn't use Layout Component.
|
|
|
|
-- @function [parent=#Widget] isLayoutComponentEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- when a widget calls this method, it will get focus immediately.
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @function [parent=#Widget] requestFocus
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-05-08 14:03:37 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-07-17 10:28:34 +08:00
|
|
|
-- @overload self, size_table
|
|
|
|
-- @overload self
|
2014-03-25 16:13:42 +08:00
|
|
|
-- @function [parent=#Widget] updateSizeAndPosition
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #size_table parentSize
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-25 16:13:42 +08:00
|
|
|
|
2014-06-09 11:15:50 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @function [parent=#Widget] getTouchMovePosition
|
|
|
|
-- @param self
|
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Gets the size type of widget.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- see `SizeType`
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] getSizeType
|
|
|
|
-- @param self
|
2014-07-17 22:20:04 +08:00
|
|
|
-- @return int#int ret (return value: int)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-12-04 10:11:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query callback type.<br>
|
|
|
|
-- return Callback type string.
|
2014-12-04 10:11:58 +08:00
|
|
|
-- @function [parent=#Widget] getCallbackType
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
2014-05-12 16:14:14 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @function [parent=#Widget] getTouchEndPosition
|
2014-05-12 16:14:14 +08:00
|
|
|
-- @param self
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-05-12 16:14:14 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Gets the percent (x,y) of the widget in OpenGL coordinates<br>
|
|
|
|
-- see setPosition(const Vec2&)<br>
|
|
|
|
-- return The percent (x,y) of the widget in OpenGL coordinates
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] getPositionPercent
|
|
|
|
-- @param self
|
2014-05-27 14:31:18 +08:00
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Returns the flag which indicates whether the widget is flipped horizontally or not.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- It not only flips the texture of the widget, but also the texture of the widget's children.<br>
|
|
|
|
-- Also, flipping relies on widget's anchor point.<br>
|
|
|
|
-- Internally, it just use setScaleX(-1) to flip the widget.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return true if the widget is flipped horizaontally, false otherwise.
|
2014-03-25 16:13:42 +08:00
|
|
|
-- @function [parent=#Widget] isFlippedX
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Return the flag which indicates whether the widget is flipped vertically or not.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- It not only flips the texture of the widget, but also the texture of the widget's children.<br>
|
|
|
|
-- Also, flipping relies on widget's anchor point.<br>
|
|
|
|
-- Internally, it just use setScaleY(-1) to flip the widget.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- return true if the widget is flipped vertically, flase otherwise.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] isFlippedY
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-06-09 11:15:50 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Checks a point if in parent's area.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param pt A point in `Vec2`.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- return true if the point is in parent's area, flase otherwise.
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @function [parent=#Widget] isClippingParentContainsPoint
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table pt
|
2014-06-09 11:15:50 +08:00
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Changes the size type of widget.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- see `SizeType`<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param type that is widget's size type
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setSizeType
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int type
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets whether the widget is bright<br>
|
|
|
|
-- The default value is true, a widget is default to bright<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param bright true if the widget is bright, false if the widget is dark.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] setBright
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool bright
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-12-04 10:11:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Set callback type.<br>
|
|
|
|
-- param callbackType A string representation of callback type.
|
2014-12-04 10:11:58 +08:00
|
|
|
-- @function [parent=#Widget] setCallbackType
|
|
|
|
-- @param self
|
|
|
|
-- @param #string callbackType
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-12-04 10:11:58 +08:00
|
|
|
|
2014-05-08 14:03:37 +08:00
|
|
|
--------------------------------
|
2014-09-17 11:35:46 +08:00
|
|
|
-- Return whether the widget is swallowing touch or not<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- return Whether touch is swallowed.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- since v3.3
|
2014-08-18 23:26:32 +08:00
|
|
|
-- @function [parent=#Widget] isSwallowTouches
|
2014-05-08 14:03:37 +08:00
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-05-27 10:21:22 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-05-27 10:21:22 +08:00
|
|
|
-- @function [parent=#Widget] enableDpadNavigation
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool enable
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-05-27 10:21:22 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Create and return a empty Widget instance pointer.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] create
|
|
|
|
-- @param self
|
|
|
|
-- @return Widget#Widget ret (return value: ccui.Widget)
|
|
|
|
|
2014-11-24 15:24:39 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Widget] setScaleY
|
|
|
|
-- @param self
|
|
|
|
-- @param #float scaleY
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-11-24 15:24:39 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Widget] setScaleX
|
|
|
|
-- @param self
|
|
|
|
-- @param #float scaleX
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-11-24 15:24:39 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Widget] getScaleY
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Widget] getScaleX
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Returns the string representation of widget class name<br>
|
|
|
|
-- return get the class description.
|
2014-06-09 09:46:34 +08:00
|
|
|
-- @function [parent=#Widget] getDescription
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @param self
|
2014-06-09 09:46:34 +08:00
|
|
|
-- @return string#string ret (return value: string)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-11-24 15:24:39 +08:00
|
|
|
--------------------------------
|
|
|
|
-- @overload self, float, float
|
|
|
|
-- @overload self, float
|
|
|
|
-- @function [parent=#Widget] setScale
|
|
|
|
-- @param self
|
|
|
|
-- @param #float scalex
|
|
|
|
-- @param #float scaley
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-11-24 15:24:39 +08:00
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Changes the position (x,y) of the widget in OpenGL coordinates<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Usually we use p(x,y) to compose a Vec2 object.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- The original point (0,0) is at the left-bottom corner of screen.<br>
|
2015-03-31 12:01:57 +08:00
|
|
|
-- param pos The position (x,y) of the widget in OpenGL coordinates
|
2014-03-25 16:13:42 +08:00
|
|
|
-- @function [parent=#Widget] setPosition
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table pos
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-06-24 18:48:02 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Changes the size that is widget's size<br>
|
|
|
|
-- param contentSize A content size in `Size`.
|
2014-06-24 18:48:02 +08:00
|
|
|
-- @function [parent=#Widget] setContentSize
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #size_table contentSize
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-06-24 18:48:02 +08:00
|
|
|
|
2014-11-24 15:24:39 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Widget] getScale
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-31 12:01:57 +08:00
|
|
|
-- Default constructor<br>
|
|
|
|
-- js ctor<br>
|
|
|
|
-- lua new
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Widget] Widget
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Widget#Widget self (return value: ccui.Widget)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|