private int width, height; // Width and Height of the screen

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="width">Screen width</param>
        /// <param name="height">Screen height</param>
        public ViewGamePlayMenu(int width, int height, SpriteSheet sheet)
        {
            this.width = width;
            this.height = height;
            location = Microsoft.Xna.Framework.Vector2.Zero;
            loadGamePlaySprite(sheet);
            location.X = width - gamePlaySprite.frameDimX;
            location.Y = height - gamePlaySprite.frameDimY;
        }
 /// <summary>
 /// Load a misc. and utiltity spritesheet
 /// </summary>
 /// <param name="utilSheet"></param>
 public void LoadUtilitySpriteSheet(SpriteSheet utilSheet)
 {
     this.spriteUtil = utilSheet;
     this.dragBox = new Rectangle(-1, -1, 0, 0);
 }
 /// <summary>
 /// Load a unit spritesheet
 /// </summary>
 /// <param name="unitSheet"></param>
 public void LoadUnitsSpriteSheet(SpriteSheet unitSheet)
 {
     this.spriteUnits = unitSheet;
 }
 /// <summary>
 /// Load a tile spritesheet
 /// </summary>
 /// <param name="spriteTile">Tile spritesheet</param>
 public void LoadSpriteSheet(SpriteSheet spriteTile)
 {
     this.spriteTiles = spriteTile;
 }
 /// <summary>
 /// Load buildings spritesheet
 /// </summary>
 /// <param name="sheet"></param>
 public void LoadBuildingSpriteSheet(SpriteSheet sheet)
 {
     spriteBuildings = sheet;
 }
        /// <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);
            //21/35
            sample_image = new SpriteSheet(Content.Load<Texture2D>("sprites/commandos"), spriteBatch, 21, 35);
            sample_tile = new SpriteSheet(Content.Load<Texture2D>("sprites/green_tile20x20"), spriteBatch, 20, 20);
            sample_util = new SpriteSheet(Content.Load<Texture2D>("sprites/util_misc20x20"), spriteBatch, 20, 20);

            gameSelectView.loadSpriteSheet(sample_util);

            gameView = new View(40, 40, spriteBatch);
            gameView.LoadScenario(this.testGameController.scenario);
            gameView.LoadMap(this.testGameController.gameWorld);

            gameView.LoadSpriteSheet(sample_tile);
            gameView.LoadUnitsSpriteSheet(sample_image);
            gameView.LoadUtilitySpriteSheet(sample_util);
            testGameController.registerObserver(gameSelectView);
            // TODO: use this.Content to load your game content here
        }
 /// <summary>
 /// Load sprite sheet for all icons corresponding to all type of entities
 /// </summary>
 /// <param name="sheet"></param>
 public void loadIconSprite(SpriteSheet sheet)
 {
     gamePlayIconSprite = sheet;
     buttonWidth = gamePlayIconSprite.frameDimX / 4;
     buttonHeight = gamePlayIconSprite.frameDimY;
 }
        /// <summary>
        /// Load sprite sheet of the menu
        /// </summary>
        /// <param name="sheet"></param>
        public void loadGamePlaySprite(SpriteSheet sheet)
        {
            gamePlaySprite = sheet;

            iconLocation = Microsoft.Xna.Framework.Vector2.Zero;
            iconLocation.X = width - (.91f*gamePlaySprite.frameDimX);
            iconLocation.Y = height - (.82f*gamePlaySprite.frameDimY);
        }
        /// <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);
            //21/35
            sample_image = new SpriteSheet(Content.Load<Texture2D>("sprites/commandos"), spriteBatch, 21, 35);
            sample_tile = new SpriteSheet(Content.Load<Texture2D>("sprites/green_tile20x20"), spriteBatch, 20, 20);
            sample_util = new SpriteSheet(Content.Load<Texture2D>("sprites/util_misc20x20"), spriteBatch, 20, 20);
            menuUI = new SpriteSheet(Content.Load<Texture2D>("gamePlayUI/menuUI"), spriteBatch, 299, 211);
            iconUI = new SpriteSheet(Content.Load<Texture2D>("gamePlayUI/icons"), spriteBatch, 208, 51);
            gamePlayMenu = new ViewGamePlayMenu(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight,menuUI);
            gamePlayMenu.loadIconSprite(iconUI);

            gameSelectView.loadSheet(sample_util);

            gameView = new ZRTS.View.ViewGame(800,600);
            //gameView.LoadScenario(this.testGameController.scenario);
            gamePlayMenu.LoadScenario(this.testGameController.scenario);
            gameView.loadGameWorld(this.testGameController.gameWorld);

            gameView.loadSheet(sample_tile);
            gameView.loadUnitSheet(sample_image);
            //gameView.LoadUtilitySpriteSheet(sample_util);
            gameView.loadBuildingSheet(new SpriteSheet(Content.Load<Texture2D>("gameBuildings/sample_build"), spriteBatch, 40, 40));
            testGameController.registerObserver(gameSelectView);
            // TODO: use this.Content to load your game content here
        }
 /// <summary>
 /// Load a new spritesheet
 /// </summary>
 /// <param name="sheet"></param>
 public void loadSpriteSheet(ZRTS.SpriteSheet sheet)
 {
     this.utilSheet = sheet;
 }
 /// <summary>
 /// Load a misc. and utiltity spritesheet
 /// </summary>
 /// <param name="utilSheet"></param>
 public void LoadUtilitySpriteSheet(SpriteSheet utilSheet)
 {
     this.spriteUtil = utilSheet;
     this.dragBox    = new Rectangle(-1, -1, 0, 0);
 }
 /// <summary>
 /// Load a unit spritesheet
 /// </summary>
 /// <param name="unitSheet"></param>
 public void LoadUnitsSpriteSheet(SpriteSheet unitSheet)
 {
     this.spriteUnits = unitSheet;
 }
 /// <summary>
 /// Load a tile spritesheet
 /// </summary>
 /// <param name="spriteTile">Tile spritesheet</param>
 public void LoadSpriteSheet(SpriteSheet spriteTile)
 {
     this.spriteTiles = spriteTile;
 }
Beispiel #14
0
 /// <summary>
 /// Load a new spritesheet
 /// </summary>
 /// <param name="sheet"></param>
 public void loadSpriteSheet(ZRTS.SpriteSheet sheet)
 {
     this.utilSheet = sheet;
 }
Beispiel #15
0
 /// <summary>
 /// Load sprite sheet for all icons corresponding to all type of entities
 /// </summary>
 /// <param name="sheet"></param>
 public void loadIconSprite(SpriteSheet sheet)
 {
     gamePlayIconSprite = sheet;
     buttonWidth        = gamePlayIconSprite.frameDimX / 4;
     buttonHeight       = gamePlayIconSprite.frameDimY;
 }