• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

iOS How to get game rooms ready for IOS?

Torbea

Member
Hi, all!
I'm trying to get my game ready for IOS and trying to figure out what room size I need for it without distorting the sprites/objects.

So far I have made ~11 rooms pretty much ready to go at 1024x768 pixels.

I think I want to go to 1920x1080 for modern iPhones, however when I change the room size to that the sprites get a bit distorted and it looks weird.
There is also a black space on either side.

Attached are the images of the first level/room and as you can see in the top one (1920x1080), the sprites are slightly distorted and there are the blank spaces (which I might use for the controls and score etc).
The second image is what all my rooms are at and they look fine.

Is there an easy way to do this or do I have to change all the sprites/restart the rooms from scratch?

Also, is there a specific aspect ratio or an amount of pixels I need to use?

Thanks for your time! :)

Screen Shot 2021-10-15 at 12.10.41 PM.pngScreen Shot 2021-10-15 at 12.09.40 PM.png
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
On iOS, the simplest way to do things is to have your game (in landscape mode) calculate the aspect ratio of the screen (width / height) then use that to set the size of the CAMERA in the room. If the room has no camera (which it looks like it doesn't as it's a single room game), then you should probably enable one. So, the process would be as follows:

1) In each room in the room editor, enable VIEWPORTS and CAMERAs (set them to the same size of the room to start with).
2) In the CREATE event of an object at the very start of the game set the WINDOW size to the screen size (window_set_size + display_get_width()/height()).
3) Calculate the aspect ratio of the screen (display width / display height)
4) In each room do the following:
- Set the view camera height to the room height and the view camera width to the room_height * aspect ratio
- Set the view port to the size of the display
- Set the application surface to the size of the display

The basics of this is all outlined in more detail in these tech blogs:
 

Torbea

Member
On iOS, the simplest way to do things is to have your game (in landscape mode) calculate the aspect ratio of the screen (width / height) then use that to set the size of the CAMERA in the room. If the room has no camera (which it looks like it doesn't as it's a single room game), then you should probably enable one. So, the process would be as follows:

1) In each room in the room editor, enable VIEWPORTS and CAMERAs (set them to the same size of the room to start with).
2) In the CREATE event of an object at the very start of the game set the WINDOW size to the screen size (window_set_size + display_get_width()/height()).
3) Calculate the aspect ratio of the screen (display width / display height)
4) In each room do the following:
- Set the view camera height to the room height and the view camera width to the room_height * aspect ratio
- Set the view port to the size of the display
- Set the application surface to the size of the display

The basics of this is all outlined in more detail in these tech blogs:
So I gave it a try and read the articles you linked.
I should also note that I am making my objects and such without GML doing it the easy way.
I do have a small amount of coding experience and am able to learn some more.

First off, I enabled viewports and cameras and set them to the same size of the room.
Screen Shot 2021-10-16 at 12.59.04 PM.png
I am not sure what you mean by step 2. Are you meaning create an object with no sprite and put it in my first level with the said code?
I have calculated the aspect ratio I want to use which is 16:9 (1920/1080)
The camera height was already at the screen height.
And I cannot figure outlaw to calculate the room height * aspect ration, is this meaning 768*1920/1080?
And do I need to code the application surface in the rooms creation or the object with no sprite that I put in the first level?

This is what my game is running like now after what I have changed so far.
Screen Shot 2021-10-16 at 1.07.37 PM.png

Sorry that I am slow to understanding this.
I really appreciate the help.
Thanks!
 

Torbea

Member
Hi,

So I think I'm getting close, however when I try run my game with this code in the object create event I get this.
Is this similar to what I am supposed to be doing?
Screen Shot 2021-10-18 at 12.38.30 PM.png
Please help, I'm very stuck haha.
 
Top