public void RightClick(ScreenDrawingSurface surface, System.Drawing.Point location) { Click(surface, location); ContextMenuStrip menu = new ContextMenuStrip(); if (heldEntity != null) { var deleteMenu = new ToolStripMenuItem( String.Format("Delete {0}", heldEntity.entity), Properties.Resources.Remove, (s, e) => { surface.Screen.RemoveEntity(heldEntity); surface.ReDrawEntities(); } ); menu.Items.Add(deleteMenu); menu.Items.Add(new ToolStripSeparator()); } var testMenu = new ToolStripMenuItem( "Test From Here", Properties.Resources.protoman, (s, e) => { MainForm.Instance.RunTestFromStage(surface.Screen, location); } ); menu.Items.Add(testMenu); menu.Show(surface, location); }
public void Click(ScreenDrawingSurface surface, Point location) { var info = surface.Screen.AddEntity(entity, location); var action = new AddEntityAction(info, surface); surface.EditedWithAction(action); surface.ReDrawEntities(); }
public void Click(ScreenDrawingSurface surface, Point location) { var info = surface.Screen.AddEntity(entity, location); var action = new AddEntityAction(info, surface); surface.EditedWithAction(action); surface.ReDrawEntities(); }
public void Move(ScreenDrawingSurface surface, System.Drawing.Point location) { if (heldEntity != null) { heldEntity.screenX = location.X - entityAnchor.X; heldEntity.screenY = location.Y - entityAnchor.Y; surface.ReDrawEntities(); } }
public void Click(ScreenDrawingSurface surface, Point location) { int px = (location.X / surface.Screen.Tileset.TileSize) * surface.Screen.Tileset.TileSize + 4; int py = (location.Y / surface.Screen.Tileset.TileSize) * surface.Screen.Tileset.TileSize + 4; surface.Screen.Stage.StartScreen = surface.Screen.Name; surface.Screen.Stage.StartPoint = new Point(px, py); surface.ReDrawEntities(); }
public void Click(ScreenDrawingSurface surface, Point location) { int px = (location.X / surface.Screen.Tileset.TileSize) * surface.Screen.Tileset.TileSize + 4; int py = (location.Y / surface.Screen.Tileset.TileSize) * surface.Screen.Tileset.TileSize + 4; surface.Screen.Stage.StartScreen = surface.Screen.Name; surface.Screen.Stage.StartPoint = new Point(px, py); surface.ReDrawEntities(); }
public void Move(ScreenDrawingSurface surface, System.Drawing.Point location) { if (heldEntity != null) { heldEntity.screenX = location.X - entityAnchor.X; heldEntity.screenY = location.Y - entityAnchor.Y; surface.ReDrawEntities(); } }
public void Click(ScreenDrawingSurface surface, System.Drawing.Point location) { // select nearest entity var index = surface.Screen.FindEntityAt(location); surface.Screen.SelectEntity(index); surface.ReDrawEntities(); heldEntity = surface.Screen.GetEntity(index); if (heldEntity != null) { entityAnchor = new Point(location.X - (int)heldEntity.screenX, location.Y - (int)heldEntity.screenY); } else { entityAnchor = Point.Empty; } }
public void Click(ScreenDrawingSurface surface, System.Drawing.Point location) { // select nearest entity var index = surface.Screen.FindEntityAt(location); surface.Screen.SelectEntity(index); surface.ReDrawEntities(); heldEntity = surface.Screen.GetEntity(index); if (heldEntity != null) { entityAnchor = new Point(location.X - (int)heldEntity.screenX, location.Y - (int)heldEntity.screenY); } else { entityAnchor = Point.Empty; } }
public void RightClick(ScreenDrawingSurface surface, System.Drawing.Point location) { Click(surface, location); ContextMenuStrip menu = new ContextMenuStrip(); if (heldEntity != null) { var deleteMenu = new ToolStripMenuItem( String.Format("Delete {0}", heldEntity.entity), Properties.Resources.Remove, (s, e) => { surface.Screen.RemoveEntity(heldEntity); surface.ReDrawEntities(); } ); menu.Items.Add(deleteMenu); menu.Items.Add(new ToolStripSeparator()); } var testMenu = new ToolStripMenuItem( "Test From Here", Properties.Resources.protoman, (s, e) => { MainForm.Instance.RunTestFromStage(surface.Screen, location); } ); menu.Items.Add(testMenu); menu.Show(surface, location); }
public void Run() { surface.Screen.AddEntity(entity); surface.ReDrawEntities(); }