XNA Windows Phone Theme Library

Recently, whilst developing Sweepy Cleaner I found that it was a bit of a pain to get the theme colour of the phone in XNA, Microsofts Game Development API. This was frustrating, especially compared to how easy Microsoft have made it for Silverlight Applications. My solution to this issue is WindowsPhoneTheme.dll, a simple to set up, simple to use library which does what it says on the tin. It has the following features:

  • Get the following resources delivered to your XNA game code as an XNA colour
    • Phone Background Colour (Dark / Light)
    • Phone Accent Colour (Tile Colour)
    • Phone Border Colour
    • Phone Chrome Colour
    • Phone Contrast Background Colour (i.e. The opposite of the current background colour)
    • Phone Contrast Foreground Colour
  • Get the colour of any tile type. Don’t want to have to remember the RGB values for all the possible colours? Now you don’t have to.
    • WindowsPhoneTheme.blue will return you blue
    • Here are the other colours
      • blue
      • red
      • green
      • mango (orange)
      • pink
      • brown
      • lime
      • teal
      • purple
      • magenta
  • Simple Syntax
    • Just want the tile colour?
      getTileColour();

      Simple as that

    • Use intellisense for the other methods

The Windows Phone Theme Library is released under an MIT license. Do whatever you want with it, but I would love it if you credited me and emailed me to let me know you’ve done so at this email address.

To download the library and see the associated usage guide click here

Advertisements

Tags: , , , , , , ,

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.