mirror of
https://github.com/wassname/phaser.git
synced 2026-07-28 11:23:50 +08:00
Updated Rectangle to use prototype based getters and setters (re: iOS speed discussion on the forum).
This commit is contained in:
@@ -96,7 +96,7 @@ Phaser.Image.prototype = Object.create(PIXI.Sprite.prototype);
|
||||
Phaser.Image.prototype.constructor = Phaser.Image;
|
||||
|
||||
/**
|
||||
* Automatically called by World.preUpdate. Handles cache updates, lifespan checks, animation updates and physics updates.
|
||||
* Automatically called by World.preUpdate.
|
||||
*
|
||||
* @method Phaser.Image#preUpdate
|
||||
* @memberof Phaser.Image
|
||||
@@ -114,6 +114,8 @@ Phaser.Image.prototype.preUpdate = function() {
|
||||
this.renderable = this.game.world.camera.screenView.intersects(this.getBounds());
|
||||
}
|
||||
|
||||
this.world.setTo(this.game.camera.x + this.worldTransform[2], this.game.camera.y + this.worldTransform[5]);
|
||||
|
||||
return true;
|
||||
|
||||
};
|
||||
@@ -176,19 +178,16 @@ Phaser.Image.prototype.inCamera = function() {
|
||||
*/
|
||||
Phaser.Image.prototype.loadTexture = function (key, frame) {
|
||||
|
||||
console.log('loadTexture');
|
||||
|
||||
this.key = key;
|
||||
|
||||
if (key instanceof Phaser.RenderTexture)
|
||||
{
|
||||
this.game.cache.getTextureFrame(key.name).clone(this.currentFrame);
|
||||
// this.game.cache.getTextureFrame(key.name).clone(this.currentFrame);
|
||||
// WOKWOKSK
|
||||
}
|
||||
else if (key instanceof Phaser.BitmapData)
|
||||
{
|
||||
this.setTexture(key.texture);
|
||||
this.currentFrame = key.textureFrame;
|
||||
}
|
||||
else if (key instanceof PIXI.Texture)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user