Jump to content
  • 0

Zscript HUD Font


ArrivedHero

Question

Hey, I've been trying to create my own HUD with my own fonts but of course I am running into trouble. I am following along with how the DoomStatusBar class added it's own fonts in it's Init() function but I keep getting a "expression must be a modifiable value" error.

 

Here is my code.

 

class TheLastIconHUD : BaseStatusBar
{
    HUDFont visor;
    HUDFont damageEffects;
    

    override void Init()
    {
        Super.Init();
        SetSize(0, 1920, 1080);
        
        Font fnt = "TESTFONT";
        visor = HUDFont.Create(fnt, fnt.GetCharWidth("0"), Mono_CellLeft, 1, 1);
        fnt = "DAZEFONT";
        damageEffects = HUDFont.Create(fnt);
    }
    
    override void Draw(int state, double TicFrac)
    {
        super.Draw(state, TicFrac);
        
        DrawImage("hud0", (0, 0), DI_ITEM_OFFSETS);
    }
    
}

 

What exactly am I doing wrong?

Edited by ArrivedHero

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 0

Update: Found the problem. I had to add the updated version into the ZScript file "version '4.1.2'". I know, I'm a version behind but I'm working on it.

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
Answer this question...

×   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...