Init (BaseStatusBar)

Note: This feature is for ZScript only.

virtual void Init()

Usage

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.

Examples

override void Init()
{
    super.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() 
{
}

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.