示例#1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);

            blackPixel = new Texture2D(Game.GraphicsDevice, 1, 1);
            blackPixel.SetData(new[] { Color.Black });

            mainMenu = new Sprite(Game.Content.Load<Texture2D>(@"Images/UI/Main Menu"),
                new Vector2(960, 540), new Point(1920, 1080), new Point(0,0),
                new Point(1, 2), 0.0f, 1f);
            playNowButton = new Button(Game.Content.Load<Texture2D>(@"Images/UI/Playnow"),
                new Vector2(960, 800), new Point(1147, 411), new Point(0, 0),
                new Point(2, 4), 0.0f, 1f);
        }
示例#2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);

            blackPixel = new Texture2D(Game.GraphicsDevice, 1, 1);
            blackPixel.SetData(new[] { Color.Black });

            Texture2D number_texture = Game.Content.Load<Texture2D>(@"Images/UI/numberz");
            Texture2D exitButton_texture = Game.Content.Load<Texture2D>(@"Images/UI/exitbutton");
            Texture2D statsButton_texture = Game.Content.Load<Texture2D>(@"Images/UI/statsbutton");
            Texture2D resumeButton_texture = Game.Content.Load<Texture2D>(@"Images/UI/resumebutton");

            mainMenu = new Sprite(Game.Content.Load<Texture2D>(@"Images/UI/Main Menu"),
                new Vector2(960, 540), new Point(1920, 1080), new Point(0,0),
                new Point(2, 3), 0.0f, 1f);
            playNowButton = new Button(Game.Content.Load<Texture2D>(@"Images/UI/Playnow"),
                new Vector2(960, 800), new Point(1147, 411), new Point(0, 0),
                new Point(2, 4), 0.0f, 1f);
            addStrButton = new Button(Game.Content.Load<Texture2D>(@"Images/UI/addLvl"),
                new Vector2(1220, 360), new Point(146, 106), new Point(0, 0),
                new Point(1, 3), 0.0f, 1f);
            addAgiButton = new Button(Game.Content.Load<Texture2D>(@"Images/UI/addLvl"),
                new Vector2(1220, 530), new Point(146, 106), new Point(0, 0),
                new Point(1, 3), 0.0f, 1f);
            addVitButton = new Button(Game.Content.Load<Texture2D>(@"Images/UI/addLvl"),
                new Vector2(1220, 700), new Point(146, 106), new Point(0, 0),
                new Point(1, 3), 0.0f, 1f);
            exitButton = new Button(exitButton_texture, new Vector2(1000, 900), new Point(exitButton_texture.Width / 2 -1, exitButton_texture.Height),
                new Point(0, 0), new Point(1, 2), 0.0f, 1f);
            resumeButton = new Button(resumeButton_texture, new Vector2(1000, 360), new Point(resumeButton_texture.Width / 2 -1, resumeButton_texture.Height),
                new Point(0, 0), new Point(1, 2), 0.0f, 1f);
            statsButton = new Button(statsButton_texture, new Vector2(1000, 630), new Point(statsButton_texture.Width / 2 -1, statsButton_texture.Height),
                new Point(0, 0), new Point(1, 2), 0.0f, 1f);

            statSpriteUnit = new Sprite(number_texture, new Vector2(1200, 890), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            statSpriteDecimal = new Sprite(number_texture, new Vector2(1150, 890), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            strSpriteUnit = new Sprite(number_texture, new Vector2(1000, 360), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            strSpriteDecimal = new Sprite(number_texture, new Vector2(950, 360), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            vitSpriteUnit = new Sprite(number_texture, new Vector2(1000, 700), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            vitSpriteDecimal = new Sprite(number_texture, new Vector2(950, 700), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            agiSpriteUnit = new Sprite(number_texture, new Vector2(1000, 530), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
            agiSpriteDecimal = new Sprite(number_texture, new Vector2(950, 530), new Point(number_texture.Width / 10, number_texture.Height),
                new Point(0, 0), new Point(10, 1), 0.0f, 1f);
        }