This content is provided AS IS for archive purposes only. Content may be out of date with no guarantee of correctness.

HagInit - Main Functions - Hag GUI for Cobra - Static

Main Article

HagInit - Main Functions - Hag GUI for Cobra

Procedure HagInit(screenw: Integer, screenh: Integer, index: Integer=0)

Set screenw to the screen width and screenh to the screen height.

Optionally, specify a value for index. This causes hag to start creating elements with a certain sprite z-index. For example, if you have a background sprite, you would specify an index of 1 to cause hag to appear above this layer.

HagInit is a vital command that sets some crucial variables, clears old hag log files, sets default preferences, sets some sane default theme styles, initialises logging and initialises millisecond-based timers.

If you have moved or renamed the hag directory so that it is not available at the default path of "hag/", you must first use the procedure HagBaseDir to tell hag where the directory is. With HagBaseDir as the only exception, HagInit is always the first hag command you will call.

Then, before loading any hag GUI elements, you should first load a theme with HagLoadGuiTheme.




   HagInit(640, 480)    

   // SetUp Your Controls...
   While Not KeyDown(VK_ESCAPE)
       // Update Your Controls...

Stay Subscribed

@golightlyb, subscribe to the RSS feed or get updates by e-mail.

You can also contact me directly - I make an effort to reply to every e-mail.