• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

iOS display_get_width() not working properly

S

Siracher

Guest
Hi

I just mentioned a strange behaviour in my game on an iphone 6s.

using the code below create a sprite from the applicaton_surface and draw it back on the screen (pause function) it works fine testing it locally, on android and on the iPad.

But on an iphone (tested on iphone 6s) it doesnt' seem to use the full width of the device. Does anybody know why it takes only a part of the screen on iphone and not the full width? (see dark area in screenshot below)

Code:
sprite_create_from_surface(application_surface, 0, 0, display_get_width(), display_get_height(), 0, 0, 0, 0);
 
S

Siracher

Guest
ah shoot I just mentioned that the problem is found in the views. I set them to 1920x1080.. I am using now just the var room_width and room_height.

but I just mentioned that draw_set_halign(fa_center) is not working right on a iphone 6s, it works on iphone x for example.
 
H

HW.

Guest
Perhaps you might want to test by replacing your display_get_width() with display_get_gui_width()

And replace the display_get_height() with display_get_gui_height()

I wonder if that screenshot will be different after that?
 
S

Siracher

Guest
Hi

yes it seem to work fine using display_get_gui_height() or room_height works as well. Thanks for the tip!

Does anybody know why text centering with fa_center doesn't work on iphone 6 / iphone 8?
It seems just to ignore it and use left aligned text instead.
 
Top