yltang Posted September 30, 2015 Share Posted September 30, 2015 Can somebody be so kind to explain what the following statement means? If it is false, what will happen?game.renderer.renderSession.roundPixels = true;I have searched Phaser's documents and googled around, and couldn't find any explanation. Thanks. azzz 1 Link to comment Share on other sites More sharing options...
rich Posted September 30, 2015 Share Posted September 30, 2015 It will ensure that when sprites are rendered they are done so using integer positions. Without this sprites can often render at sub-pixel positions, causing them to 'blur' as Canvas tries to anti-alias them between the two pixels. MichaelD, WombatTurkey, Karthika G and 5 others 8 Link to comment Share on other sites More sharing options...
yltang Posted October 1, 2015 Author Share Posted October 1, 2015 Got it, thanks. Link to comment Share on other sites More sharing options...
Skeptron Posted October 1, 2015 Share Posted October 1, 2015 Does that affect the sprite's coordinates? Or is it just the rendering? Link to comment Share on other sites More sharing options...
rich Posted October 1, 2015 Share Posted October 1, 2015 JUST rendering. Skeptron and in mono 2 Link to comment Share on other sites More sharing options...
kleepklep Posted October 7, 2015 Share Posted October 7, 2015 I'm using roundPixels = true to keep my center aligned text crisp since it often landed at fractional pixels and blurred, making it look different than the left aligned text on the same screen. Rich, are there any performance costs associated with this setting? Link to comment Share on other sites More sharing options...
rich Posted October 7, 2015 Share Posted October 7, 2015 No it just rounds the coordinates before rendering. I guess there is a little cost in doing that, but I bet it's not even measurable. michaelcalkins and kleepklep 2 Link to comment Share on other sites More sharing options...
yltang Posted October 24, 2015 Author Share Posted October 24, 2015 I tried to set it to true or false, but didn't notice any difference. It seems to have no effect at all. Is that because the browser will do the anti-aliasing no matter what? Link to comment Share on other sites More sharing options...
lukaMis Posted March 3, 2016 Share Posted March 3, 2016 this.game.renderer.renderSession.roundPixels = true; Can that be set in like Boot state or it needs to be in main game state? Link to comment Share on other sites More sharing options...
WombatTurkey Posted March 24, 2016 Share Posted March 24, 2016 On 3/2/2016 at 11:28 AM, lukaMis said: this.game.renderer.renderSession.roundPixels = true; Can that be set in like Boot state or it needs to be in main game state? Create state works for me, wouldn't put it in the main game state (if that's what you mean as a boot state) Link to comment Share on other sites More sharing options...
Recommended Posts