SmartboyDevelopments.Haxxit.MonoGame.GameStates.TutorialState.LoadContent C# (CSharp) Method

LoadContent() public method

public LoadContent ( GraphicsDevice graphics, SpriteBatch sprite_batch, Microsoft.Xna.Framework.Content.ContentManager content ) : void
graphics GraphicsDevice
sprite_batch Microsoft.Xna.Framework.Graphics.SpriteBatch
content Microsoft.Xna.Framework.Content.ContentManager
return void
        public override void LoadContent(GraphicsDevice graphics, SpriteBatch sprite_batch, ContentManager content)
        {
            ArialFontSize12 = content.Load<SpriteFont>("Arial-12px-Regular");
            rectangle_texture = new Texture2D(graphics, 1, 1);
            rectangle_texture.SetData(new Color[] { Color.White });
            overlay = new DrawableRectangle(rectangle_texture, new Rectangle(0, 0, 800, 480), Color.Black * 0.5f);
            win_font = content.Load<SpriteFont>("Arial-36px-Bold");
            sub_font = content.Load<SpriteFont>("Arial-16px-Regular");

            //-------------------------------------------------------------------------

            storyStringSpriteFont = content.Load<SpriteFont>("Arial-12px-Regular");

            blankTexture = new Texture2D(graphics, 1, 1);
            blankTexture.SetData(new Color[] { Color.White });

            buttonPressed = content.Load<Texture2D>("blackButtonPressed");
            buttonReleased = content.Load<Texture2D>("blackButtonReleased");

            storyPos = new Vector2(mWindowWidth / 2 - 200, 100);

            displayRect = new Rectangle(mWindowWidth / 2 - 210, 90, 420, 235);
            displayOutterEdgeRect = new Rectangle(mWindowWidth / 2 - 220, 80, 440, 255);

            tutorialRect1 = new Rectangle(mWindowWidth - 700, mWindowHeight - 170, 170, 110);
            tutorialEdgeRect1 = new Rectangle(mWindowWidth - 710, mWindowHeight -180, 190, 130);

            tutorialRect2 = new Rectangle(mWindowWidth - 450, mWindowHeight / 6, 170, 110);
            tutorialEdgeRect2 = new Rectangle(mWindowWidth - 460, mWindowHeight / 6 - 10, 190, 130);

            tutorialRect3 = new Rectangle(mWindowWidth - 450, mWindowHeight / 2 + 20, 320, 110);
            tutorialEdgeRect3 = new Rectangle(mWindowWidth - 460, mWindowHeight / 2 + 10, 340, 130);

            tutorialRect4 = new Rectangle(mWindowWidth - 210, mWindowHeight / 6 + 10, 170, 110);
            tutorialEdgeRect4 = new Rectangle(mWindowWidth - 220, mWindowHeight / 6, 190, 130);

            tutorialRect5 = new Rectangle(mWindowWidth - 700, mWindowHeight - 130, 170, 110);
            tutorialEdgeRect5 = new Rectangle(mWindowWidth - 710, mWindowHeight - 140, 190, 130);

            tutorialRect6 = new Rectangle(mWindowWidth - 410, mWindowHeight - 180, 170, 110);
            tutorialEdgeRect6 = new Rectangle(mWindowWidth - 420, mWindowHeight - 190, 190, 130);

            Vector2 length = storyStringSpriteFont.MeasureString("E");

            length = storyStringSpriteFont.MeasureString(ContinueButtonString);
            ContinueButtonStringPos.X = ContinueButtonRect.X + ((ContinueButtonRect.Width - length.X) / 2);
            ContinueButtonStringPos.Y = ContinueButtonRect.Y + ((ContinueButtonRect.Height - length.Y) / 2);

            //-------------------------------------------------------------------------

            if (mPlayer1Tutorial.SpawnTutorial == true)
            {
                storyString = "Spawn Tutorial";
            }
            else if (mPlayer1Tutorial.CurrentNode == "Node1")
            {
                storyString = "Level 1 Tutorial";
            }
            else if (mPlayer1Tutorial.CurrentNode == "Node2")
            {
                storyString = "Level 2 Tutorial";
            }
            //storyString = "This is only a placeholder.";
        }