Jump to content

hudmessage on top of another hudmessage [SOLVED]


Shkwarkel

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...