Creature#Creature

new Creature(game, x, y, key, mesh, animation)

Creature is a custom Game Object used in conjunction with the Creature Runtime libraries by Kestrel Moon Studios.

It allows you to display animated Game Objects that were created with the Creature Automated Animation Tool.

Note 1: You can only use Phaser.Creature objects in WebGL enabled games. They do not work in Canvas mode games.

Note 2: You must use a build of Phaser that includes the CreatureMeshBone.js runtime and gl-matrix.js, or have them
loaded before your Phaser game boots.

See the Phaser custom build process for more details.

By default the Creature runtimes are NOT included in any pre-configured version of Phaser.

So you'll need to do grunt custom to create a build that includes them.

Parameters
Name Type Argument Default Description
game Phaser.Game

A reference to the currently running game.

x number

The x coordinate of the Game Object. The coordinate is relative to any parent container this Game Object may be in.

y number

The y coordinate of the Game Object. The coordinate is relative to any parent container this Game Object may be in.

key string | PIXI.Texture

The texture used by the Creature Object during rendering. It can be a string which is a reference to the Cache entry, or an instance of a PIXI.Texture.

mesh string

The mesh data for the Creature Object. It should be a string which is a reference to the Cache JSON entry.

animation string <optional>
'default'

The animation within the mesh data to play.

Source code: gameobjects/Creature.js (Line 42)
doc_phaser
2017-02-14 10:43:24
Comments
Leave a Comment

Please login to continue.