public Line(Vector startPoint, Vector endPoint, Color color) { StartPoint = startPoint; EndPoint = endPoint; this.color = color; Le_Engine.RegisterLine(this); }
public Line(double StartX, double StartY, double EndX, double EndY, Color color) { StartPoint = new Vector(StartX, StartY); EndPoint = new Vector(EndX, EndY); this.color = color; Le_Engine.RegisterLine(this); }
public Shape(Vector Position, Vector Scale, string Tag, Le_Engine.Type type) { components = new Components(); this.Position = Position; this.Scale = Scale; this.Tag = Tag; this.type = type; Z = 0; Le_Engine.RegisterShape(this); }
private void listBox2_SelectedIndexChanged(object sender, EventArgs e) { if (listBox2.SelectedItem != null) { string item = listBox2.SelectedItem.ToString(); int id = Convert.ToInt32(item.Substring(item.IndexOf('(')).Replace("(", "").Replace(")", "")); selectedshape = Le_Engine.GetShapeById(id); ConsoleLog("Shape " + selectedshape.Tag + "Selected"); PopulateProperties(selectedshape); } }
public bool IsAreaColidedWithTag(string Tag, Vector Position, Vector Scale) { List <Shape> p = Le_Engine.GetShapes(Tag); foreach (Shape s in p) { if (s.Position.Y + s.Scale.Y > Position.Y && Position.Y + Scale.Y > s.Position.Y && s.Position.X + s.Scale.X > Position.X && Position.X + Scale.X > s.Position.X) { GetColidedObject = s; return(true); } } return(false); }
public bool IsColided(IColision Entity, string tag) { List <Shape> p = Le_Engine.GetShapes(tag); foreach (Shape s in p) { if (s.Position.Y + s.Scale.Y > Entity.Position.Y && Entity.Position.Y + Entity.Scale.Y > s.Position.Y && s.Position.X + s.Scale.X > Entity.Position.X && Entity.Position.X + Entity.Scale.X > s.Position.X) { GetColidedObject = s; return(true); } } return(false); }
public static Shape GetClosestShape(Vector Position, string Tag) { List <Shape> shapes = Le_Engine.GetShapes(Tag); if (shapes.Count == 0) { return(null); } Shape CurrentClosest = shapes[0]; foreach (Shape item in shapes) { if (GetDistance(item.Position, Position) < GetDistance(CurrentClosest.Position, Position)) { CurrentClosest = item; } } return(CurrentClosest); }
public void CreateSelf() { Le_Engine.RegisterShape(this); }
public void DestroySelf() { Le_Engine.UnRegisterShape(this); }