Example #1
0
        public AGuiElement Make()
        {
            var text = new GuiText()
            {
                Text       = LocalizationManifest.Get.CurrentLanguage[this.context][this.textKey()].Text(),
                TextColor  = Color.White,
                TextHeight = 12
            };

            text.Position.WrapContent().Then.ParentRelative(0, 0);

            var panel = new GuiPanel()
            {
                Background     = new BackgroundTexture(GalaxyTextures.Get.PanelBackground, 3),
                MaskMouseClick = false
            };

            panel.AddChild(text);
            panel.Position.WrapContent().WithPadding(10, 5);

            return(panel);
        }
Example #2
0
        public ListPanel(int columns, float elementWidth, float elementHeight, float elementSpacing) : base()
        {
            this.Position.WrapContent().WithPadding(this.mPadding);
            this.positionBuilder = new GridPositionBuilder(columns, elementWidth, elementHeight, elementSpacing);

            this.container = new GuiPanel();
            this.container.Position.
            ParentRelative(-1, 1).UseMargins().
            FixedSize(
                columns * elementWidth + (columns - 1) * elementSpacing,
                elementHeight
                ).
            StretchBottomTo(this, -1);

            this.slider = new GuiSlider
            {
                Margins       = new Vector2(5, 0),
                Orientation   = Orientation.Vertical,
                SlideCallback = onSlide
            };
            this.slider.Position.FixedSize(15, 45).RelativeTo(this.container, 1, 1, -1, 1).UseMargins().StretchBottomTo(this.container, -1);
        }