Properties

interactable Boolean

Whether the Button is disabled. If true, the Button will trigger event and do transition.
是否禁用按钮。如果启用,按钮将触发事件和过渡转换。

transition Button.Transition

Transition type
转换类型。

normalColor cc.Color

Normal state color
正常状态颜色。

pressedColor cc.Color

Pressed state color
按下状态颜色。

hoverColor cc.Color

Hover state color
盘旋颜色。(鼠标浮在按钮上)

disabledColor cc.Color

Disabled state color
禁用状态颜色。

duration Float

Color transition duration
颜色过渡持续时间。

normalSprite cc.SpriteFrame

Normal state sprite
正常状态Sprite.

pressedSprite cc.SpriteFrame

Pressed state sprite
按下状态Sprite.

hoverSprite cc.SpriteFrame

Hover state sprite
盘旋状态Sprite.

disabledSprite cc.SpriteFrame

Disabled state sprite
禁用状态Sprite.

target cc.Node

Transition target. When Button state changed: If Transition type is Button.Transition.NONE, Button will do nothing If Transition type is Button.Transition.COLOR, Button will change target's color If Transition type is Button.Transition.SPRITE, Button will change target Sprite's sprite.
转换目标。当按钮状态改变时:
如果是Button.Transition.NONE类型,按钮无变化。
如果是Button.Transition.COLOR类型,按钮将改变目标颜色。
如果是Button.Transition.SPRITE类型,按钮将改变目标Sprite的sprite。

clickEvents [Button.ClickEvent]

If Button is clicked, it will trigger event's handler.
如果按钮被单击时,它将触发事件的处理程序.