當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。