Saturday, August 28, 2010

Port Royale 2 With Multiplayer

resolution of our game ...

Open a new project, an Xbox 360 game, inside the constructor game1 we placed the code to set the fixed resolution of 1280 x 720.

The bool "graphics.isfullscreen" we need to debug in the pc:)


using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace STARTER
{

public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";

/ / screen resolution set to start:)
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
graphics.IsFullScreen = true;




} protected override void Initialize () {
base.Initialize ();}

protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);

}

protected override void UnloadContent()
{
}

protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();

base.Update(gameTime);

} protected override void Draw (GameTime gametime) {
GraphicsDevice.Clear (Color.CornflowerBlue)
base.Draw (gametime);}
}}

0 comments:

Post a Comment