Monday, October 17, 2005

Well, after much pain and suffering, mostly on Haz's part, the new HUD system is finally making progress, and since I'm in a mood, I'm going to talk a bit about how it will work in the .NET Native Framework in an upcoming alpha release.

Firstly, creating a HUD:

// hudRect defines the area of the screen on which we draw
Rectangle hudRect = new Rectangle(10, 50, 300, 16);
Decal.Adapter.Wrappers.HUD hud = Host.Huds.CreateHUD(hudRect);

Now that we have a HUD, lets make it colorful!

Color myBGColor = Color.FromArgb(64, Color.Gray);
hud.Fill(myBGColor);

This gives us a nice, mostly transparent grey background.  Lastly, we'll render some text:

hud.BeginText("Times New Roman", 16);
hud.WriteText("SomeText", Color.White);
hud.EndText();

And that's IT!  Of course there are other neat features that need to be tweaked a bit, and some issues that need to be solved, but we'll have progress or kill someone trying!  Lastly I leave you with a potential outcome of the above code, of course with some additions.

working hud

posted on Tuesday, October 18, 2005 3:29:40 AM (Central Daylight Time, UTC-05:00)  #    Comments [0] Trackback
Related posts:
Ugly, Isn't It?
DSOFile .NET
UpdateProgress for all Requests
Install VSTO Add-Ins for All Users
Resurrecting Nerfus Buffus
Adapter Messages...