hudmessage guideline?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Cutmanmike
Posts: 11353
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

hudmessage guideline?

Post by Cutmanmike »

Quick question, is there any tool available that can help me out with lining up hudmessages? Right now I'm using trial and error to work out where everything is going to be placed. An app to guide me would be a lot easier than changing values, checking it in doom, going back out, changing them again etc.
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

Re: hudmessage guideline?

Post by bagheadspidey »

try this: take an image editor, create a new document at 640 x 400 or whatever size you will use with sethudsize. Now take a screenshot at that resolution, or take one at any resolution and scale it so it fits in the middle of the document. Do a mockup of your hud in the image editor. Now just point the mouse cursor at the insertion points for the different hud elements, your coordinates should show up in the status bar (lower right in this screenshot).
Spoiler: image
User avatar
Cutmanmike
Posts: 11353
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: hudmessage guideline?

Post by Cutmanmike »

I tried that with irfanview but the coordinates were always off. Not sure why. Let's say I wanted to print some text, would the co-ordinates be from to the top left corner or bottom left corner (of the first letter)?
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

Re: hudmessage guideline?

Post by bagheadspidey »

That depends on the fractional part of the coordinate. Super wiki copy:
Coordinate Behavior

After SetHudSize, you need to specify actual pixel coordinates and not numbers in the [0.0, 1.0] or similar ranges. However, they are still fixed point, so you need to keep the decimal point. If you used SetHudSize(320, 200, 1); and want to draw a hudmessage at the center of the screen, you should pass it the coordinates (160.0, 100.0) and not (0.5, 0.5).

The fractional part of the coordinates affect what part of the hud message you are positioning:

For x:

.0 = positions center of box
.1 = positions left edge of box
.2 = positions right edge of box
.4 = centers text inside box and aligns center
.5 = centers text and aligns left edge
.6 = centers text and aligns right edge

For y:

.0 = positions center of box
.1 = positions top edge of box
.2 = positions bottom edge of box

So if you used SetHudSize(320, 200, 1), then the coordinates (160.1, 100.1) will position the upper-left corner of the hud message. The coordinates (160.2, 100.2) will position its lower-right corner instead.

To make HudMessage behave as normal, use SetHudSize(0, 0, 0).
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Re: hudmessage guideline?

Post by Theshooter7 »

Ya know, there is a built-in program like this for the AMX Mod X studio used for making plugin mods for Half-Life. I wanted to sit down and do something like that one time, but I've never really gotten around to working on it (along with the fact I'm not a great programmer to begin with, it would take me a little just to figure out how to get started. :P)
Locked

Return to “Editing (Archive)”