SetHudSize()

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
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

SetHudSize()

Post by LilWhiteMouse »

How exactly do you manipulate the values for SetHudSize() and Hudmessage()? I have an icon, MANAI, 15x13, offsets set to 0x0. My video mode is set to 640x400. I use the following ACS:

Code: Select all

script 48 ENTER {
sethudsize(640,400,1);
SetFont("MANAI");
while (1) 
	{
hudmessage (s:"A";0,0,-1,623.1,355.1,1.0);
delay (const:35);
	}
}
But my icon doesn't appear. I have to reduce the HudMessage()'s Y value to < 240.1 to get it on the screen.

This is where the icon ends up when I "center" it at 320x200:
Image
Last edited by LilWhiteMouse on Fri Dec 12, 2003 5:47 pm, edited 1 time in total.
User avatar
Nanami
Posts: 1066
Joined: Tue Jul 15, 2003 5:13 pm
Location: That little island pritch created.
Contact:

Post by Nanami »

Out of curiosity, why do you have a loop there? If you set the time to 0.0 it'll stay forever, and you won't need a loop.

I'm sorry I can't help with the other problem. I haven't messed with SetHudSize much yet.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

Nanami wrote:Out of curiosity, why do you have a loop there? If you set the time to 0.0 it'll stay forever, and you won't need a loop.
When it wouldn't display, I setup a script to adjust the value through the console. The loop was to reflect the new values.
User avatar
Nanami
Posts: 1066
Joined: Tue Jul 15, 2003 5:13 pm
Location: That little island pritch created.
Contact:

Post by Nanami »

Ooh, adding a new mana type, I like it.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

I've tried various hud sizes, and I get the same results. Setting the coordinates for the center of the specified hud places it about 3/4 the way down the screen instead. I ran through a couple different video modes, images, even the default font, with consistant below center locations. Is this a bug?
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

I use this in Daedalus:

Code: Select all

(in a loop on ijk)
         sethudsize(640,400,1);
         setfont (asGun1[ijk]);
         hudmessage (s:"A";HUDMSG_PLAIN, 900, CR_UNTRANSLATED, 360.0, 300.0, 1);
It appears at the bottom with a 143-high graphic, intentionally cut off a bit at the bottom, and a bit to the right of center.

I noticed you end your hudmessage() call with 1.0 instead of 1. Maybe I should wonder why mine doesn't have problems :oops:

[edit]Check your arguments--I think you're one short.[/edit]
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

What argument am I missing? From my notes:

Code: Select all

hudmessage (text; int type, int id, int color, fixed x, fixed y, fixed holdTime, ...);

Messages types other than 0 also take additional parameters.
Using your ACS, only replacing your setfont() with setfont("ETTNA1"), the ettin appeared half clipped off the bottom of the screen. It's only ~70 pixels high, so shouldn't it have appeared fully on the screen?
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

Sorry, you're fine on args. Periods and commas are way too hard to discern in code mode :(

ETTNA1 is a sprite, I assume, and mine are textures. I don't know if that matters or if there's a y-offset as a result? I agree that a shorter texture shouldn't have been clipped. Try it with SHAWN2 or something and see if you get the same cutoff with a texture instead of a sprite.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Post by LilWhiteMouse »

Using this:

Code: Select all

sethudsize(640,400,1); 
setfont ("w_359"); 
hudmessage (s:"A";HUDMSG_PLAIN, 900, CR_UNTRANSLATED, 360.0, 300.0, 1); 
W_359, which is a 64x64 patch, is half clipped off the screen. Using the texture name FORPUZ1 didn't even display.
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

Well, I have 2 things to say:
- I think it might be buggy unless Randy can explain it
- I hope fixing it doesn't break Daedalus :(
User avatar
Lexus Alyus
Posts: 4220
Joined: Tue Jul 15, 2003 5:07 pm
Location: Nottingham, UK
Contact:

Post by Lexus Alyus »

Does this meanb that you don't have to use imagetool? If so, then how do I set up my graphic to be used with hudmessage as a font?

Also, I was having problems with my mission console... I set the allignment right in 800x600 res, but it goes off in other resolutions, what are the commanbds for the "sethudsize"? And how do you use it?

:twisted:
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

Lexus: You can specify a graphic name in setfont().
RH-log.txt June 30, 2003 wrote: - Added the ability for the SetFont ACS command to load normal pictures as
fonts. When used this way, it creates a new font with only the letter A
defined, and the letter A is drawn as whatever the picture is. This
effectively allows you to use HudMessage like a HudPic command. The
drawback to this method is that you cannot use any color translations, as
you can with real fonts.
Documentation on sethudsize is in the Sept. 25th update.

Don't you read that file? It's the closest thing to docs there are for new features.
Locked

Return to “Editing (Archive)”