Hello friends,
I have a question regarding the clusterdef texts that can be added through this feature: https://zdoom.org/wiki/MAPINFO/Cluster_definition
Is there a way to make the text aligned centered and not left aligned? I didn't find anything in the wiki so I thought I'd ask.
Best regards,
Torm
Centered text in "clusterdef text"
Moderators: GZDoom Developers, Raze Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
-
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
-
- Posts: 414
- Joined: Sun Apr 14, 2019 8:26 am
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
Re: Centered text in "clusterdef text"
As far as I know, there is no simple way to make the text centered. You could always insert a bunch of spaces at the beginnings of lines, but that's sort of hacky and would inevitably look weird.
-
-
- Posts: 4166
- Joined: Thu Jul 17, 2003 12:19 am
- Graphics Processor: nVidia (Legacy GZDoom)
- Location: British Columbia, Canada
Re: Centered text in "clusterdef text"
Instead of specifying the text in the custerdef section you could make
a script which displays the text at the appropriate time with HudMessage.
See x and y.
a script which displays the text at the appropriate time with HudMessage.
See x and y.
-
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Re: Centered text in "clusterdef text"
Yeah, I also thought that this might be the only solution. One question though: If I use SetHudeSize, how can I align each line centered then?Kappes Buur wrote:Instead of specifying the text in the custerdef section you could make
a script which displays the text at the appropriate time with HudMessage.
See x and y.
-
- Posts: 2274
- Joined: Tue Jun 30, 2009 1:31 pm
Re: Centered text in "clusterdef text"
[wiki]SetHudSize[/wiki], see the Coordinate Behaviour section. If you want your text to align center, you need to add a .4 to the Text's xpos argument, like so:
Code: Select all
SetHudSize(640,480,0);
HudMessage(s:"Hello World!"; HUDMSG_PLAIN, 1, CR_RED, 320.4, 240.0, 5.0);
-
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Re: Centered text in "clusterdef text"
Thanks kindly, that worked