CopperLicht API Documentation
Class CL3D.AnimatorOnClick
Scene node animator which invokes a callback function when the scene node has been clicked.
Extends
CL3D.Animator.
Class Overview
CL3D.AnimatorOnClick(scene, engine, functionToCall, register)
Scene node animator which invokes a callback function when the scene node has been clicked.
Note: In this version, only bounding box checks are working, this will change in one of the next releases.
It works like in this example:
var yourFunction = function(){ alert('your scene node has been clicked!'); } var animator = new CL3D.AnimatorOnClick(engine.getScene(), engine, yourFunction); yourSceneNode.addAnimator(animator);
- Parameters:
- scene
- {CL3D.Scene} The scene of the animator.
- engine
- {CL3D.CopperLicht} an instance of the 3d engine
- functionToCall
- {function} a function which should be called when the scene node has been clicked
- register
- {Boolean} (optional) set to true to prevent registering at the scene using registerSceneNodeAnimatorForEvents
Method Attributes | Method Name and Description |
---|---|
animateNode(n, timeMs)
Animates the scene node it is attached to and returns true if scene node was modified.
|
|
getType()
Returns the type of the animator.
|
- Methods borrowed from class CL3D.Animator:
- createClone, onKeyDown, onKeyUp, onMouseDown, onMouseMove, onMouseUp, onMouseWheel
Method Detail
animateNode(n, timeMs)
Animates the scene node it is attached to and returns true if scene node was modified.
- Parameters:
- {CL3D.SceneNode} n
- The Scene node which needs to be animated this frame.
- {Integer} timeMs
- The time in milliseconds since the start of the scene.
getType()
Returns the type of the animator.
For the AnimatorOnClick, this will return 'onclick'.