Sign in to follow this  

Phaser Tilemaps - How To Control # of Tiles in Viewport?

Recommended Posts

Hi, I'm trying to build a top-down 2d game. You can find the code for it here:

Here is a screenshot of the game using "this.scale.scaleMode = Phaser.ScaleManager.NO_SCALE ;"

The game works, but there are a few issues I'm having:

1) The "viewport" always shows an area of 10 x 10 tiles. As the player moves the camera follows him and he appears to be moving around the map. However, the viewport is always 10 x x10. Is there a way to change this, for example, to where the viewport always showed an area of 20x20 tiles?

2) When I use "NO_SCALE" mode everything looks super tiny, but when I use any scale mode (such as SHOW_ALL) the text looks blurry and is completely unreadable... How can I have graphics that are large enough to see while still keeping nice, crisp fonts?





Share this post

Link to post
Share on other sites

I'm still pretty new to this myself so maybe I'm missing something, but I'm expecting your game.js file to start with something like :

var game = new Phaser.Game(720, 405, Phaser.AUTO, '');

Where 720 and 405 are the width and height in pixels. That's how I've always set the game size.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.