本文整理匯總了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));
}
示例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);
}
}
示例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);
}