예제 #1
0
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();

            gameBackground.Draw(gameTime, spriteBatch);
            spriteBatch.Draw(content.Load <Texture2D>("Background/Goku_UI"), new Rectangle(1170, -50, 1378, 1200), new Rectangle(0, 0, 689, 600), Color.White);
            spriteBatch.DrawString(content.Load <SpriteFont>("Font/TitleFont"), "Goku's Adventure", new Vector2(50, 70), Color.White);

            //if instructions button is pressed then draw
            if (isInstructionsPressed)
            {
                gamemenuoptions.drawInstructions(gameTime, spriteBatch);
            }
            else if (isSelectLevelPressed)
            {
                levelSelector.Draw(gameTime, spriteBatch);
            }
            else
            {
                foreach (var component in components)
                {
                    component.Draw(gameTime, spriteBatch);
                }
            }

            spriteBatch.End();

            //if select Level button is pressed then draw
        }
예제 #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(new Color(93, 148, 251));

            switch (State)
            {
            case GameState.WorldSelector: Selector.Draw(spriteBatch); break;

            case GameState.InGame: GameWorld.Draw(spriteBatch); break;
            }

            base.Draw(gameTime);
        }