I'm making a game for Windows Phone 8 using XNA 4.0 in Visual Studio express 2012. I'm trying to add a background image to the game with a size of 1366x768 (as i believe WP8 only supports up to 720p). Everything stretches![enter image description here][2] well on the other emulators (WVGA and WXGA) until i use the 720p emulator and i get black bars on the sides. (picture) http://i46.tinypic.com/30crj44.png This is all the code i have used so far:
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D Background;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
this.graphics.IsFullScreen = true;
// Frame rate is 30 fps by default for Windows Phone.
TargetElapsedTime = TimeSpan.FromTicks(333333);
// Extend battery life under lock.
InactiveSleepTime = TimeSpan.FromSeconds(1);
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
Background = Content.Load<Texture2D>("SkyBackground");
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
spriteBatch.Begin();
drawBackground();
spriteBatch.End();
base.Draw(gameTime);
}
private void drawBackground()
{
spriteBatch.Draw(Background, GraphicsDevice.Viewport.Bounds, Color.White);
}
How can i fix this, or is this normal? Any help for a noob like me would be appreciated :)
