Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Rendering and Centering of Text


BeNjO
 Share

Recommended Posts

Hey guys,

I have always struggled with the positioning of Text with dx8, I normally go through a long haul of print screening and testing both sides of the text to see if they're the same length. I have tried a lot of stuff in the past and thought I'd try again. These are what i have tried, with GUI_REWARDS been .Width = 350

 RenderText Font_GeorgiaShadow, WordWrap("This is a test", GUIWindow(GUI_REWARDS).width / 2), (GUIWindow(GUI_REWARDS).width / 2 - Len("This is a test")), GUIWindow(GUI_REWARDS).height / 2, White

the above was just a quick throw together and the results were basically the same as the below:

 RenderText Font_GeorgiaShadow, Trim$("Rewsdfsdfsdfards"), 1 + EngineGetTextWidth(Font_Georgia, Trim$("Rewsdfsdfsdfards")))), GUIWindow(GUI_REWARDS).height / 2, White

Those are my latest attempts, I hate anything graphical but I manage to figure stuff out on my own. I admit defeat with this. I generally try for an hour or so, then turn back to my paint job to just get it over with but being able to do a simple equation would save me about 1-2 hours a month of hundreds of screen shots.

TLDR:

How the jobs do you center Text off using a mathematical equation? I am wanting it to be per gui_ not per game screen as some windows are not always centered off.

15

15
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...