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


C# Vector2I.ToVector2方法代码示例

本文整理汇总了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;
 }
开发者ID:jpx,项目名称:blazera,代码行数:6,代码来源:AutoTile.cs

示例2: GetPositionFromCell

 public override Vector2f GetPositionFromCell(Vector2I cell)
 {
     return (cell.ToVector2() + new Vector2f(.5F, .5F)) * CELL_SIZE;
 }
开发者ID:jpx,项目名称:blazera,代码行数:4,代码来源:CombatMap.cs

示例3: GetPositionFromCellPosition

 public static Vector2f GetPositionFromCellPosition(Vector2I cellPosition)
 {
     return cellPosition.ToVector2() * CombatMap.CELL_SIZE;
 }
开发者ID:eickegao,项目名称:Blazera,代码行数:4,代码来源:CombatCell.cs

示例4: GetCenterFromCellPosition

 public static Vector2f GetCenterFromCellPosition(Vector2I cellPosition)
 {
     return (cellPosition.ToVector2() + new Vector2f(.5F, .5F)) * CombatMap.CELL_SIZE;
 }
开发者ID:eickegao,项目名称:Blazera,代码行数:4,代码来源:CombatCell.cs

示例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;
            }
开发者ID:eickegao,项目名称:Blazera,代码行数:32,代码来源:BaseCombatant.cs

示例6: SetCellPositionTo

        public void SetCellPositionTo(Vector2I cellPosition)
        {
            CellPosition = cellPosition;

            SetBasePoint((CellPosition.ToVector2() + new Vector2f(.5F, .5F)) * CombatMap.CELL_SIZE);
        }
开发者ID:eickegao,项目名称:Blazera,代码行数:6,代码来源:BaseCombatant.cs


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