Tutorial 1.4: Displaying The Framerate
The last thing you need to do to use the engine is set up the system font, which is used by the engine for drawing things like the framerate onscreen.
  • First, right click on Content in your Solution Explorer and choose "Add New Item". Select "SpriteFont" and give it a name. Customize your font following the comments in the code that is generated for you.
  • Now go back to your Initialize method, and add the following code, right under XE2.Initialize();
XGameState.SetSystemFont("System"); // Change System to the filename of the font you just made
XGameState.ToggleFramerate();

When you run the code now you should see the framerate in the upper left corner, drawn with the font you made.

Tutorial1.JPG

Congratulations, you are now ready to begin making your game with the X-Engine! For more tutorials, visit the Tutorials page. The source code for this tutorial can be found here: Tutorial1.zip

Last edited Mar 23, 2008 at 6:42 AM by Hazardous101, version 3

Comments

No comments yet.