Page 1 of 1
[ACS] [SOLVED] Aligned HudMessage
Posted: Mon Jan 30, 2017 7:48 pm
by fr blood
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.
Re: [ACS] Aligned HudMessage
Posted: Tue Jan 31, 2017 2:49 am
by Catastrophe
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.
Re: [ACS] Aligned HudMessage
Posted: Tue Jan 31, 2017 2:56 am
by SwordGrunt
What if you do SetHudSize first? That sounds exactly like what you need here.
https://zdoom.org/wiki/SetHudSize
Re: [ACS] Aligned HudMessage
Posted: Tue Jan 31, 2017 4:13 pm
by fr blood
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.
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
}
Thank for the help.