Esempio n. 1
0
        public static HUDElementList CreateAutoSizeVerticalList(string name, float spacing, params SceneUIElement[] items)
        {
            HUDElementList items_list = new HUDElementList()
            {
                Width     = 0, Height = 0,
                Direction = HUDElementList.ListDirection.Vertical,
                SizeMode  = HUDElementList.SizeModes.AutoSizeToFit,
                Spacing   = spacing
            };

            foreach (var item in items)
            {
                items_list.AddListItem(item);
            }
            items_list.Create();
            items_list.Name = name;
            return(items_list);
        }
Esempio n. 2
0
        HUDElementList make_horz_labeled_param(string textLabel, HUDStandardItem item)
        {
            HUDElementList container = new HUDElementList()
            {
                Direction = ListDirection.Horizontal,
                Width     = this.Width,
                Height    = this.RowHeight,
                Spacing   = this.Padding
            };
            HUDLabel label = new HUDLabel()
            {
                Shape      = new HUDShape(HUDShapeType.Rectangle, HorzParamLabelWidth, LabelTextHeight),
                TextHeight = LabelTextHeight,
                Text       = textLabel
            };

            label.Create();
            container.AddListItem(label);
            container.AddListItem(item);
            container.Create();
            return(container);
        }