Rodrigo Silveira Posted August 20, 2015 Share Posted August 20, 2015 I'm coming to game development from a strong web development background. Not sure this is even a problem in game dev... I'm trying to layout a scene like this screenshot, and I'm not sure how one would normally go about doing this: Red outlines are images, and green boxes can be done with text. My questions If I just position everything absolutely, will those offsets change when I scale up/down my game (go full-screen, etc.)?If I want to move that gun icon, as in the example above, do I just hardcode the two possible positions?What are some of the best practices for laying out this sort of UI in Phaser? Link to comment Share on other sites More sharing options...
tips4design Posted August 22, 2015 Share Posted August 22, 2015 Don't position absolutely. It's easy to position relatively to screen size. Eg: set Konami logo x position to game.width / 2. If you have multiple sprites that you want to be aligned (on the same line) you can add them to a group and center the group to make things easier. It's not that hard to position sprites based on game size, anchor position and/or sprite size. drhayes 1 Link to comment Share on other sites More sharing options...
Recommended Posts