Class TouchStick
Extends
CanvasObject.
Defined in: arcade-controls.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Joystick emulation for mouse and 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)
|
|
Return deflection vector with length [0.
|
|
getX()
Return x deflection [-1.0 .
|
|
getY()
Return y deflection [-1.0 .
|
|
init(opts)
|
|
isActive()
Return true if joystick is currently used.
|
|
onDrag(dragOffset)
|
|
onDragcancel(dragOffset)
|
|
onDragstart(clickPos)
|
|
onDrop(dragOffset)
|
|
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
getDeflection()
Return deflection vector with length [0..r2].
getX()
Return x deflection [-1.0 .. +1.0].
getY()
Return y deflection [-1.0 .. +1.0].
init(opts)
- Parameters:
- opts
isActive()
Return true if joystick is currently used.
onDrag(dragOffset)
- Parameters:
- dragOffset
onDragcancel(dragOffset)
- Parameters:
- dragOffset
onDragstart(clickPos)
- Parameters:
- clickPos
onDrop(dragOffset)
- Parameters:
- dragOffset
onTouchevent(e, orgEvent)
- Parameters:
- e
- orgEvent
render(ctx)
- Parameters:
- ctx