Exemplo n.º 1
0
 public void GenerateHitbox()
 {
     if (columns == 1)
     {
         Vector2 centralPoint = new Vector2(buttonSize.X * columns * leftSide / 2, (buttonSize.Y * texts.Count / columns) / 2);
         MakeHitbox(centralPoint, HitboxShape.Rectangle, new Vector3(buttonSize.X * columns, buttonSize.Y * texts.Count / columns, 0));
     }
     else
     {
         List <Hitbox> hitboxList = new List <Hitbox>();
         foreach (ContextMenuItem item in menuItems)
         {
             hitboxList.Add(item.hitbox);
         }
         hitbox = new MultipleHitbox(hitboxList, this);
     }
 }
Exemplo n.º 2
0
 public void GenerateScrollHitbox()
 {
     if (scrollBar == null)
     {
         hitbox = new MultipleHitbox(new List <Hitbox>()
         {
             hitbox, upArrow.hitbox, downArrow.hitbox
         }, this);
     }
     else
     {
         hitbox = new MultipleHitbox(new List <Hitbox>()
         {
             hitbox, upArrow.hitbox, downArrow.hitbox, scrollBarBackground.MakeHitbox(), scrollBar.hitbox
         }, this);
     }
 }