[ACS] HudMessage width and height parameter

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [ACS] HudMessage width and height parameter

Re: [ACS] HudMessage width and height parameter

by Nash » Sat Jun 29, 2013 6:07 am

BTW this can be closed as [Added]...

Re: [ACS] HudMessage width and height parameter

by wildweasel » Fri Jun 28, 2013 9:28 pm

Brendon77 wrote:
Nash wrote:How about using graphics with alpha to do the masking instead? Then you can make the "cutoff" any shape and size.
I have no idea, you can share any example.
What example? Why did you bump this thread from nearly one year ago?

Re: [ACS] HudMessage width and height parameter

by Brendon77 » Fri Jun 28, 2013 9:27 pm

Nash wrote:How about using graphics with alpha to do the masking instead? Then you can make the "cutoff" any shape and size.
I have no idea, you can share any example.

Re: [ACS] HudMessage width and height parameter

by cybermind » Sun Sep 23, 2012 9:42 am

Re: [ACS] HudMessage width and height parameter

by cybermind » Sat Sep 22, 2012 11:02 am

I think this is a bad method, because the content inside display window is completely random(the system don't know, what graphic or text will be used by modder), and so we couldn't use any situation-specific methods, everything should be absolutely generic

Re: [ACS] HudMessage width and height parameter

by Nash » Sat Sep 22, 2012 9:55 am

How about using graphics with alpha to do the masking instead? Then you can make the "cutoff" any shape and size.

Re: [ACS] HudMessage width and height parameter

by cybermind » Fri Sep 21, 2012 11:09 pm

I'm developing this: http://forum.zdoom.org/viewtopic.php?f=19&t=29564 and the cutoff is needed for such elements as list box widget, because they are showing only small "window" of overall "page", and it's need to display only those elements, which are fit into display part of list box, the rest of information should be just cut by the borders of list box.

Re: [ACS] HudMessage width and height parameter

by Jimmy » Fri Sep 21, 2012 10:23 pm

That seems counterintuitive. Under what circumstances would you need to cut off a hudmessage mid-character? :?:

Re: [ACS] HudMessage width and height parameter

by cybermind » Fri Sep 21, 2012 10:05 pm

Jimmy wrote:

Code: Select all

SetHudSize(640, 480, 1);
SetHudWindow(160, 320, 300, 396); // This would create a window at [x: 160, y: 300] that is 160px wide and 96px tall.

HudMessage(s:"This is a test hudmessage that should contain text which wraps within the confines of the specified window.";
HUDMSG_PLAIN, 0, CR_RED, 80.4, 8.0, 10.0); // See below note for new x and y coordinate usage.

// x: Using 80.4 for "x" positions it in the middle of the 160px-wide window and center-aligns the text.
// y: Using 8.0 for "y" positions it 8px from the top of the window and top-aligns the text.
Your window defining style is good too, although mostly the primary goal of this feature is to cut off the extra information,which is outside of drawing box, so the last letter in line crossing the right border of window ,or last line which crosses the bottom border will be just shown incomlete. So the auto word wrap should be an option of that window

Re: [ACS] HudMessage width and height parameter

by Jimmy » Fri Sep 21, 2012 11:33 am

If this is at all feasible, I think it should be a separate function altogether, like SetHudWindow or something. It would use the parameters of the previously set SetHudSize as the "window" for the next hudmessage to be drawn in. It would probably have to alter the behavior of the x and y parameters of all the following HudMessages, though - drawing them in a position relative to the window's size, rather than the screen's size.

So you'd have something like:

void SetHudWindow(int x-start, int x-end, int y-start, int y-end)
or alternatively:
void SetHudWindow(int x-start, int x-size, int y-start, int y-size)

Code: Select all

SetHudSize(640, 480, 1);
SetHudWindow(160, 320, 300, 396); // This would create a window at [x: 160, y: 300] that is 160px wide and 96px tall.

HudMessage(s:"This is a test hudmessage that should contain text which wraps within the confines of the specified window.";
HUDMSG_PLAIN, 0, CR_RED, 80.4, 8.0, 10.0); // See below note for new x and y coordinate usage.

// x: Using 80.4 for "x" positions it in the middle of the 160px-wide window and center-aligns the text.
// y: Using 8.0 for "y" positions it 8px from the top of the window and top-aligns the text.
I wonder if FDARI could bring forward his opinion/hypothesis on this. :P Something like this I think would be incredibly useful, especially for things like dialogue boxes in which the text is a pain to align on multiple lines.

[ACS] HudMessage width and height parameter

by cybermind » Fri Sep 21, 2012 11:05 am

I wonder if HudMessage could have additional parameters "Width" and "Height" to restrict drawing area into box, so everything that has gone out of this area will be cut off. This should apply with same behaviour to letters (cut off the last letter or last line) and images set by SetFont (just cut off from right and bottom).
So there could be realised some type of "windows", where all elements which have gone out out of window borders, are cut off, and the content could be displayed properly

Top