当前位置: 首页>>代码示例>>C#>>正文


C# GameScreen.DrawPos方法代码示例

本文整理汇总了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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:17,代码来源:Lava.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:9,代码来源:Lever.cs

示例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());
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:9,代码来源:TutorialBoss.cs

示例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());
     }
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:9,代码来源:RingBullet.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:9,代码来源:Door.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:14,代码来源:Boulder.cs

示例7: Draw

 public override void Draw(GameScreen screen, Main main)
 {
     main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White, texture.Center());
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:4,代码来源:Turret.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:5,代码来源:LightBulb.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:6,代码来源:FirePillar.cs

示例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());
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:5,代码来源:SilverKey.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:5,代码来源:CannonBall.cs

示例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); 
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:5,代码来源:Switch.cs

示例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);
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:5,代码来源:Sparkle.cs


注:本文中的GameScreen.DrawPos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。