SetDisplayWindow(x, y, width, height, wrap)
HUDMSG_FORCENOWRAP
which creates a drawing area at x, y coordinates and with width and height size. wrap specifies if the content inside display area should be wrapped.
Function should be used in conjunction with SetHudSize, otherwise it won't have any effect.
So when the drawing area is created, every HudMessage and HudMessageBold call will show it's output only within this area.
To reset drawing, just call SetDisplayWindow(0, 0, 0, 0, 0)
HUDMSG_FORCENOWRAP forces message not to wrap on the next line.
Example:
Code:
Code: Select all
#include "zcommon.acs"
Script 1 Enter
{
SetHudSize(640,480,1);
// first try, without display window
HudMessage(s:"plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text"; HUDMSG_PLAIN, 0, CR_RED, 0.1, 10.1, 10.0);
// second try, with display window and without word wrap of display window
SetDisplayWindow(0, 0, 200, 350, 0);
HudMessage(s:"plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text"; HUDMSG_PLAIN, 0, CR_ORANGE, 0.1, 40.1, 10.0);
// third try, with display window, without word wrap of display window and with disabled word wrap of HUD screen
HudMessage(s:"force_no_wrap_force_no_wrap_force_no_wrap_force_no_wrap_force_no_wrap"; HUDMSG_PLAIN + HUDMSG_FORCENOWRAP, 0, CR_GOLD, 0.1, 70.1, 10.0);
// fourth try, with display window and now use display window's word wrap feature
SetDisplayWindow(0, 0, 200, 350, 1);
HudMessage(s:"wrap_in_window_wrap_in_window_wrap_in_window_wrap_in_window_wrap_in_window_wrap_in_window_wrap_in_window"; HUDMSG_PLAIN, 0, CR_GREEN, 0.1, 100.1, 10.0);
// fifth try, same but with disabled word wrap of HUD screen
HudMessage(s:"wrap_in_window_force_no_wrap"; HUDMSG_PLAIN + HUDMSG_FORCENOWRAP, 0, CR_BLUE, 0.1, 200.1, 10.0);
// reset drawing
SetDisplayWindow(0, 0, 0, 0, 0);
HudMessage(s:"plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text_plain_text"; HUDMSG_PLAIN, 0, CR_BRICK, 0.1, 250.1, 10.0);
}

Patches in attachment are for ZDoom r3879