oxysoft Posted August 22, 2014 Share Posted August 22, 2014 I have a basic pixel art game that I would like to be scaled up because it is very small right now This works, but breaks the camera considerablygame.world.scale.setTo(3, 3); This works but breaks the TilemapLayer considerably// (Scaling everything manually)sprite.scale.setTo(3, 3);layer.scale.setTo(3, 3);// ...So is there a definite way to scale the game up without having to export every single sprites at magnified sizes? At first, I didn't think it would be this hard of a task Link to comment Share on other sites More sharing options...
Dumtard Posted August 22, 2014 Share Posted August 22, 2014 I usually do it this way.game.scale.width = //pixel valuegame.scale.height = //pixel valuegame.scale.refresh(); Link to comment Share on other sites More sharing options...
oxysoft Posted August 23, 2014 Author Share Posted August 23, 2014 I usually do it this way.game.scale.width = //pixel valuegame.scale.height = //pixel valuegame.scale.refresh(); Is there a way to turn off smoothing with this? Both of these do not work (or may be browser specific?) game.antialias = false; //does not workgame.stage.scale.smoothed = false; //does not work Link to comment Share on other sites More sharing options...
Dumtard Posted August 23, 2014 Share Posted August 23, 2014 I believe it is scaling with CSS, and there is no way to stop it from happening when scaling with CSS. Link to comment Share on other sites More sharing options...
cdrch Posted August 23, 2014 Share Posted August 23, 2014 Look here: http://www.photonstorm.com/phaser/pixel-perfect-scaling-a-phaser-game That's how I did it when I made a game at 160x144 for GBJam3. If you scroll down to the comments, there's a link to a modified version of the basic multi-state game template that has the scaling all set up. The main disadvantage of this method is that you won't be able to use mouse controls without a fair bit of effort, but low-resolution games typically don't have those anyways. Link to comment Share on other sites More sharing options...
Sebi Posted August 23, 2014 Share Posted August 23, 2014 Except that that technique doesn't work. At least not cross browser (well that is what I was told) Link to comment Share on other sites More sharing options...
rich Posted August 23, 2014 Share Posted August 23, 2014 The technique posted on my blog is cross browser it just doesn't handle mouse input. The CSS methods are very unreliable though. Link to comment Share on other sites More sharing options...
Sebi Posted August 23, 2014 Share Posted August 23, 2014 Hm, I'm pretty sure I just saw a website running tests on canvas scaling a few days ago, where they also used the technique described in that post. Maybe that article was outdated then. Thanks for clearing that up. Link to comment Share on other sites More sharing options...
Recommended Posts