Init (BaseStatusBar)

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.

virtual void Init()


Called when a status bar is first created when opening the game. This can be used to initialize any special variables or set up size information about the status bar.


override void Init()

    // Set the status bar virtual resolution to 320x200 with a status bar height of 32 pixels
    SetSize(32, 320, 200);

    // Initialize fonts to be used throughout the rest of the HUD
    Font fnt = "HUDFONT_DOOM";
    mHUDFont = HUDFont.Create(fnt, fnt.GetCharWidth("0"), Mono_CellLeft, 1, 1);

    fnt = "INDEXFONT_DOOM";
    mIndexFont = HUDFont.Create(fnt, fnt.GetCharWidth("0"), Mono_CellLeft);
    mAmountFont = HUDFont.Create("INDEXFONT");

    diparms = InventoryBarState.Create();

Internal Code

virtual void Init()