Exemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Guarantees that the storage device will be not be null before continuing
            //while(Storage == null)
            //{
            // Console.Write("Getting Storage...");
            // To avoid GuideAlreadyVisibleException
            while (LiveServices.GuideIsVisible())
            {
            }
            StorageDevice.BeginShowSelector(getStorage, "Get initial StorageDevice");
            // Console.Write("   ..."+Storage+"... ");
            // Console.Write("Call Started...");
            //}

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            GameTextures.load(Content);
            GameVideos.load(Content);
            PostProcessFx.LoadContent();
            //MapManager.tempMap.LoadContent(Content);
            font = Content.Load <SpriteFont>("FontA");
            //newfont = Content.Load<SpriteFont>("fontfile");
            newfont         = Content.Load <SpriteFont>("dotsfontfile");
            volterfont      = Content.Load <SpriteFont>("font-volter");
            newfontgreen    = Content.Load <SpriteFont>("fontfile-green");
            blueNumbersFont = Content.Load <SpriteFont>("bluenumbersfont");
            buttonsFont     = Content.Load <SpriteFont>("xboxControllerSpriteFont");
            ButtonDraw.initialize(buttonsFont);
            GC.Collect();
        }
Exemplo n.º 2
0
        //private void respondToUpDown(int i)
        //{
        //    if (ssarea[i].input.actionPressed(InputAction.MenuDown))
        //    {
        //        increaseShipHue(ssarea[i], 2.5f);
        //        Race.humanRacers[i].setColour((int)ssarea[i].hue);
        //    }
        //    if (ssarea[i].input.actionPressed(InputAction.MenuUp))
        //    {
        //        decreaseShipHue(ssarea[i], 2.5f);
        //        Race.humanRacers[i].setColour((int)ssarea[i].hue);
        //    }
        //}

        /// <summary>
        /// Draws borders and graphics on splitscreen ship selection menu. Includes button graphics, arrows and text.
        /// </summary>
        /// <param name="gameTime">game time</param>
        public void Draw(GameTime gameTime)
        {
            BeatShift.graphics.GraphicsDevice.Viewport = Viewports.fullViewport;
            Rectangle viewArea = new Rectangle(0, 0, BeatShift.graphics.GraphicsDevice.Viewport.Width, BeatShift.graphics.GraphicsDevice.Viewport.Height);

            //TODO: Iterate over viewports instead.

            BeatShift.spriteBatch.Begin();
            //draw lines down middle of screen to make the split visible.
            //done in mainGame

            BeatShift.spriteBatch.Draw(GameTextures.MenuBackgroundBlue, viewArea, Color.White);

            //for each viewport/controller
            for (int i = 0; i < 4; i++)
            {
                if (ssarea[i].isActive)// is player ISACTIVE (by pressing a) do:
                {
                    Race.isPrimed = true;
                    //BeatShift.spriteBatch.DrawString(BeatShift.newfont, "Press start to begin Race", new Vector2(300, 300), Color.Black);
                    // draw name of ship above ship
                    // draw verticle hue bar next to ship
                    // draw arrows either side of ship
                }
                else
                {
                    // if not active draw image of controller button 'a'
                    Vector2 pos = new Vector2(Race.localCameras[i].Viewport.X + Race.localCameras[i].Viewport.Width / 2, Race.localCameras[i].Viewport.Y + Race.localCameras[i].Viewport.Height / 2);
                    ButtonDraw.DrawButton(BeatShift.spriteBatch, ButtonImage.A, pos, 0.8f);
                }
            }

            BeatShift.spriteBatch.End();
        }