//가장 단순한 형태의 메뉴 생성자. 메뉴 이름&메뉴 위치&메뉴 두께만 설정하면 됨. public EasyMenu(Point position, int Width, params string[] strings) { int MenuCount = strings.Length; int MenuHeight = 50; Point FirstMenuVector = new Point(20, 20); Point MenuInterval = new Point(0, 20); Rectangle FrameRectangle = new Rectangle(position, new Point(Width + FirstMenuVector.X, FirstMenuVector.Y + (MenuInterval.Y + MenuHeight) * MenuCount)); Rectangle MenuRectangle = new Rectangle(0, 0, Width, MenuHeight); SetFrame(new DrawingLayer("EmptySpace", FrameRectangle)); for (int i = 0; i < strings.Length; i++) { if (i == 0) { AddMenu(new DrawingLayer("EmptySpace", MenuRectangle), FirstMenuVector, strings[i]); } else { AddMenu(new DrawingLayer("EmptySpace", MenuRectangle), Method2D.Add(MenuInterval, new Point(0, MenuRectangle.Height)), strings[i]); } } if (Theme == EasyMenuTheme.MonoVirus) { SetSprite("WhiteSpace", "Light"); } }
public void AddVector(Point p) { for (int i = 0; i < MenuList.Count; i++) { MenuList[i].Vector = Method2D.Add(MenuList[i].Vector, p); } }
public void MoveByVector(Point Vector, double speed) { double N = Method2D.Distance(new Point(0, 0), Vector); int Dis_X = (int)(Vector.X * speed / N); int Dis_Y = (int)(Vector.Y * speed / N); MoveTo(Bound.X + Dis_X, Bound.Y + Dis_Y); }
//메뉴 간격을 조정할 수 있는 생성자. public EasyMenu(Rectangle FrameRectangle, Rectangle MenuRectangle, Point FirstMenuVector, Point MenuInterval, string[] strings) { SetFrame(new DrawingLayer("EmptySpace", FrameRectangle)); for (int i = 0; i < strings.Length; i++) { if (i == 0) { AddMenu(new DrawingLayer("EmptySpace", MenuRectangle), FirstMenuVector, strings[i]); } else { AddMenu(new DrawingLayer("EmptySpace", MenuRectangle), Method2D.Add(MenuInterval, new Point(0, MenuRectangle.Height)), strings[i]); } } if (Theme == EasyMenuTheme.MonoVirus) { SetSprite("WhiteSpace", "Light"); } }
public void AttachTo(Point p) { drawingLayer.SetPos(Method2D.Add(p, Vector)); }
public void AttachTo(DrawingLayer d) { drawingLayer.SetPos(Method2D.Add(d.GetBound().Location, Vector)); }