Ejemplo n.º 1
0
        public void BakeRotation()
        {
            PointF[] array = new PointF[1]
            {
                PointF.Empty
            };
            TmxMath.RotatePoints(array, this);
            float x = Position.X - array[0].X;
            float y = Position.Y - array[0].Y;

            Position = new PointF(x, y);
            Position = TmxMath.Sanitize(Position);
            Rotation = 0f;
        }
Ejemplo n.º 2
0
        public void BakeRotation()
        {
            // Rotate (0, 0)
            PointF[] pointfs = new PointF[1] {
                PointF.Empty
            };
            TmxMath.RotatePoints(pointfs, this);

            // Bake that rotation into our position, sanitizing the result
            float x = this.Position.X - pointfs[0].X;
            float y = this.Position.Y - pointfs[0].Y;

            this.Position = new PointF(x, y);
            this.Position = TmxMath.Sanitize(this.Position);

            // Null out our rotation
            this.Rotation = 0;
        }