Class TouchButton
Extends
CanvasObject.
Defined in: arcade-controls.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Button for mouse touch screen devices.
|
Field Attributes | Field Name and Description |
---|---|
Called when button was clicked (i.e.
|
- Fields borrowed from class Movable:
- clipModeX, clipModeY, game, hidden, id, orientation, pos, scale, type, useCC
Method Attributes | Method Name and Description |
---|---|
containsCC(ptCC)
|
|
init(opts)
|
|
isDown()
Return true if button is down (but mouse key is also still down).
|
|
onMousedown(e)
|
|
onMousemove(e)
|
|
onMouseup(e)
|
|
onTouchevent(e, orgEvent)
|
|
render(ctx)
|
- Methods borrowed from class CanvasObject:
- onResize
- Methods borrowed from class Movable:
- contains, die, driveToPosition, getActivity, getBoundingBox, getBoundingCircle, intersectsWith, isActivity, isDead, later, setActivity, toString, turnToDirection
- Events borrowed from class Movable:
- onDie, onDrag, onDragcancel, onDragstart, onDrop, onKeydown, onKeypress, onKeyup, onMousewheel, onSetActivity, onTimeout, onTouchevent, render, step
Field Detail
onClick
Called when button was clicked (i.e. pushed and released).
Method Detail
containsCC(ptCC)
- Parameters:
- ptCC
init(opts)
- Parameters:
- opts
isDown()
Return true if button is down (but mouse key is also still down).
onMousedown(e)
- Parameters:
- e
onMousemove(e)
- Parameters:
- e
onMouseup(e)
- Parameters:
- e
onTouchevent(e, orgEvent)
- Parameters:
- e
- orgEvent
render(ctx)
- Parameters:
- ctx