

This is the image or texture used by the Sprite during rendering. The y coordinate (in world space) to position the Sprite at. The x coordinate (in world space) to position the Sprite at. Parameters NameĪ reference to the currently running game. They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),Įvents (via Sprite.events), animation (via Sprite.animations), camera culling and more. They work fine!įeel free to submit a pull request or open an issue with suggestions or ideas.Sprites are the lifeblood of your game, used for nearly everything visual.Īt its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas. Find a clean way to support changing values on Sprites directly, without breaking or littering everything (consider defineProperty on them, as long as I'm good about cleaning them later).Var container, sprite1, sprite2 new Phaser. If you do not provide this option, all supported properties will be watched. Doing so will increase the performance of containers that are updated all the time (for example, using tweens). Starting at 1.2.0, you are able to provide a list of properties that will be watched using the watch option. Eg: setting the container to 0.5 will render all the children at 0.5, making them see-through when overlapping) alpha (it's currently impossible to implement this correctly.

Supported properties for both the Container and che children (please update this list when submitting a PR): Use child._containerProps.property instead of directly changing a child's properties.I couldn't find a clean way to inject my own code there.

This is due to the way Phaser's Class system and inheritance works.

You must use addChild() or createChild() on the Container, instead of add() and create().Interim Containers function very similar to Groups, with two important gotcha's: Simply download the index.js file and include it in your HTML file.
