示例#1
0
 public void AddGuiItem(GuiItem item)
 {
     Container.Add(item);
 }
示例#2
0
        public Surface RenderItem(GuiItem Item)
        {
            Surface buffer = new Surface(0,0);

            if (Item is LabelItem)
            {
                LabelItem Label = (LabelItem)Item;

                buffer = Label.Render();

            }
            else if (Item is ButtonItem)
            {
                ButtonItem Button = (ButtonItem)Item;

                if ((MousePos.X >= Button.X && MousePos.X <= Button.X + Button.Width) && (MousePos.Y >= Button.Y && MousePos.Y <= Button.Y + Button.Height))
                {
                    buffer = Button.RenderHighlight();
                }
                else
                {
                    buffer = Button.Render();
                }
            }
            else if (Item is MenuItem)
            {
                MenuItem Menu = (MenuItem)Item;

                if ((MousePos.X >= Menu.X && MousePos.X <= Menu.X + Menu.Width) && (MousePos.Y >= Menu.Y && MousePos.Y <= Menu.Y + Menu.Height))
                {
                    buffer = Menu.RenderHighlight();
                }
                else
                {
                    buffer = Menu.Render();
                }

            }
            else if (Item is PictureItem)
            {
                PictureItem Picture = (PictureItem)Item;

                buffer = Picture.Render();
            }
            else if (Item is BackgroundItem)
            {
                BackgroundItem Background = (BackgroundItem)Item;

                buffer = Background.Render();
            }
            else if (Item is WindowBar)
            {
                WindowBar Bar = (WindowBar)Item;

                if (Bar.GetCloseButtonRect().Contains(new Point(MousePos.X, MousePos.Y)))
                {
                    buffer = Bar.RenderHighlight();
                }
                else
                {
                    buffer = Bar.Render();
                }

            }
            else if (Item is Grid)
            {
                Grid g = (Grid)Item;
                buffer = g.Render();
            }
            else if (Item is DialogBox)
            {
                DialogBox box = (DialogBox)Item;

                if (box.GetButtonOkRect().Contains(new Point(MousePos.X, MousePos.Y)))
                {
                    buffer = box.RenderHighlight();
                }
                else
                {
                    buffer = box.Render();
                }
            }
            else if (Item is ContextMenu)
            {
                ContextMenu Menu = (ContextMenu)Item;

                buffer = Menu.Render();
            }
            else if (Item is TextInputDialogBox)
            {
                TextInputDialogBox box = (TextInputDialogBox)Item;

                if (box.GetButtonOkRect().Contains(new Point(MousePos.X, MousePos.Y)))
                {
                    buffer = box.RenderHighlight();
                }
                else
                {
                    buffer = box.Render();
                }
            }
            else
            {
                buffer = CustomItemRender(Item);
            }

            return buffer;
        }
        public override Surface CustomItemRender(GuiItem Item)
        {
            Surface Buffer;

            if (Item is MapEditRenderer)
            {
                MapEditRenderer MapRender = (MapEditRenderer)Item;

                Buffer = MapRender.Render();
            }
            else
            {
                Buffer = Item.Render();
            }

            return Buffer;
        }
示例#4
0
        public virtual Surface CustomItemRender(GuiItem Item)
        {
            Surface buffer = new Surface(Item.Width, Item.Height);
            buffer.Fill(Color.Aqua);

            return buffer;
        }
示例#5
0
        public override Surface CustomItemRender(GuiItem Item)
        {
            Surface Buffer;

            Buffer = Item.Render();

            return Buffer;
        }