Hellow everyone, all is said in the title how can I make hudmessage to be aligned depending on player screen/aspect ratio.
I used the normal way by editing each line's x position but here if I changed the resolution it will end up in a big fail.
Thanks for the help.
[ACS] [SOLVED] Aligned HudMessage
- fr blood
- Frequent Poster Miles card holder
- Posts: 992
- Joined: Wed Mar 06, 2013 4:04 pm
- Location: France
[ACS] [SOLVED] Aligned HudMessage
Last edited by fr blood on Tue Jan 31, 2017 4:13 pm, edited 1 time in total.
-
- Retired Staff / Community Team Member
- Posts: 2559
- Joined: Sat Jun 02, 2012 2:44 am
Re: [ACS] Aligned HudMessage
For death race I used a strange workaround where the message you were trying to print was followed by "\n\n\n\n\n\n\n\n\n\n\n\n..... @@@@@@@@@@@@@@@@@@@@@@@@" so that I could manually align them as the spam of @ symbols would make the x position of each message the same, as long as there were more @ characters than the message you were trying to print.
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: [ACS] Aligned HudMessage
What if you do SetHudSize first? That sounds exactly like what you need here.
https://zdoom.org/wiki/SetHudSize
https://zdoom.org/wiki/SetHudSize
- fr blood
- Frequent Poster Miles card holder
- Posts: 992
- Joined: Wed Mar 06, 2013 4:04 pm
- Location: France
Re: [ACS] Aligned HudMessage
I tried it SwordGrunt, but in the end the compilation didn't worked for "Coordinate Behavior" options.
Anyway I found a solution, here is an example if you guys are looking for the same thing.
Thank for the help.
Anyway I found a solution, here is an example if you guys are looking for the same thing.
Code: Select all
HudMessage(s:"Utility Menu\n\n",
s:SpecialColor(1),s:"Pickups\n\n",
s:SpecialColor(2),s:"Sentry\n\n",
s:SpecialColor(3),s:"Weapons\n\n",
s:SpecialColor(4),s:"Suits\n\n",
s:SpecialColor(5),s:"Support\n\n",
s:SpecialColor(6),s:"Destroy";
HUDMSG_PLAIN,8430+PlayerNumber(),CR_WHITE,0.4,0.28,0.2);
function str SpecialColor(int typ)
{
if(typ == 1)
{//Pickups
if(CheckInventory("UtilitySlot1") == 0)return "\cd";//green
else return "\cq";//dark green
}
else if(typ == 2)
{//Sentry
if(CheckInventory("UtilitySlot1") == 1)return "\cd";//green
else return "\cq";//dark green
}
else if(typ == 3)
{//Weapons
if(CheckInventory("UtilitySlot1") == 2)return "\cd";//green
else return "\cq";//dark green
}
else if(typ == 4)
{//Suits
if(CheckInventory("UtilitySlot1") == 3)return "\cd";//green
else return "\cq";//dark green
}
else if(typ == 5)
{//Support
if(CheckInventory("UtilitySlot1") == 4)return "\cd";//green
else return "\cq";//dark green
}
else if(typ == 6)
{//Destroy
if(CheckInventory("UtilitySlot1") == 5)return "\cg";//red
else return "\cr";//dark red
}
return "\cc";//white
}