mariogarranz Posted September 28, 2013 Share Posted September 28, 2013 Hi everyone! I have been trying Phaser for a couple of days now, and I must say I really love how easy and fast it is to develop HTML5 games with it. I'm having some trouble due to the lack of documentation, but I guess it's just normal being such a new framework. I have been trying a few things, but can't see any code in the examples to solve my question, nor found any answer searching Google, so I hope any of you can help me with this. I have a tiled map file, and I want to render the map upscaling it by 5x its original tile size. I haven't found any way to do this (it may be even impossible). The other question I have is, is there any way to force "pixel perfect" scaling? I mean, if my game is pixel art, when I scale some sprites (in round numbers like 2) I want them to still have the same look as the original, no anti-aliasing at all. Thank you in advance for your help, and thanks a lot to the Phaser dev, I really love it Link to comment Share on other sites More sharing options...
hackenstein Posted September 28, 2013 Share Posted September 28, 2013 I'm still exploring phaser myself, but as far as I've found out, both can be done pretty straight forward.This should rescale your map to twice it's original size:yourMap.scale = {x:2, y:2};For "pixel perfect scaling" try to disable smoothing: Phaser.Canvas.setSmoothingEnabled(this.game.context, false); Link to comment Share on other sites More sharing options...
eugenioclrc Posted April 13, 2014 Share Posted April 13, 2014 Hi hackenstein! i have sucesfully scale the map. But it seems that dosnt scale the collisions. layer=map.createLayer('wall'); map.setCollisionByExclusion([],true,layer); layer.scale = {x:4, y:4}; layer.resizeWorld(); layer.debug = true;The layer collisions are well draw, but the "player" cant move to them, it seems that they arent scaled. Link to comment Share on other sites More sharing options...
valueerror Posted April 13, 2014 Share Posted April 13, 2014 so scale the world before you set up collisions.. at least when using p2 this is very important even for sprites.. first scaling, then enabling physics body.. Link to comment Share on other sites More sharing options...
eugenioclrc Posted April 13, 2014 Share Posted April 13, 2014 I have tried with the Arcade system but didnt work Link to comment Share on other sites More sharing options...
eugenioclrc Posted April 14, 2014 Share Posted April 14, 2014 Also try the ninja physics and didnt work Link to comment Share on other sites More sharing options...
Recommended Posts