コード例 #1
0
        //가장 단순한 형태의 메뉴 생성자. 메뉴 이름&메뉴 위치&메뉴 두께만 설정하면 됨.
        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");
            }
        }
コード例 #2
0
 public void AddVector(Point p)
 {
     for (int i = 0; i < MenuList.Count; i++)
     {
         MenuList[i].Vector = Method2D.Add(MenuList[i].Vector, p);
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 //메뉴 간격을 조정할 수 있는 생성자.
 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");
     }
 }
コード例 #5
0
 public void AttachTo(Point p)
 {
     drawingLayer.SetPos(Method2D.Add(p, Vector));
 }
コード例 #6
0
 public void AttachTo(DrawingLayer d)
 {
     drawingLayer.SetPos(Method2D.Add(d.GetBound().Location, Vector));
 }