RestingCoder Posted September 19, 2013 Share Posted September 19, 2013 I may have missed this somewhere else, but was unable to find it. Sorry if that is the case. I would like to be able to scale sprites with nearest neighbor filtering so they do not become blurry. I have modified phaser.js to do this myself since the beginning, but with the frequent updates, I wanted to see if there was a way already built in. Thanks. Link to comment Share on other sites More sharing options...
benny! Posted September 19, 2013 Share Posted September 19, 2013 Is Phaser.Canvas.setSmoothingEnabled(ctx,true|false) what you are looking for? Link to comment Share on other sites More sharing options...
rich Posted September 19, 2013 Share Posted September 19, 2013 With canvas it's an "all on" or "all off" situation, you can't scale just some sprites with NN filtering and not others. If you wish to turn it on then just set the antiAlias parameter to "true" when you create your game instance (it's the very last parameter given to Phaser.Game). If you wish to enable it after the game has started for some reason then do:Phaser.Canvas.setSmoothingEnabled(game.context, false)Note: This doesn't work in WebGL! Canvas only. Also doesn't work correctly in all mobile browsers (but then what does?) Link to comment Share on other sites More sharing options...
RestingCoder Posted September 19, 2013 Author Share Posted September 19, 2013 Alright, cool. That will do for now. I will continue to manually change it for WebGL. Thanks for the quick replies, guys. Link to comment Share on other sites More sharing options...
Antylum Posted September 19, 2013 Share Posted September 19, 2013 http://phoboslab.org/log/2012/09/drawing-pixels-is-hard I think you have searched this topic: http://www.html5gamedevs.com/topic/1342-nearest-neighbour-resizing-for-pixelart/ P.S. Native english speakers, is it correct in previous sentence to say 'searched', or 'searched for' is better? Mike 1 Link to comment Share on other sites More sharing options...
Travis Posted September 19, 2013 Share Posted September 19, 2013 P.S. Native english speakers, is it correct in previous sentence to say 'searched', or 'searched for' is better? You generally use "searched for" when you are referring to what you are searching for. As in "you have searched for this topic." You would use "searched" by itself if you are referencing where the searching is happening. As in "you have searched the forum." Tilde 1 Link to comment Share on other sites More sharing options...
Antylum Posted September 20, 2013 Share Posted September 20, 2013 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts