Hello,
Is there a way to centralize (horiz./vert.) A text (string) when the screen is full screen.
Thank you
Hello,
Is there a way to centralize (horiz./vert.) A text (string) when the screen is full screen.
Thank you
I did this today, but I don't know if my method is optimal. The text I needed to have in the exact center of the screen was for upgrades, where the same text string will be used to describe how upgrades in my game works whenever the player picks them up.
How I did it:
• Player touches upgrade
Create new object: Create "HUD String Upgrade Description" at (0,0) Layer 12.
HUD String Upgrade Description: Set X Position to X Left Frame.
HUD String Upgrade Description: Set Y Position to Y Top Frame + 80.
Notes:
My "Hud String Upgrade Desciption" has a width of 426 which is exactly as wide as my game window. Also, the Horizonal Alignment of the string is set to Center under the string.
The reason behind this is that it seems like a strings "hot spot" (real X Position) is in the strings upper left corner, and it's not being changed by changing the Alignment under properties.
If you want to center it vertically, you can just set the Y position to the game windows height divided by 2.
You could also make the strings height as high as the game windows height and then alter the Vertical Alignment to Center under properties.
Come to think of it, the easiest way to do it would probably be to just check both the Horizontal and Vertical Alignment to Center and put the X/Y Position of the string to 0,0. Oh, and make both its width and height the same as the game windows width and height.