Cless Posted April 1, 2014 Share Posted April 1, 2014 Hi. It appears that camera coordinate values are automatically floored. Thus, if I type: game.camera.x = 20.5; Then it will be changed to 20. Is there a way to prevent this behavior? If one uses tweening to move a followed sprite, then the camera transition looks very jittery. This is because the sprite may have a coordinate with a fraction, but the camera drops the fraction. Looking at the code, it appears this flooring occurs on line 302 of Phaser.Camera in checkBounds: this.view.floor(); Link to comment Share on other sites More sharing options...
rich Posted April 1, 2014 Share Posted April 1, 2014 Without the flooring you get extreme "jittering / shaking" when at the edges of a game world. I guess I could make it optional, but that is why it's in there Link to comment Share on other sites More sharing options...
Cless Posted April 1, 2014 Author Share Posted April 1, 2014 I see! My game is just a top-down, tile-based RPG, and that issue doesn't seem to occur for me if I remove the call to floor. If you could make it optional, that would be great. Link to comment Share on other sites More sharing options...
Cless Posted April 1, 2014 Author Share Posted April 1, 2014 My apologies, the problem actually appears to be caused by the call to floor *and* the behavior of focusOnXY: focusOnXY: function (x, y) { this.setPosition(Math.round(x - this.view.halfWidth), Math.round(y - this.view.halfHeight)); } (Removing the calls to Math.round and the call to floor fixes the issue.) Link to comment Share on other sites More sharing options...
Recommended Posts