Docs for Version: 1.0a
Show:
Module: Animation

Class for animating GameObject's to desired state

Constructor

Animation

(
  • parent
  • time
  • [options]
)

Parameters:

  • parent GameObject

    Parent in render tree

  • time Int

    time in miliseconds

  • [options] Object optional

    options of Animation

Example:

var world = new Scene()
                                var gameobject = new GameObject(world,{})
                                var ani = new Animation(gameobject, 500, {
                                    x: planet.x + Math.sin(this.angle * Math.degToRad) * (pll - 1),
                                    y: planet.y + Math.cos(this.angle * Math.degToRad) * (pll - 1),
                                    onComplete: function (e) {
                                        e.remove()
                                    }
                                })
                                ani.run()

Item Index

Methods

Methods

execute

() private

Checks if animation should run and fires it when ready.

run

() private

Runs animation