Zune Programming Considerations
Collapse the table of content
Expand the table of content

Zune Programming Considerations

Describes general programming issues to consider when creating Zune games.


When programming for Zune, these graphics considerations are the most important:

  • Zune supports 2D graphics only.
  • Zune has a fixed 240x320 display size.

Zune Display Surface

The Zune device has a fixed display size of 240x320 pixels. The display can be used in either portrait or landscape orientation.

Zune games use the full 240x320 resolution of the Zune display. The entire display surface is available for text, and for critical game information such as score, number of lives, ammo, and so on. Games can draw the background texture across the entire display.

On Zune, games don't need to perform calculation of a title safe region. However, code that performs this calculation within a #if XBOX conditional directive (in order to limit the calculation to the Xbox 360) will continue to function correctly. See How To: Draw a Sprite for an example.

Zune supports only one aspect ratio, 4:3 (or 3:4, when held vertically). Neither the XNA Framework nor the Zune device performs any aspect ratio conversion or letterboxing.

3D Graphics

The Zune device supports 2D graphics only. It does not support 3D graphics or 3D acceleration, including 3D primitives, 3D textures, index and vertex buffers, shaders, effects, and multisampling. Zune does not implement classes that provide 3D functionality, including the following: Texture3D, IndexBuffer, Model, BasicEffect, PixelShader, ClipPlane, DepthStencilBuffer, Effect, and SamplerState.

The documentation for each type and member in the XNA framework identifies supported platforms.

ResourceUsage Flags

TextureUsage flag settings other than TextureUsage.None have no effect on Zune. The XNA Framework will still raise exceptions for invalid combinations of TextureUsage flags and other texture settings (such as format and number of mipmap levels). Use TextureUsage.None for Windows, Xbox 360, and Zune platforms, whenever possible.


For input, the Zune device has two buttons and either a control pad or a Zune Pad. These inputs map to controller input, retrieved with the GamePad.GetState method. For more information on specific mappings and programmatically detecting user input, see Zune Button Mapping.

APIs related to input devices not available on Zune, such as Mouse and Keyboard, can be accessed in code running on a Zune device. The X and Y values in MouseState returned on Zune will always be zero. Similarly, checking for keys pressed using Keyboard on Zune will always return keys in an unpressed state. Also, you should not expect an exception when you access the mouse, keyboard, or other unexpected input devices on Zune.

Media and Audio

Zune audio uses the new SoundEffect and SoundEffectInstance classes for sound effects, including playing .mp3 and .wma files. Zune games use the new Microsoft.Xna.Framework.Media namespace and classes for playing songs on the Zune device and for viewing pictures in the media library. To create a rich media experience, games use the capabilities of the Media namespace to incorporate media from the device library directly into gameplay.

Zune does not use XACT audio wave banks or sound banks.


To get a storage device and then create containers and files on that device, Zune games use the BeginShowStorageDeviceSelector method, just as Xbox 360 games do. On Zune, this call immediately returns the StorageDevice object. How To: Get a StorageDevice Asynchronously demonstrates this process.

The maximum size of an XNA Framework project on a Zune device is 2 GB. This means the entire game, including support files such as level data, sound, and so on, must not exceed that size.

The maximum memory usage of an XNA Framework game on a Zune device is 16 MB. This means that memory usage and content loaded by the game (graphics, sound, levels, and so on) should not exceed 16 MB.

Source Code

Zune projects define a ZUNE symbol for use with conditional compilation directives such as #if. You can use conditional compilation to maintain source code that is shared between projects, but has different behaviors for Windows, Xbox 360, or Zune. How To: Draw a Sprite gives you an example of conditional compilation where the available screen space is calculated differently for Xbox 360 than for Windows and Zune. (See #if (C# Reference) and C# Preprocessor Directives for more information on conditional compilation and C# preprocessor directives.)

XNA Game Studio and Your Zune

Exiting a Game

When an XNA Framework game exits on the Zune, the Zune device reboots. This behavior is by design (and is also desirable—it ensures that game and runtime resources are completely cleaned up after a game exits).

Holding down the Back button for 2 seconds will force the currently executing game to exit, regardless of the game's normal exit semantics.

Rebooting Your Zune

If your Zune device becomes unresponsive or is not operating as expected, you may want to reboot it.

To restart the Zune device

  1. Set the Hold switch to the unlocked position.

    To make sure that the Hold switch is in the unlocked position, you may have to move the switch first to the locked position, and then to the unlocked position. This ensures the switch is fully in the unlocked position.
  2. Press and hold the Back button as you press the top portion ('Up') on the Zune Pad.

  3. Release both buttons when the Zune device begins to restart.

    Typically, the device will restart 2-3 seconds after you begin holding both buttons down.

For additional Zune device information, visit www.zune.net.

Community Additions

© 2016 Microsoft