2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module Button
|
2014-03-20 10:21:28 +08:00
|
|
|
-- @extend Widget
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module ccui
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2015-05-05 11:31:53 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Button] getNormalTextureSize
|
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query the button title content.<br>
|
|
|
|
-- return Get the button's title content.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getTitleText
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Change the font size of button's title<br>
|
|
|
|
-- param size Title font size in float.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setTitleFontSize
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #float size
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Enable scale9 renderer.<br>
|
|
|
|
-- param enable Set to true will use scale9 renderer, false otherwise.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setScale9Enabled
|
|
|
|
-- @param self
|
2015-03-26 10:44:28 +08:00
|
|
|
-- @param #bool enable
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-15 15:23:17 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return the inner title renderer of Button.<br>
|
|
|
|
-- return The button title.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- since v3.3
|
|
|
|
-- @function [parent=#Button] getTitleRenderer
|
|
|
|
-- @param self
|
|
|
|
-- @return Label#Label ret (return value: cc.Label)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-04-14 16:44:30 +08:00
|
|
|
-- brief Return a zoom scale<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- return the zoom scale in float<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- since v3.3
|
2014-08-15 15:23:17 +08:00
|
|
|
-- @function [parent=#Button] getZoomScale
|
|
|
|
-- @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
|
|
|
-- Return the capInsets of disabled state scale9sprite.<br>
|
|
|
|
-- return The disabled scale9 renderer capInsets.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getCapInsetsDisabledRenderer
|
|
|
|
-- @param self
|
|
|
|
-- @return rect_table#rect_table ret (return value: rect_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Change the color of button's title.<br>
|
|
|
|
-- param color The title color in Color3B.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setTitleColor
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #color3b_table color
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Sets capInsets for button, only the disabled state scale9 renderer will be affected.<br>
|
|
|
|
-- param capInsets capInsets in Rect.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setCapInsetsDisabledRenderer
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #rect_table capInsets
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Sets capInsets for button.<br>
|
|
|
|
-- The capInset affects all button scale9 renderer only if `setScale9Enabled(true)` is called<br>
|
|
|
|
-- param capInsets capInset in Rect.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setCapInsets
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #rect_table capInsets
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Load disabled state texture for button.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- param disabled dark state texture.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param texType @see `TextureResType`
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] loadTextureDisabled
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string disabled
|
|
|
|
-- @param #int texType
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2015-05-05 11:31:53 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Button] init
|
|
|
|
-- @param self
|
|
|
|
-- @param #string normalImage
|
|
|
|
-- @param #string selectedImage
|
|
|
|
-- @param #string disableImage
|
|
|
|
-- @param #int texType
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Change the content of button's title.<br>
|
|
|
|
-- param text The title in std::string.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setTitleText
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string text
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Sets capInsets for button, only the normal state scale9 renderer will be affected.<br>
|
|
|
|
-- param capInsets capInsets in Rect.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setCapInsetsNormalRenderer
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #rect_table capInsets
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Load selected state texture for button.<br>
|
|
|
|
-- param selected selected state texture.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param texType @see `TextureResType`
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] loadTexturePressed
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string selected
|
|
|
|
-- @param #int texType
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Change the font name of button's title<br>
|
|
|
|
-- param fontName a font name string.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setTitleFontName
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string fontName
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return the capInsets of normal state scale9sprite.<br>
|
|
|
|
-- return The normal scale9 renderer capInsets.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getCapInsetsNormalRenderer
|
|
|
|
-- @param self
|
|
|
|
-- @return rect_table#rect_table ret (return value: rect_table)
|
|
|
|
|
2015-05-27 17:08:33 +08:00
|
|
|
--------------------------------
|
|
|
|
-- @overload self, int, int
|
|
|
|
-- @overload self, int
|
|
|
|
-- @function [parent=#Button] setTitleAlignment
|
|
|
|
-- @param self
|
|
|
|
-- @param #int hAlignment
|
|
|
|
-- @param #int vAlignment
|
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Return the capInsets of pressed state scale9sprite.<br>
|
|
|
|
-- return The pressed scale9 renderer capInsets.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getCapInsetsPressedRenderer
|
|
|
|
-- @param self
|
|
|
|
-- @return rect_table#rect_table ret (return value: rect_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Load textures for button.<br>
|
|
|
|
-- param normal normal state texture name.<br>
|
|
|
|
-- param selected selected state texture name.<br>
|
|
|
|
-- param disabled disabled state texture name.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param texType @see `TextureResType`
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] loadTextures
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string normal
|
|
|
|
-- @param #string selected
|
|
|
|
-- @param #string disabled
|
|
|
|
-- @param #int texType
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query whether button is using scale9 renderer or not.<br>
|
|
|
|
-- return whether button use scale9 renderer or not.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] isScale9Enabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Load normal state texture for button.<br>
|
|
|
|
-- param normal normal state texture.<br>
|
2015-03-26 10:44:28 +08:00
|
|
|
-- param texType @see `TextureResType`
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] loadTextureNormal
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string normal
|
|
|
|
-- @param #int texType
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Sets capInsets for button, only the pressed state scale9 renderer will be affected.<br>
|
|
|
|
-- param capInsets capInsets in Rect
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setCapInsetsPressedRenderer
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #rect_table capInsets
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query the font size of button title<br>
|
|
|
|
-- return font size in float.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getTitleFontSize
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query the font name of button's title<br>
|
|
|
|
-- return font name in std::string
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getTitleFontName
|
|
|
|
-- @param self
|
2014-04-04 18:45:34 +08:00
|
|
|
-- @return string#string ret (return value: string)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Query the button title color.<br>
|
|
|
|
-- return Color3B of button title.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] getTitleColor
|
|
|
|
-- @param self
|
2014-05-08 11:19:36 +08:00
|
|
|
-- @return color3b_table#color3b_table ret (return value: color3b_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Enable zooming action when button is pressed.<br>
|
|
|
|
-- param enabled Set to true will enable zoom effect, false otherwise.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] setPressedActionEnabled
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool enabled
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-08-15 15:23:17 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- @brief When user pressed the button, the button will zoom to a scale.<br>
|
2014-09-17 11:35:46 +08:00
|
|
|
-- The final scale of the button equals (button original scale + _zoomScale)<br>
|
|
|
|
-- since v3.3
|
2014-08-15 15:23:17 +08:00
|
|
|
-- @function [parent=#Button] setZoomScale
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #float scale
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-08-15 15:23:17 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-07-17 22:20:04 +08:00
|
|
|
-- @overload self, string, string, string, int
|
2014-07-17 10:28:34 +08:00
|
|
|
-- @overload self
|
2014-04-04 18:45:34 +08:00
|
|
|
-- @function [parent=#Button] create
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string normalImage
|
|
|
|
-- @param #string selectedImage
|
|
|
|
-- @param #string disableImage
|
|
|
|
-- @param #int texType
|
2014-10-17 22:56:22 +08:00
|
|
|
-- @return Button#Button ret (return value: ccui.Button)
|
2014-04-04 18:45:34 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] createInstance
|
|
|
|
-- @param self
|
|
|
|
-- @return Ref#Ref ret (return value: cc.Ref)
|
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#Button] getVirtualRenderer
|
|
|
|
-- @param self
|
|
|
|
-- @return Node#Node ret (return value: cc.Node)
|
|
|
|
|
2015-05-05 11:31:53 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Button] init
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#Button] getDescription
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-04-18 10:51:14 +08:00
|
|
|
-- @function [parent=#Button] getVirtualRendererSize
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @function [parent=#Button] ignoreContentAdaptWithSize
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool ignore
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-26 10:44:28 +08:00
|
|
|
-- Default constructor.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#Button] Button
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return Button#Button self (return value: ccui.Button)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|