public Outline(Point center) { var sideLength = 50; center.Offset(-sideLength / 2, -sideLength/2); nodes.Add(PanAndZoom.fromLocalToGlobal(center)); center.Offset(0, sideLength); nodes.Add(PanAndZoom.fromLocalToGlobal(center)); center.Offset(sideLength, 0); nodes.Add(PanAndZoom.fromLocalToGlobal(center)); center.Offset(0, -sideLength); nodes.Add(PanAndZoom.fromLocalToGlobal(center)); //parent.Controls.Add(this); //BringToFront(); foreach(var n in nodes){ var marker = new VertexMarker(); marker.setPosition(n); marker.MouseClick += new MouseEventHandler(deleteMarker); markers.Add(marker); marker.BringToFront(); var c = new CreaterMarker(); c.MouseClick += new MouseEventHandler(createMarker); //parent.Controls.Add(c); creaters.Add(c); } paintEvent = new PaintEventHandler(paint); }
public Icon(Point p,int i,IconType t,int prio=1) { position = new VertexMarker(); position.Colour = Brushes.Green; position.setPosition(p); propertypanel = new IconProperty(this); type = t; Name = string.Format("Start Position {0}", i); setSelected(false); priority = prio; }
public Zone(Editor e, Point p, int index) { editor = e; attachPoint = new VertexMarker(); attachPoint.setPosition(PanAndZoom.fromLocalToGlobal(p)); attachPoint.Colour = System.Drawing.Brushes.Green; outline = new Outline(p); propertypanel = new ZoneProperty(this); possession = Possession.Neutral; Name = string.Format("Zone {0}", index); setSelected(false); }
public Zone(Editor e,Area a) { //name = a.Name; editor = e; area = a; attachPoint = new VertexMarker(); attachPoint.setPosition(Geometry.Geometry.convertPoint(a.AttachmentPoint)); attachPoint.Colour = System.Drawing.Brushes.Green; outline = new Outline(Geometry.Geometry.getOutline(a.Content)); propertypanel = new ZoneProperty(this); possession = Possession.Neutral; Name = string.Format("Zone {0}", a.Id); setSelected(false); }
public Spawn(Point p,float rot,float scale,int i,SpawnType t) { //if (scale == null) scale = 1; propertypanel = new SpawnProperty(this); type = t; head = new VertexMarker(); head.Colour = Brushes.Yellow; head.setPosition(p); source = new VertexMarker(); source.Colour = Brushes.Yellow; p.Offset(-(int)(scale * arrowLength * Math.Cos(rot) / Geometry.Geometry.scaleFactor), -(int)(scale * arrowLength * Math.Sin(rot) / Geometry.Geometry.scaleFactor)); source.setPosition(p); Name = string.Format("Spawn {0}", i); setSelected(false); }
public Outline(List<Point> nodes) { this.nodes = nodes; foreach (var n in nodes) { var marker = new VertexMarker(); marker.setPosition(n); marker.MouseClick += new MouseEventHandler(deleteMarker); markers.Add(marker); marker.BringToFront(); var c = new CreaterMarker(); c.MouseClick += new MouseEventHandler(createMarker); //parent.Controls.Add(c); creaters.Add(c); } paintEvent = new PaintEventHandler(paint); }
public void createMarker(object obj, MouseEventArgs e) { if (e.Button != MouseButtons.Left) return; var creater = (CreaterMarker)obj; var marker = new VertexMarker(); marker.setPosition(creater.getPosition()); marker.MouseClick += new MouseEventHandler(deleteMarker); markers.Insert(creaters.IndexOf(creater)+1,marker); parent.Controls.Add(marker); marker.BringToFront(); var c = new CreaterMarker(); c.MouseClick += new MouseEventHandler(createMarker); parent.Controls.Add(c); creaters.Insert(creaters.IndexOf(creater)+1, c); parent.Invalidate(); }