Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Shkwarkel

hudmessage on top of another hudmessage [SOLVED]

Recommended Posts

I'm trying to make my own custom interface and can not overlay over the picture text that shows the health of the player. Different ways either the picture removes the health inscription or the reverse. Please help
Code:

#include "zcommon.acs"

script 1 ENTER
{
    int health = GetActorProperty(0, APROP_HEALTH);
    
    while(true)
    {
        SetFont("BIGFONT");
        HudMessage(d:(health);
        HUDMSG_PLAIN, 1, CR_RED, 0.5, 1.0, 1.0);

        Delay(1);
        health = GetActorProperty(0, APROP_HEALTH);
    }
}
script 2 ENTER {
    SetFont("HUTER");
    HudMessage(s: "A"; HUDMSG_PLAIN, 0, 0, 0.5, 1.0, 0);
}

Edited by Shkwarkel

Share this post


Link to post

Not 100% sure, but maybe the issue is this:

Quote

Messages with lower ids will overlap those with higher ids

taken from the wiki.

The "picture" message will always render on top of the health because of its lower id.

 

I'm saying not 100% sure, because sometimes, an id = to 0 has some "special behavior", so I suggest you to give that a higher id number.

Share this post


Link to post

The solution to the problem was incorrect idexation in hudmessage. The smaller the number in the index the higher the layer will be. Accordingly, I set the photo for the background of the interface to 100, and the other elements from 1 and more, but not more than 100. And then it turns out that you can set inscriptions on the background of the picture.

Code:
script 1 ENTER {

            //Show health
            SetHudSize(220, 200, 1);
            SetFont("BIGFONT");
            HudMessage(d:(health);
            HUDMSG_PLAIN, 1, CR_GREEN, 47.5, 184.0, 1.0);
            health = GetActorProperty(0, APROP_HEALTH);
            Delay(1);
}

script 2 ENTER {
    //Show hud
    SetFont("HUTER");
    SetHudSize(0, 0, FALSE);
    HudMessage(s: "A"; HUDMSG_PLAIN, 100, 0, 0.5, 1.0, 0);
}

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×