public override void SetRotation(Component.Rotation rot) { if (rot.GetHashCode() > 1) { rot = (Component.Rotation)(rot.GetHashCode() - 2); } base.SetRotation(rot); }
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; } }
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; } }