mirror of
https://github.com/wassname/phaser.git
synced 2026-07-10 00:30:50 +08:00
Adding Type support for collision checks.
This commit is contained in:
@@ -21,6 +21,8 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
|
||||
|
||||
Phaser.Sprite.call(this, game, x, y, key, outFrame);
|
||||
|
||||
this.type = Phaser.BUTTON;
|
||||
|
||||
this._onOverFrameName = null;
|
||||
this._onOutFrameName = null;
|
||||
this._onDownFrameName = null;
|
||||
|
||||
@@ -14,6 +14,8 @@ Phaser.Graphics = function (game, x, y) {
|
||||
|
||||
PIXI.DisplayObjectContainer.call(this);
|
||||
|
||||
this.type = Phaser.GRAPHICS;
|
||||
|
||||
this.position.x = x;
|
||||
this.position.y = y;
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ Phaser.RenderTexture = function (game, key, width, height) {
|
||||
|
||||
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
||||
|
||||
this.type = Phaser.RENDERTEXTURE;
|
||||
|
||||
if (PIXI.gl)
|
||||
{
|
||||
this.initWebGL();
|
||||
|
||||
@@ -17,6 +17,8 @@ Phaser.Sprite = function (game, x, y, key, frame) {
|
||||
|
||||
this.name = '';
|
||||
|
||||
this.type = Phaser.SPRITE;
|
||||
|
||||
this.renderOrderID = -1;
|
||||
|
||||
// If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc.
|
||||
|
||||
@@ -14,6 +14,8 @@ Phaser.Text = function (game, x, y, text, style) {
|
||||
|
||||
Phaser.Sprite.call(this, game, x, y, canvasID);
|
||||
|
||||
this.type = Phaser.TEXT;
|
||||
|
||||
this.setText(text);
|
||||
this.setStyle(style);
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
|
||||
|
||||
PIXI.TilingSprite.call(this, this.texture, width, height);
|
||||
|
||||
this.type = Phaser.TILESPRITE;
|
||||
|
||||
/**
|
||||
* The scaling of the image that is being tiled
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user