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


C# Polygon.AttachTo方法代码示例

本文整理汇总了C#中Polygon.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# Polygon.AttachTo方法的具体用法?C# Polygon.AttachTo怎么用?C# Polygon.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Polygon的用法示例。


在下文中一共展示了Polygon.AttachTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePolygonForPolygon

        private void CreatePolygonForPolygon(Polygon polygon)
        {

            Polygon newPoly = new Polygon();

            Vector3 pos = polygon.Position;

            newPoly.Position = pos;

            mHighlightShapes.Add(newPoly);

            newPoly.AttachTo(polygon, true);

            newPoly.RelativeRotationZ = 0;

            newPoly.Points = polygon.Points;

            const int pixelsOut = 2;

            GrowPolygonByPixels(pixelsOut, polygon.Z, newPoly);
            InitializeNewPoly(newPoly);

        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:23,代码来源:Highlight.cs

示例2: SetCollision

        public void SetCollision(Polygon polygon)
        {
            mCollisionCircle = null;
            mCollisionAxisAlignedRectangle = null;
            mCollisionLine = null;

            mCollisionPolygon = polygon;

            mCollisionPolygon.AttachTo(this, false);
            mCollisionPolygon.ForceUpdateDependencies();
        }
开发者ID:GorillaOne,项目名称:FlatRedBall,代码行数:11,代码来源:Sprite.cs

示例3: createCollision

 private void createCollision()
 {
     // The polygon will be visible by default, so this will serve as both our visible representation
     // as well as collision.
     pCollision = ShapeManager.AddPolygon();
     Point[] polygonPoints = new Point[4];
     polygonPoints[0] = new Point(11, 0);
     polygonPoints[1] = new Point(-11, -8);
     polygonPoints[2] = new Point(-11, 8);
     polygonPoints[3] = polygonPoints[0];
     pCollision.Points = polygonPoints;
     // Finally attach the collision to this: That makes it eaasier to access all its properties.
     pCollision.AttachTo(this, false);
 }
开发者ID:BuffaloBuffalo,项目名称:FlatRedBall-Projects,代码行数:14,代码来源:PlayerShip.cs


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