Discovering Windows Phone 7 #1

I’m starting to learn about XAN 4 for Windows Mobile 7, and going through all the examples from the MIX10.
The example I’m showing tonight comes from Shawn Hargreaves Blog (http://blogs.msdn.com/shawnhar/archive/2007/06/08/displaying-the-framerate.aspx) and It’s an example of how to create a Frame Rate counter component. I heard about this on this on the session CL19 (DEVELOPMENT AND DEBUGGING TOOLS FOR BUILDING XNA GAMES FOR WINDOWS PHONE – http://live.visitmix.com/MIX10/Sessions/CL19).

At first I had some problems with this specific line of code:

_font = Game.Content.Load<SpriteFont>(“Arial”);

The runtime was throwing a File Not Found exception.
I was initially adding the Arial.spritefont manually to the WindowsPhoneGame project, but digging the XNA Forums (http://forums.xna.com/forums/) I figured out that that resource needed to be added to the WindowsPhoneGameContent project instead of the Game project.

In the end, here it’s my FPS counter

image

Advertisements
Categories: WP7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s