本文整理汇总了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);
}