Jump to content

Scaling and positioning - How to do it?


plicatibu
 Share

Recommended Posts

Hi. I'm note sure whether I should post this question here or at the Coding and Game Logic forum.

 

When I developed my first game for Android, I did it with AndEngine framework.

 

In AndEngine one specifies the game dimensions (width and height) and the screen orientation (landscape / portrait) and ratio resolution policy. This way, it doesn't matter the screen resolution in which the game is running, the assets are automatically handled by the framework that put them in the right position.

 

 

Does Phaser do this too?

 

In negative case, how do I resize the assets and take in consideration the new dimensions from assets so that they will be in the same position (relative to other assets)?

 

Thank you.

Link to comment
Share on other sites

If I understand rich

 

 

 

Your game has a fixed size (specified in the game constructor) and everything is based off that. Then we scale the canvas to fill the browser, but essentially the game is still the size you requested at the start

 

the thing is that when you start a mobile phaser mobile game, the game resolution is the one you specified in the game constructor, but the game is scaled to fill the final web browser?

 

In this case, it means that if your game resolution is for example 480x640 and  the mobile resolution is much bigger (1024×768,  2048×1536,...), the game graphics will be blurred by the scaling? my previous game developing experience is developing in Unity3D, and using the free UItoolkit plugin for UI representation. With UIToolkit plugin, you can define different spritesheets for sd/hd resolution, and the game start detects screen resolution and uses the best option, based on parameters that you can define to mark the boundary between sd and hd. In this case you can always use % for defining sprite position.

 

Before reading this post  I was thinking if I could create a similar solution to minimize the scale of the images and thus improve the visualization of them...

 

what do you think? how do you code a mobile game that you can see in almost all screen resolutions?  

 

I found a web that explains "How to create mobile games for different screen sizes and resolutions"

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...