Mac OSX The location of my text keeps changing

N

Nyarlathotep

Guest
In between areas I like to have a black screen with some simple text to help transition the player from one area to another. The issue that's cropped up though is that every time I play through the game and get to the second black screen the text has moved off the screen, but this strangely doesn't happen If I load into the game after the first black screen I am utterly confused why this keeps happening. The object that controls where the text is placed is called settingText and I have been messing around with it to see how it might keep causing the text to change each level. My screen/level size is 960 by 540. Any Ideas?Screen Shot 2019-08-24 at 2.52.36 PM.png Screen Shot 2019-08-24 at 2.52.56 PM.png Screen Shot 2019-08-24 at 2.53.01 PM.png Screen Shot 2019-08-24 at 2.46.09 PM.png Screen Shot 2019-08-24 at 2.51.50 PM.png
 

rIKmAN

Member
If you are using the DrawGUI Event you don't need to add any offsets for the camera / view position.

Just set the text alignment to the middle/centre and draw the text in the middle of the screen, then regardless of string length it will always be centred (but might still run off the screen if the font is too big or string is too long to fit).
 
N

Nyarlathotep

Guest
how do I set the text alignment to the middle/centre?
 

rIKmAN

Member
how do I set the text alignment to the middle/centre?
draw_set_halign() and draw_set_valign().

As Theou said above the settings persist so make sure you set them back for other text elsewhere otherwise all text will be using centre alignment which is probably not what you want.

Check out those functions in the manual for the different arguments that can be used and how that affects the text position when drawn.
 

TheouAegis

Member
But odds are it is the GUI issue Rikman first pointed out, since you didn't even know how to set alignment. lol
 
Top