Ejemplo n.º 1
0
        public static void Render(SpriteBatch spriteBatch, Placement placement)
        {
            Rectangle destination = new Rectangle(
                (int)(placement.X - center.X),
                (int)(placement.Y - center.Y),
                texture.Width,
                texture.Height
            );

            spriteBatch.Draw(texture,
                destination,
                null,
                Color.White,
                placement.RotationAsRadians,
                center,
                SpriteEffects.None,
                0
            );

            if (SpatialHelpers.IsReflected(ref destination, center, spriteBatch.GraphicsDevice.Viewport)) {
                spriteBatch.Draw(texture,
                    destination,
                    null,
                    Color.White,
                    placement.RotationAsRadians,
                    center,
                    SpriteEffects.None,
                    0
                );
            }
        }
Ejemplo n.º 2
0
 public float DistanceTo(Placement placement)
 {
     return Artemis.Utils.Distance(placement.X, placement.Y, X, Y);
 }