How to center objects on screen for hud, ect.

This small, simple tutorial will show you how to center align objects that constantly stay at that 1 set point. If you want text at the Top Center of the screen, then you would do this. Screen size: (Your size). We will use 640 X 480.
Using the " / 4 " method, it devides the screns X by 4, thus making the center. if you want it at the top left constantly, then you would use 2 instead of 4.
The same thing with yscreen, if youw ant it in the center middle, xscreen = 640 / 4;, and yscreen = 480 / 4;.
Use this on Draw Actor.
- Code: Select all
xscreen = 640 / 4;
yscreen = 0;
Using the " / 4 " method, it devides the screns X by 4, thus making the center. if you want it at the top left constantly, then you would use 2 instead of 4.
The same thing with yscreen, if youw ant it in the center middle, xscreen = 640 / 4;, and yscreen = 480 / 4;.
Use this on Draw Actor.