filmov
tv
ZIM Basics 12 - How to add a MotionController on the HTML 5 Canvas with JavaScript and ZIMjs

Показать описание
The ZIM MotionController lets you move ZIM DisplayObjects on the HTML 5 Canvas with JavaScript. Generally, the ZIM Controls operate on existing Display Objects - with the MotionController, this could be a shape, a Sprite, a Pen, etc. MotionController has a number of different types:
set to "mousemove" to have the target follow the mouse movement
set to "pressmove" to have target jump to mousedown position then follow while pressing
set to "pressdrag" to have target follow mouse if pressed on and then dragged
set to "keydown" to use keys to control the target (see map parameter)
set to "gamebutton" to use gamepad buttons to control the target (see map parameter)
set to "gamestick" to use gamepad stick(s) to control the target (see map parameter)
set to "swipe" to use swipe to control the target
set to a ZIM DPad object to use the DPad to control the motion
set to "mousemove" to have the target follow the mouse movement
set to "pressmove" to have target jump to mousedown position then follow while pressing
set to "pressdrag" to have target follow mouse if pressed on and then dragged
set to "keydown" to use keys to control the target (see map parameter)
set to "gamebutton" to use gamepad buttons to control the target (see map parameter)
set to "gamestick" to use gamepad stick(s) to control the target (see map parameter)
set to "swipe" to use swipe to control the target
set to a ZIM DPad object to use the DPad to control the motion