本文整理汇总了C#中GameObjects.Troop.GetStuntTroopTileAnimationRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Troop.GetStuntTroopTileAnimationRectangle方法的具体用法?C# Troop.GetStuntTroopTileAnimationRectangle怎么用?C# Troop.GetStuntTroopTileAnimationRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Troop
的用法示例。
在下文中一共展示了Troop.GetStuntTroopTileAnimationRectangle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawStoppedTroop
private void DrawStoppedTroop(SpriteBatch spriteBatch, Point viewportSize, Troop troop)
{
Rectangle? nullable;
Color white = Color.White;
if ((this.screen.DrawingSelector && (troop.Status == TroopStatus.一般)) &&
this.screen.Scenario.IsCurrentPlayer(troop.BelongedFaction) && !troop.Operated)
{
Point positionByPoint = this.screen.GetPositionByPoint(this.screen.SelectorStartPosition);
Point point2 = this.screen.GetPositionByPoint(this.screen.MousePosition);
Rectangle r = new Rectangle(
Math.Min(point2.X, positionByPoint.X), Math.Min(point2.Y, positionByPoint.Y),
Math.Abs(point2.X - positionByPoint.X), Math.Abs(point2.Y - positionByPoint.Y));
if (r.Contains(troop.Position))
{
white = Color.Blue;
}
}
if (troop.CurrentOutburstKind == OutburstKind.愤怒)
{
white = Color.Red;
}
else if (troop.CurrentOutburstKind == OutburstKind.沉静)
{
white = Color.Green;
}
spriteBatch.Draw(troop.TroopTexture, this.mainMapLayer.Tiles[troop.Position.X, troop.Position.Y].Destination, new Rectangle?(troop.GetCurrentStopDisplayRectangle(troop.TroopTexture.Width / troop.CurrentAnimation.FrameCount)), white, 0f, Vector2.Zero, SpriteEffects.None, 0.7f);
if (this.screen.SelectorTroops.HasGameObject(troop.ID))
{
nullable = null;
spriteBatch.Draw(this.screen.Textures.TileFrameTextures[4], this.mainMapLayer.Tiles[troop.Position.X, troop.Position.Y].Destination, nullable, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.699f);
}
if (troop.Surrounding)
{
nullable = null;
spriteBatch.Draw(this.screen.Textures.TileFrameTextures[4], this.mainMapLayer.Tiles[troop.Position.X, troop.Position.Y].Destination, nullable, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.699f);
}
if (troop.Status != TroopStatus.一般)
{
spriteBatch.Draw(troop.StatusTileAnimation.Texture, this.mainMapLayer.Tiles[troop.Position.X, troop.Position.Y].Destination, new Rectangle?(troop.GetStatusTroopTileAnimationRectangle(troop.StatusTileAnimation.Texture.Width / troop.StatusTileAnimation.FrameCount)), Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.6998f);
}
if (troop.CurrentStunt != null)
{
spriteBatch.Draw(troop.StuntTileAnimation.Texture, this.mainMapLayer.Tiles[troop.Position.X, troop.Position.Y].Destination, new Rectangle?(troop.GetStuntTroopTileAnimationRectangle(troop.StuntTileAnimation.Texture.Width / troop.StuntTileAnimation.FrameCount)), Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.6998f);
}
if ((this.screen.CurrentTroop == troop) && (this.screen.UndoneWorks.Peek().Kind == UndoneWorkKind.ContextMenu))
{
foreach (Point point3 in troop.OffenceArea.Area)
{
if (this.mainMapLayer.TileInScreen(point3))
{
nullable = null;
spriteBatch.Draw(this.screen.Textures.TileFrameTextures[2], this.mainMapLayer.Tiles[point3.X, point3.Y].Destination, nullable, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.7f);
}
}
}
}