コード例 #1
0
 public override void SetRotation(Component.Rotation rot)
 {
     if (rot.GetHashCode() > 1)
     {
         rot = (Component.Rotation)(rot.GetHashCode() - 2);
     }
     base.SetRotation(rot);
 }
コード例 #2
0
        public override void DrawGhost(int x, int y, MicroWorld.Graphics.Renderer renderer, Component.Rotation rotation)
        {
            if (texture0cw == null)
            {
                return;
            }
            switch (rotation)
            {
            case Component.Rotation.cw0:
                renderer.Draw(texture0cw, new Rectangle(x, y, (int)GetSizeRotated(rotation).X, (int)GetSizeRotated(rotation).Y),
                              new Color(1f, 1f, 1f, 0.5f));
                break;

            case Component.Rotation.cw90:
                renderer.Draw(texture90cw, new Rectangle(x, y, (int)GetSizeRotated(rotation).X, (int)GetSizeRotated(rotation).Y),
                              new Color(1f, 1f, 1f, 0.5f));
                break;

            /*
             * case Component.Rotation.cw180:
             * renderer.Draw(texture180cw, new Rectangle(x, y, (int)GetSizeRotated(rotation).X, (int)GetSizeRotated(rotation).Y),
             *  new Color(1f, 1f, 1f, 0.5f));
             * break;
             * case Component.Rotation.cw270:
             * renderer.Draw(texture270cw, new Rectangle(x, y, (int)GetSizeRotated(rotation).X, (int)GetSizeRotated(rotation).Y),
             *  new Color(1f, 1f, 1f, 0.5f));
             * break;//*/
            default:
                renderer.Draw(texture0cw, new Vector2(x, y) + GetCenter(parent.ComponentRotation), null,
                              new Color(1f, 1f, 1f, 0.5f), rotation.GetHashCode() * (float)Math.PI / 2f,
                              GetCenter(parent.ComponentRotation), 1);
                break;
            }
        }
コード例 #3
0
ファイル: CoreGraphics.cs プロジェクト: XZelnar/MicroWorld
        public override void DrawGhost(int x, int y, MicroWorld.Graphics.Renderer renderer, Component.Rotation rotation)
        {
            if (texture0cw == null)
            {
                return;
            }
            switch (rotation)
            {
            case Component.Rotation.cw0:
                renderer.Draw(texture0cw, new Rectangle(x, y, 64, 64), new Color(1f, 1f, 1f, 0.5f));
                break;

            default:
                renderer.Draw(texture0cw, new Vector2(x, y) + GetCenter(parent.ComponentRotation), null,
                              new Color(1f, 1f, 1f, 0.5f), rotation.GetHashCode() * (float)Math.PI / 2f,
                              GetCenter(parent.ComponentRotation), 1);
                break;
            }
        }