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(); } }
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(); } }