[ACS] HUDMessage in box size/limit?
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] HUDMessage in box size/limit?
Hey, its me again with another (hopefully) simple question. How do you limit a hudmessage to fit a certain size/box? Something like wolfendoom's hud? (I actually went to check wolfendoom and i still have no frigging clue how they made that work)
Basically my issue is that when a hude message display it takes the entire screen and only starts a new line once too many text has taken off the screen, what i would want is the text to start new lines/sentences to fit inside a dialogue box that appears when you do something or when a character talks to you for instance.
Basically my issue is that when a hude message display it takes the entire screen and only starts a new line once too many text has taken off the screen, what i would want is the text to start new lines/sentences to fit inside a dialogue box that appears when you do something or when a character talks to you for instance.
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
[ACS] Re: HUDMessage in box size/limit?
The way I know is https://zdoom.org/wiki/SetHudClipRect
Not sure if it works in Zandronum 2.x.
Not sure if it works in Zandronum 2.x.
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: HUDMessage in box size/limit?
I'm working with 3.0 actually. But it doesn't seem to do jack shit. Unless im doing something wrong?ZZYZX wrote:The way I know is https://zdoom.org/wiki/SetHudClipRect
Not sure if it works in Zandronum 2.x.
Here's my code:
SetHudClipRect(5, 5, 5, 5, 5);
HudMessage (s:"The Water in the gap... It's going up! Perhaps if we find more switches like this, we could swim across the gap!";HUDMSG_TYPEON, 5, CR_GOLD, 0.5,0.5, 1.0, 0.05, 0.2);
SetHudClipRect(0, 0, 0, 0, 0);
Delay(1);
[ACS] Re: HUDMessage in box size/limit?
For SetHudClipRect, the position, width and height of the box are relative to whatever width or height is specified using SetHudSize. I think that if the screen size isn't changed using this function, it will use the client's resolution instead, which might be the case in the example you provided.
For your code, I would suggest setting the size of the HUD then adjust the box so that it covers the parts of the message meant to be hidden.
For your code, I would suggest setting the size of the HUD then adjust the box so that it covers the parts of the message meant to be hidden.
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: HUDMessage in box size/limit?
Uh... you gonna have to help me with maybe an exemple cause i kinda have trouble following you. I'm kinda bad with ACS tbh...Dr.Robotnik wrote:For SetHudClipRect, the position, width and height of the box are relative to whatever width or height is specified using SetHudSize. I think that if the screen size isn't changed using this function, it will use the client's resolution instead, which might be the case in the example you provided.
For your code, I would suggest setting the size of the HUD then adjust the box so that it covers the parts of the message meant to be hidden.
[ACS] Re: HUDMessage in box size/limit?
Try this example:
You might want to play around with the parameters of SetHudClipRect to see where the messages will not be drawn, but it also depends on whatever the size of the HUD is.
Code: Select all
#include "zcommon.acs"
SCRIPT 1 ENTER
{
//Set the size of the HUD.
SetHudSize(640, 480, TRUE);
//Adjust the position and size of the clipping rectangle based on the width/height of the HUD.
SetHudClipRect(160, 120, 320, 240, 0);
//Draw first message, clipped.
HudMessage(s:"Here's a message; some of it will be unseen if outside the clipping rectangle."; HUDMSG_PLAIN, 0, CR_RED, 320.0, 240.0, 0.0);
//Remove the clipping rectangle so future HUD messages aren't affected.
SetHudClipRect(0, 0, 0, 0, 0);
//Draw second message, unclipped.
HudMessage(s:"Here's another message; this one should be entirely visible."; HUDMSG_PLAIN, 0, CR_WHITE, 320.0, 280.0, 0.0);
}
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: HUDMessage in box size/limit?
I'm gonna be a bit busy to do further ACS stuff this week but ill update if i get around something whenever i get around it...