本文整理汇总了C#中Vector2I.ToVector2方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2I.ToVector2方法的具体用法?C# Vector2I.ToVector2怎么用?C# Vector2I.ToVector2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector2I
的用法示例。
在下文中一共展示了Vector2I.ToVector2方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNewTexture
IDrawable GetNewTexture(AutoTile.PartType partType, Vector2I position, float xOffset = 0F, float yOffset = 0F)
{
IDrawable texture = GetNewTexture(partType);
texture.Position = (position.ToVector2() + new SFML.Window.Vector2f(xOffset, yOffset)) * GameData.TILE_SIZE;
return texture;
}
示例2: GetPositionFromCell
public override Vector2f GetPositionFromCell(Vector2I cell)
{
return (cell.ToVector2() + new Vector2f(.5F, .5F)) * CELL_SIZE;
}
示例3: GetPositionFromCellPosition
public static Vector2f GetPositionFromCellPosition(Vector2I cellPosition)
{
return cellPosition.ToVector2() * CombatMap.CELL_SIZE;
}
示例4: GetCenterFromCellPosition
public static Vector2f GetCenterFromCellPosition(Vector2I cellPosition)
{
return (cellPosition.ToVector2() + new Vector2f(.5F, .5F)) * CombatMap.CELL_SIZE;
}
示例5: InitNextMove
bool InitNextMove()
{
if (Moves.Count == 0)
return false;
CurrentGoal = Combatant.CellPosition + Moves.Dequeue();
PointIsReached = false;
if (CurrentGoal == Combatant.CellPosition)
{
PointIsReached = true;
return false;
}
Combatant.State = CombatantState.Moving;
CurrentGoalPoint = (CurrentGoal.ToVector2() + new Vector2f(.5F, .5F)) * CombatMap.CELL_SIZE;
if (CurrentGoal.X < Combatant.CellPosition.X)
CurrentDirection = Direction.O;
else if (CurrentGoal.X > Combatant.CellPosition.X)
CurrentDirection = Direction.E;
else if (CurrentGoal.Y < Combatant.CellPosition.Y)
CurrentDirection = Direction.N;
else if (CurrentGoal.Y > Combatant.CellPosition.Y)
CurrentDirection = Direction.S;
Combatant.Direction = CurrentDirection;
return true;
}
示例6: SetCellPositionTo
public void SetCellPositionTo(Vector2I cellPosition)
{
CellPosition = cellPosition;
SetBasePoint((CellPosition.ToVector2() + new Vector2f(.5F, .5F)) * CombatMap.CELL_SIZE);
}