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


C# SpriteBatch.DrawSprite方法代码示例

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


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

示例1: DrawNumberString

 public void DrawNumberString(SpriteBatch batch, string numbers, Vector2 pos)
 {
     foreach (char c in numbers)
     {
         batch.DrawSprite(pointsSheet, pos, 0, (int)Char.GetNumericValue(c), 0);
         pos += new Vector2(16, 0);
     }
 }
开发者ID:shiroto,项目名称:Devil-s-Armageddon-Pacamari-of-Death-Heavy-Metal-Edition,代码行数:8,代码来源:HUD.cs

示例2: DrawEntities

        private void DrawEntities(SpriteBatch batch)
        {
            batch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, cam.TranslateMapAndEntities());
            factory.DrawEnteties(batch);

            if (currentState == GAMEPLAYSTATES.START)
                batch.DrawSprite(pacman.PacmanAnimation, new Vector2(50 * 16 + 8, 50 * 16 + 8) - cam.Position, 0, 0, 0);

            batch.End();
        }
开发者ID:shiroto,项目名称:Devil-s-Armageddon-Pacamari-of-Death-Heavy-Metal-Edition,代码行数:10,代码来源:GamePlayState.cs

示例3: DrawSelect

        private void DrawSelect(SpriteBatch batch, StateBasedGame container)
        {
            Vector2 titelpos = new Vector2(15, 13);

            batch.Begin();
            batch.Draw(background, Vector2.Zero, Color.White);
            batch.Draw(title_devil, titelpos, Color.White);
            batch.Draw(title_arma, titelpos, Color.White);
            batch.Draw(title_pacamari, titelpos, Color.White);
            batch.Draw(title_of, titelpos, Color.White);
            batch.Draw(title_death, titelpos, Color.White);
            batch.Draw(title_hme, new Vector2(99, 271), Color.White);

            batch.Draw(menu_start, new Vector2(551, 259), Color.White);
            if(container.Graphics.IsFullScreen)
                batch.Draw(menu_windowed, new Vector2(552, 306), Color.White);
            else
            batch.Draw(menu_fullscreen, new Vector2(552, 306), Color.White);

            batch.Draw(menu_end, new Vector2(553, 352), Color.White);

            batch.End();

            batch.Begin(SpriteSortMode.Texture, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Matrix.CreateScale(2));
            if(pacmanState)
                batch.DrawSprite(Player.Get().PacmanAnimation, new Vector2(264, 140 + (23 * menuSelection)), 0, 0, 0);
            else
                batch.DrawSprite(Player.Get().PacmanAnimation, new Vector2(264, 140 + (23 * menuSelection)), 0, 1, 0);

            batch.End();

            DrawHigscore(batch);

            DrawFlash(batch);
        }
开发者ID:shiroto,项目名称:Devil-s-Armageddon-Pacamari-of-Death-Heavy-Metal-Edition,代码行数:35,代码来源:MenuState.cs

示例4: Draw

 public override void Draw(SpriteBatch batch)
 {
     batch.DrawSprite(SpriteReference, Position - Camera.Get().Position, 0, SheetTile.X, SheetTile.Y);
 }
开发者ID:shiroto,项目名称:Devil-s-Armageddon-Pacamari-of-Death-Heavy-Metal-Edition,代码行数:4,代码来源:StaticEntity.cs


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