Skip to content

Sprite_Button()

精灵_按钮
显示按钮的精灵。
Sprite_Button
The sprite for displaying a button.

Kind: global function

  • Sprite_Button()
    • .initialize()
    • .update()
    • .updateFrame()
    • .setColdFrame(x, y, width, height)
    • .setHotFrame(x, y, width, height)
    • .setClickHandler(method)
    • .callClickHandler()
    • .processTouch()
    • .isActive() ⇒ boolean
    • .isButtonTouched() ⇒ boolean
    • .canvasToLocalX(x) ⇒ number
    • .canvasToLocalY(y) ⇒ number

sprite_Button.initialize()

初始化
Initialize

Kind: instance method of Sprite_Button


sprite_Button.update()

更新
Update

Kind: instance method of Sprite_Button


sprite_Button.updateFrame()

更新帧
Update frame

Kind: instance method of Sprite_Button


sprite_Button.setColdFrame(x, y, width, height)

设置冷帧
按钮未按下时的显示区域。
Set cold frame
The display area when the button is not pressed.

Kind: instance method of Sprite_Button

ParamTypeDescription
xnumberX 坐标 - X coordinate
ynumberY 坐标 - Y coordinate
widthnumber宽度 - Width
heightnumber高度 - Height

sprite_Button.setHotFrame(x, y, width, height)

设置热帧
按钮按下时的显示区域。
Set hot frame
The display area when the button is pressed.

Kind: instance method of Sprite_Button

ParamTypeDescription
xnumberX 坐标 - X coordinate
ynumberY 坐标 - Y coordinate
widthnumber宽度 - Width
heightnumber高度 - Height

sprite_Button.setClickHandler(method)

设置点击处理者

Kind: instance method of Sprite_Button

ParamTypeDescription
methodfunction点击处理方法 - Click handler method Set click handler

sprite_Button.callClickHandler()

呼叫点击处理者
Call click handler

Kind: instance method of Sprite_Button


sprite_Button.processTouch()

处理触摸
Process touch

Kind: instance method of Sprite_Button


sprite_Button.isActive() ⇒ boolean

是否活动的

Kind: instance method of Sprite_Button
Returns: boolean - 是否活动 - Whether is active
Is active


sprite_Button.isButtonTouched() ⇒ boolean

是否按钮被触摸

Kind: instance method of Sprite_Button
Returns: boolean - 是否按钮被触摸 - Whether button is touched
Is button touched


sprite_Button.canvasToLocalX(x) ⇒ number

画布 X 坐标转换到本地 X 坐标

Kind: instance method of Sprite_Button
Returns: number - 本地 X 坐标 - Local X coordinate
Canvas X to local X

ParamTypeDescription
xnumber画布 X 坐标 - Canvas X coordinate

sprite_Button.canvasToLocalY(y) ⇒ number

画布 Y 坐标转换到本地 Y 坐标

Kind: instance method of Sprite_Button
Returns: number - 本地 Y 坐标 - Local Y coordinate
Canvas Y to local Y

ParamTypeDescription
ynumber画布 Y 坐标 - Canvas Y coordinate

贡献者

暂无相关贡献者

页面历史

暂无最近变更历史
最近更新