Miscellaneous Recipes
240
- We need to create the DrawDebugText() function in our TestHUD class which is
called by DrawDebugMenu() in our DebugScreen class.
/*****- Draws the text for the debug screen
*****/
function DrawDebugText(string text, Vector2D position, Font
font,Color textColor)
{
Canvas.SetDrawColorStruct(textColor);
Canvas.SetPos(position.X,position.Y);
Canvas.Font = font;
Canvas.DrawText(text);
}
- Draws the text for the debug screen
This draws the debug text and looks similar to the other canvas functions we used in
Chapter 7, HUD.
- Our TutorialHUD class's PostRender() event needs to call our DebugMenu as
well, so let's do that now.
event PostRender()
{
....
/* Draws debug HUD /
DebugMenu(PlayerOwner.CheatManager).DrawDebugMenu(self);
....
} - The final step in this recipe has us assigning the DebugMenu class as the default
cheat class in our TutorialPlayerController class. Add the following bit of
code to the defaultproperties block:
defaultproperties
{
....
CheatClass=class'DebugMenu' // Reference for DebugMenu
....
}