cikamika Posted January 30, 2015 Share Posted January 30, 2015 var rectGraphics = new Phaser.Graphics( this.game, 0, 0 );rectGraphics.beginFill( 0xFF0000 );rectGraphics.drawRect( 0, 0, 100, 100 );rectGraphics.endFill();mySprite = this.game.add.sprite( 100, 100 );mySprite.addChild( rectGraphics );mySprite.width and mySprite.height always returns 32, but the graphics dimensions are 100x100?mySprite.getBounds() and mySprite.getLocalBounds() are also set to 32x32. How do you get Phaser to return proper dimensions? Link to comment Share on other sites More sharing options...
grinmonk Posted July 13, 2016 Share Posted July 13, 2016 I have the same problem on 2.5.0. Adding graphics to a sprite does not affect sprite's dimensions. I have found this issue: https://github.com/photonstorm/phaser/issues/1632 Ok, if this does not happen automatically, is there a way to update sprite's bounds without scaling? Link to comment Share on other sites More sharing options...
Recommended Posts