示例#1
0
 public virtual void AddElement(Element element)
 {
     elementPositions.Add(element.Position);
     element.Position = Position + new Vector2(UI.BGOffset, (HasTitleBar ? tbSize : 0) + UI.BGOffset) + element.Position;
     elements.Add(element);
     element.TransferToInterface(ParentInterface);
     if (ParentInterface.BEContains(element))
     {
         element.TransferToFront();
     }
     else
     {
         element.MoveToFront();
     }
     if (closed)
     {
         Close();
     }
 }
示例#2
0
 public void AddElement(Element element, int x, int y)
 {
     elementPositions.Add(new Vector2(x * tileSize.X, y * tileSize.Y));
     element.Position = Position + new Vector2(UI.BGOffset, (HasTitleBar ? tbSize : 0) + UI.BGOffset) + elementPositions.Last();
     element.Size     = tileSize - new Vector2(UI.BGOffset * 2);
     elements.Add(element);
     element.TransferToInterface(ParentInterface);
     if (ParentInterface.BEContains(element))
     {
         element.TransferToFront();
     }
     else
     {
         element.MoveToFront();
     }
     if (closed)
     {
         Close();
     }
 }