Page 1 of 1

SetHudSize()

Posted: Fri Dec 12, 2003 5:29 pm
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

Posted: Fri Dec 12, 2003 5:31 pm
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.

Posted: Fri Dec 12, 2003 5:39 pm
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.

Posted: Fri Dec 12, 2003 7:01 pm
by Nanami
Ooh, adding a new mana type, I like it.

Posted: Fri Dec 12, 2003 10:37 pm
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?

Posted: Sat Dec 13, 2003 5:18 am
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]

Posted: Sat Dec 13, 2003 6:58 am
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?

Posted: Sat Dec 13, 2003 8:07 am
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.

Posted: Sat Dec 13, 2003 8:23 am
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.

Posted: Sat Dec 13, 2003 8:27 am
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 :(

Posted: Sun Dec 14, 2003 4:28 am
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:

Posted: Sun Dec 14, 2003 8:07 am
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.