예제 #1
0
            public static List <GuiElement> GetNewGuiPanel(
                Plugin plugin,
                string name,
                Rectangle rectangle,
                GuiElement parent,
                Layer layer,
                GuiColor panelColor = null,
                float FadeIn        = 0,
                float FadeOut       = 0,
                GuiText text        = null,
                string imgName      = null,
                Blur blur           = Blur.none)
            {
                List <GuiElement> elements = new List <GuiElement>();

                Layer higherLayer = layer;

                if (parent != null)
                {
                    higherLayer = (Layer)Math.Min((int)layer, (int)parent.Layer);
                }

                if (string.IsNullOrEmpty(imgName))
                {
                    GuiPlainPanel plainPanel = GuiPlainPanel.GetNewGuiPlainPanel(name, rectangle, parent, layer, panelColor, FadeIn, FadeOut, blur);
                    elements.Add(plainPanel);
                }
                else
                {
                    GuiImage image = GuiImage.GetNewGuiImage(plugin, name, rectangle, imgName, false, parent, layer, panelColor, FadeIn, FadeOut);
                    elements.Add(image);
                }
                if (text != null)
                {
                    text.FadeIn = FadeIn;
                    GuiLabel label = new GuiLabel
                    {
                        Name       = name + "_txt",
                        Rectangle  = new Rectangle(),
                        Layer      = higherLayer,
                        Parent     = name,
                        Text       = text,
                        FadeOut    = FadeOut,
                        Components =
                        {
                            text,
                            new Rectangle()
                        }
                    };
                    elements.Add(label);
                }

                return(elements);
            }
예제 #2
0
            public GuiImage addRawImage(string name, Rectangle rectangle, string imgData, GuiElement Parent, Layer layer, GuiColor panelColor = null, float FadeIn = 0, float FadeOut = 0)
            {
                if (string.IsNullOrEmpty(name))
                {
                    name = "image";
                }
                purgeDuplicates(name);

                GuiImage img = GuiImage.GetNewGuiImage(plugin, name, rectangle, imgData, true, Parent, layer, panelColor, FadeIn, FadeOut);

                Add(img);

                return(img);
            }