Example #1
0
        public GuiComponent removeComponent(int slot)
        {
            GuiComponent c = Slots[slot];

            Slots[slot] = null;
            return(c);
        }
Example #2
0
        public void addComponent(GuiComponent component, int slot, bool centered = false)
        {
            if (component.isText)
            {
                GameText gt = (GameText)component;
                gt.Draw.CharacterSize = (uint)(500 / Slots.Length);

                if (centered)
                {
                    gt.Draw.Position = new Vector2f(1280 / 2 - gt.Draw.CharacterSize, gt.Draw.Position.Y);
                }

                Slots[slot] = gt;
            }
            else
            {
                Slots[slot] = component;
            }
        }