nuvorm Posted September 13, 2014 Share Posted September 13, 2014 Hello, It looks like the spriteBatch group is not updating the body of a sprite correctly.Is this expected behaviour? this.game.physics.startSystem(Phaser.Physics.ARCADE); this.gr=this.game.add.spriteBatch(); this.gr.enableBody = true; this.gr.physicsBodyType = Phaser.Physics.ARCADE; this.s=new Phaser.Sprite(this.game,0,0,'atlas','player_01.png') this.gr.add(this.s) this.s.fixedToCamera=true and in the state update: this.s.cameraOffset.x+=1; this.game.debug.body(this.s); the body is stuck at 0,0 phaser 2.1.0 regards, Wouter Link to comment Share on other sites More sharing options...
valueerror Posted September 14, 2014 Share Posted September 14, 2014 sorry, i don't know the answer to your problem but i have an additional question: why are you using spritebatch ? (trying to understand the need for it)the documentation says it's used throughout the renderer anyways ... so why is there a need for it in the game code. Link to comment Share on other sites More sharing options...
nuvorm Posted September 14, 2014 Author Share Posted September 14, 2014 If i understand correct:When a sprite is put on the screen the gpu makes a drawcall.If you have one texture used by many sprites you can reduce the drawcalls made by the gpu using a spritebatch. I am not sure if a sprite in a spritebatch is allowed to have a body but i guess i can. When using a 'normal' group the body of a sprite is updated, not with a spritebatch (on my side anyway)Maybe i am doing something wrong. Link to comment Share on other sites More sharing options...
tomph Posted October 31, 2014 Share Posted October 31, 2014 I have the same issue. Any idea guys? Link to comment Share on other sites More sharing options...
CrazySam Posted December 12, 2014 Share Posted December 12, 2014 I just ran into this issue as well. Can anyone explain what's going on? Link to comment Share on other sites More sharing options...
Recommended Posts