当前位置: 首页>>代码示例>>C#>>正文


C# ProgressBar.GetTextureWidth方法代码示例

本文整理汇总了C#中ProgressBar.GetTextureWidth方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar.GetTextureWidth方法的具体用法?C# ProgressBar.GetTextureWidth怎么用?C# ProgressBar.GetTextureWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgressBar的用法示例。


在下文中一共展示了ProgressBar.GetTextureWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadContent

        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);
            gameOverFont = Game.Content.Load<SpriteFont>(@"GameOver");
            inGameFont = Game.Content.Load<SpriteFont>(@"inGameFont");

            hpBar = new ProgressBar(new Vector2(game.Window.ClientBounds.Width - barFieldWidth + 10, game.Window.ClientBounds.Height - 40), Game.Content.Load<Texture2D>(@"Images/hpBar2"), Game.Content.Load<Texture2D>(@"Images/ProgressBarBackground2"), spriteBatch);
            expBar = new ProgressBar(new Vector2(game.Window.ClientBounds.Width - barFieldWidth +10 + (int)(hpBar.GetTextureWidth()*1.2), game.Window.ClientBounds.Height - 40), Game.Content.Load<Texture2D>(@"Images/expBar"), Game.Content.Load<Texture2D>(@"Images/ProgressBarBackground2"), spriteBatch);
            heatingBar = new ProgressBar(new Vector2(game.Window.ClientBounds.Width - barFieldWidth + 10 + (int)(hpBar.GetTextureWidth() * 1.2) + (int)(expBar.GetTextureWidth() * 1.2), game.Window.ClientBounds.Height - 40), Game.Content.Load<Texture2D>(@"Images/heatingBar"), Game.Content.Load<Texture2D>(@"Images/ProgressBarBackground2"), spriteBatch);

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 5, 7));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb0"),
                   new Point(5, 7), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 20, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 5, 9));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb1"),
                    new Point(5, 9), 10, new Point(0, 0),
                    new Point(1, 1), new Vector2(0, -2), 34, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 5, 12));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb2"),
                   new Point(5, 12), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 50, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 10, 14));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb3"),
                   new Point(10, 14), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 100, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 4, 11));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/freeze0"),
                   new Point(4, 11), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 25, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 10, 14));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/freeze1"),
                   new Point(10, 14), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 125, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 11, 42));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/freeze2"),
                   new Point(11, 42), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 500, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 11,11));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/greenCircle"),
                   new Point(11, 11), 10, new Point(0, 0),
                   new Point(4, 1), new Vector2(0, -2), 100, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0,0,19,27));
            enemyList.Add(new Enemy(Game.Content.Load<Texture2D>(@"Images/enemys/enemy1"),
                new Point(19, 27), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(1.5f,1.5f), 100, 0, 3500, new Vector2(9,27), 30, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 37, 28));
            enemyList.Add(new Enemy(Game.Content.Load<Texture2D>(@"Images/enemys/enemy2"),
                new Point(37, 28), 10, new Point(0, 0),
                new Point(1, 1), new Vector2(1, 1), 200, 4, 4500, new Vector2(19, 27), 60, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 48, 49));
            enemyList.Add(new Enemy(Game.Content.Load<Texture2D>(@"Images/enemys/bumerang0"),
                new Point(48, 49), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(3, 3), 400, 6, -1, new Vector2(24, 27), 90, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 118, 138));
            playerShip = new UserControlledSprite(
                Game.Content.Load<Texture2D>(@"Images/PlayerShipAnim"),
                Vector2.Zero, new Point(118, 138), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(4, 4), rectangleList);

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 58, 58));
            bonusList.Add(new Bonus(
                Game.Content.Load<Texture2D>(@"Images/bonuses/bonusLifeCh"),
//.........这里部分代码省略.........
开发者ID:snarhov,项目名称:SpaceBattles,代码行数:101,代码来源:SpriteManager.cs


注:本文中的ProgressBar.GetTextureWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。