ScrollZone back in under the new renderer with new demos

This commit is contained in:
Richard Davey
2013-05-30 05:34:35 +01:00
parent f2054f8a2a
commit ce1523585f
28 changed files with 1582 additions and 349 deletions
+4 -6
View File
@@ -29,7 +29,6 @@ module Phaser.Physics {
this.scale = new Vec2(1, 1);
}
//this.bounds = new Rectangle(x + Math.round(width / 2), y + Math.round(height / 2), width, height);
this.bounds = new Rectangle(x + Math.round(width / 2), y + Math.round(height / 2), width, height);
this.position = new Vec2(x + this.bounds.halfWidth, y + this.bounds.halfHeight);
this.oldPosition = new Vec2(x + this.bounds.halfWidth, y + this.bounds.halfHeight);
@@ -57,16 +56,11 @@ module Phaser.Physics {
if (this.sprite)
{
// Update position to sprite value
//console.log('a', this.position.x, this.position.y);
this.position.setTo((this.sprite.x + this.bounds.halfWidth) + this.offset.x, (this.sprite.y + this.bounds.halfHeight) + this.offset.y);
//console.log('b', this.position.x, this.position.y);
//this.position.setTo(this.sprite.x, this.sprite.y);
// Update scale / dimensions
if (Vec2Utils.equals(this.scale, this.sprite.scale) == false)
{
console.log('scaled');
this.scale.copyFrom(this.sprite.scale);
this.bounds.width = this.sprite.width;
this.bounds.height = this.sprite.height;
@@ -76,6 +70,10 @@ module Phaser.Physics {
}
public update() {
this.bounds.x = this.position.x;
this.bounds.y = this.position.y;
}
public setSize(width: number, height: number) {