當前位置: 首頁>>代碼示例>>C#>>正文


C# SpriteBatch.ScalingDraw方法代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.Graphics.SpriteBatch.ScalingDraw方法的典型用法代碼示例。如果您正苦於以下問題:C# SpriteBatch.ScalingDraw方法的具體用法?C# SpriteBatch.ScalingDraw怎麽用?C# SpriteBatch.ScalingDraw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.Xna.Framework.Graphics.SpriteBatch的用法示例。


在下文中一共展示了SpriteBatch.ScalingDraw方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Draw

 public void Draw(SpriteBatch spriteBatch)
 {
     spriteBatch.ScalingDraw(textureBack, new Vector2(drawPosition.X, drawPosition.Y - 20), 1.0f, Color.White);
     DrawNumber(spriteBatch, minutes % 10, drawPosition + new Vector2(34, -4) + new Vector2(29, 0) );
     spriteBatch.ScalingDraw(textureTime, drawPosition + new Vector2(34, -4) + new Vector2(29, 0) + new Vector2(27, 0) + new Vector2(10, 0), 1.0f, new Rectangle(270, 0, 13, 29), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f);
     DrawNumber(spriteBatch, seconds / 10 % 10, drawPosition + new Vector2(34, -4) + new Vector2(29, 0) + new Vector2(27, 0) + new Vector2(10, 0) + new Vector2(13, 0) + new Vector2(10, 0));
     DrawNumber(spriteBatch, seconds % 10, drawPosition + new Vector2(34, -4) + new Vector2(29, 0) + new Vector2(27, 0) * 2 + new Vector2(10, 0) + new Vector2(13, 0) + new Vector2(10, 0));
 }
開發者ID:hirama-akihiro,項目名稱:DropFight,代碼行數:8,代碼來源:Timer.cs

示例2: Draw

        public void Draw(SpriteBatch spriteBatch)
        {
            if (isDead == true) return;

            spriteBatch.ScalingDraw(backTexture, new Vector2(drawPosition.X, drawPosition.Y), 1.0f, Color.White);
            for (int i = 0; i < stock; i++)
            {
                spriteBatch.ScalingDraw(stockTexture, new Vector2(drawPosition.X + i * (stockTexture.Width) + 150, drawPosition.Y + 25), 1.0f, Color.White);
            }
        }
開發者ID:hirama-akihiro,項目名稱:DropFight,代碼行數:10,代碼來源:StockDrawer.cs

示例3: DrawNumber

 /// <summary>
 /// タイムの數字を表示
 /// </summary>
 /// <param name="spriteBatch"></param>
 private void DrawNumber(SpriteBatch spriteBatch, int number, Vector2 position)
 {
     spriteBatch.ScalingDraw(textureTime, position, 1.0f, new Rectangle(27 * number, 0, 27, 29), Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f);
 }
開發者ID:hirama-akihiro,項目名稱:DropFight,代碼行數:8,代碼來源:Timer.cs


注:本文中的Microsoft.Xna.Framework.Graphics.SpriteBatch.ScalingDraw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。