本文整理汇总了C#中GameScreen.DrawPos方法的典型用法代码示例。如果您正苦于以下问题:C# GameScreen.DrawPos方法的具体用法?C# GameScreen.DrawPos怎么用?C# GameScreen.DrawPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameScreen
的用法示例。
在下文中一共展示了GameScreen.DrawPos方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
int offset = (int)Math.Floor(timer);
Vector2 pos = Room.TileToWorldPos(x, y);
Vector2 offsetPos = new Vector2(0f, offset);
Rectangle source = new Rectangle(offset, 0, Tile.tileSize - offset, Tile.tileSize - offset);
main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
offsetPos = new Vector2(0f, 0f);
source = new Rectangle(offset, Tile.tileSize - offset, Tile.tileSize - offset, offset);
main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
offsetPos = new Vector2(Tile.tileSize - offset, offset);
source = new Rectangle(0, 0, offset, Tile.tileSize - offset);
main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
offsetPos = new Vector2(Tile.tileSize - offset, 0f);
source = new Rectangle(0, Tile.tileSize - offset, offset, offset);
main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
}
示例2: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
Texture2D texture;
if (!textures.TryGetValue(direction, out texture))
{
texture = textures[Direction.Left];
}
main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White);
}
示例3: Draw
public override void Draw(GameScreen screen, Main main)
{
Color color = Color.White;
if (IsHurt)
{
color *= 0.75f;
}
main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, color, texture.Center());
}
示例4: Draw
public override void Draw(GameScreen screen, Main main)
{
for (int k = 0; k < numBullets; k++)
{
float angle = rotation + 2f * k / numBullets * (float)Math.PI;
Vector2 pos = center + radius * Helper.AngleToVector2(angle);
main.spriteBatch.Draw(texture, screen.DrawPos(main, pos), null, color, texture.Center());
}
}
示例5: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
Texture2D texture = closedTexture;
if (open)
{
texture = vertical ? openVerticalTexture : openHorizontalTexture;
}
main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White);
}
示例6: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
Vector2 drawPos = screen.DrawPos(main, Room.TileToWorldPos(x, y));
Rectangle frame = new Rectangle(0, 0, Tile.tileSize, Tile.tileSize);
if (right)
{
frame.X = Tile.tileSize;
}
if (bottom)
{
frame.Y = Tile.tileSize;
}
main.spriteBatch.Draw(texture, drawPos, frame, Color.White, Vector2.Zero);
}
示例7: Draw
public override void Draw(GameScreen screen, Main main)
{
main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White, texture.Center());
}
示例8: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
Texture2D texture = light ? onTexture : offTexture;
main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White);
}
示例9: Draw
public override void Draw(GameScreen screen, Main main)
{
Texture2D texture = timeLeft > 0 ? warningTexture : pillarTexture;
Vector2 drawPos = screen.DrawPos(main, Room.TileToWorldPos(x, y));
main.spriteBatch.Draw(texture, drawPos, Color.White);
}
示例10: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(new Vector2(x + 0.5f, y + 0.5f))),
null, Color.White, texture.Center());
}
示例11: Draw
public override void Draw(GameScreen screen, Main main)
{
main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White,
Helper.Vector2ToAngle(velocity), texture.Center(), 1f, SpriteEffects.None, 1f);
}
示例12: Draw
public override void Draw(GameScreen screen, int x, int y, Main main)
{
Texture2D text = pressed ? texturePressed : texture;
main.spriteBatch.Draw(text, screen.DrawPos(main, Room.TileToWorldPos(x, y) + new Vector2(10f)), null, Color.White);
}
示例13: Draw
public override void Draw(GameScreen screen, Main main)
{
main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, color, rotation, texture.Center(),
scale, SpriteEffects.None, 0f);
}