Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Quasar

EE v3.33.01 Progress Report, Part Deux

Recommended Posts

Eternity now has the ability to fully script the Heads-Up Display system. Here is a screenshot of a test map I made:



And here's the Small code that accomplishes it, for people interested in how HUD scripting will generally work. This script doesn't demonstrate everything that is possible, just some basics.

new state = 0;

//
// OnInit
//
// Called at game startup. Creates a new patch widget for the HUD and
// sets the AnimCB callback running every half second.
//
public OnInit()
{
   _NewPatchWidget("ImpSexPic", "IMPSE1", 160, 100);
   _SetCallback("AnimCB", _SWAIT_DELAY, 18);
}

//
// OnHUDStart
//
// Called whenever the HUD resets itself. Sets the new widget to its initial
// state.
//
public OnHUDStart()
{      
   state = 0;
}

//
// OnHUDPreDraw
//
// Called immediately before HUD elements are drawn to the screen. This is the 
// safest time to alter HUD picture properties.
//
public OnHUDPreDraw()
{
   if(state == 0)
      _SetWidgetPatch("ImpSexPic", "IMPSE1");
   else
      _SetWidgetPatch("ImpSexPic", "IMPSE2");
}

//
// AnimCB
//
// Called every half second, this function inverts the state of the animation.
// The actual pic change is done above, however, so that the graphics will 
// always be cleared correctly.
//
public AnimCB()
{
   state ^= 1;
   _SetCallback("AnimCB", _SWAIT_DELAY, 18);
}

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×