public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); m_slidingWindowOffset = 0f; m_carriagePositionIndex = 0; }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); var ob = (MyObjectBuilder_GuiControlCompositePanel)objectBuilder; InnerHeight = ob.InnerHeight; }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); var ob = (MyObjectBuilder_GuiControlRadioButton)builder; Key = ob.Key; VisualStyle = ob.VisualStyle; }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); var controlBuilder = (MyObjectBuilder_GuiControlCheckbox)objectBuilder; m_isChecked = controlBuilder.IsChecked; VisualStyle = controlBuilder.VisualStyle; }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); MyObjectBuilder_GuiControlListbox listboxOb = (MyObjectBuilder_GuiControlListbox)objectBuilder; VisibleRowsCount = listboxOb.VisibleRows; VisualStyle = listboxOb.VisualStyle; }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_GuiControlList; MyDebug.AssertDebug(ob != null); VisualStyle = ob.VisualStyle; }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); var ob = objectBuilder as MyObjectBuilder_GuiControlProgressBar; Debug.Assert(ob != null); MyGuiControlBase.ReadIfHasValue(ref ProgressColor, ob.ProgressColor); }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); MyObjectBuilder_GuiControlGrid gridOb = (MyObjectBuilder_GuiControlGrid)objectBuilder; VisualStyle = gridOb.VisualStyle; RowsCount = gridOb.DisplayRowsCount; ColumnsCount = gridOb.DisplayColumnsCount; }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); var ob = (MyObjectBuilder_GuiControlTabControl)builder; RecreatePages(); HideTabs(); SelectedPage = 0; }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_GuiControlTabPage; MyDebug.AssertDebug(ob != null); m_pageKey = ob.PageKey; TextEnum = MyStringId.GetOrCompute(ob.TextEnum); TextScale = ob.TextScale; }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); MyDebug.AssertDebug(builder is MyObjectBuilder_GuiControlParent); var ob = builder as MyObjectBuilder_GuiControlParent; if (ob.Controls != null) { m_controls.Init(ob.Controls); } }
//public MyGuiControlLabel( // Vector2? position = null, // Vector2? size = null, // StringBuilder text = null, // Vector4? colorMask = null, // float textScale = MyGuiConstants.DEFAULT_TEXT_SCALE, // MyFontEnum font = MyFontEnum.Blue, // MyGuiDrawAlignEnum originAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER) // : base(position: position, // size: size, // colorMask: colorMask, // isActiveControl: false) //{ // Name = "Label"; // Font = font; // if (text != null) // { // // Create COPY of the text (Don't just point to one string builder!!! This was my original mistake!) // m_text = text.ToString(); // TextToDraw = new StringBuilder(text.ToString()); // } // OriginAlign = originAlign; // TextScale = textScale; //} public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); var labelObjectBuilder = (MyObjectBuilder_GuiControlLabel)objectBuilder; m_textEnum = MyStringId.GetOrCompute(labelObjectBuilder.TextEnum); TextScale = labelObjectBuilder.TextScale; m_text = String.IsNullOrWhiteSpace(labelObjectBuilder.Text) ? null : labelObjectBuilder.Text; Font = labelObjectBuilder.Font; TextToDraw = new StringBuilder(); UpdateFormatParams(null); }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); var buttonObjectBuilder = (MyObjectBuilder_GuiControlImageButton)objectBuilder; Text = buttonObjectBuilder.Text; m_textEnum = MyStringId.GetOrCompute(buttonObjectBuilder.TextEnum); TextScale = buttonObjectBuilder.TextScale; TextAlignment = (MyGuiDrawAlignEnum)buttonObjectBuilder.TextAlignment; DrawCrossTextureWhenDisabled = buttonObjectBuilder.DrawCrossTextureWhenDisabled; UpdateText(); }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); Size = new Vector2(m_onButton.Size.X + m_offButton.Size.X, Math.Max(m_onButton.Size.Y, m_offButton.Size.Y)); Debug.Assert(m_onButton != null); Debug.Assert(m_offButton != null); Debug.Assert(Elements.Contains(m_onButton)); Debug.Assert(Elements.Contains(m_offButton)); Debug.Assert(m_onButton.Owner == this); Debug.Assert(m_offButton.Owner == this); UpdateButtonState(); }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); var ob = (MyObjectBuilder_GuiControlSeparatorList)builder; m_separators.Clear(); m_separators.Capacity = ob.Separators.Count; foreach (var separator in ob.Separators) { m_separators.Add(new Separator() { Start = new Vector2(separator.StartX, separator.StartY), Size = new Vector2(separator.SizeX, separator.SizeY), }); } }
public override void Init(MyObjectBuilder_GuiControlBase builder) { base.Init(builder); var ob = (MyObjectBuilder_GuiControlRadioButton)builder; Key = ob.Key; if (ob.VisualStyle == MyGuiControlRadioButtonStyleEnum.Custom) { if (ob.CustomVisualStyle.HasValue) { MyGuiCustomVisualStyle customVs = ob.CustomVisualStyle.Value; m_styleDef = new StyleDefinition(); m_styleDef.HighlightFont = customVs.HighlightFont; m_styleDef.NormalFont = customVs.NormalFont; m_styleDef.HighlightTexture = new MyGuiCompositeTexture() { LeftTop = new MyGuiSizedTexture() { SizePx = customVs.Size, Texture = customVs.HighlightTexture } }; m_styleDef.NormalTexture = new MyGuiCompositeTexture() { LeftTop = new MyGuiSizedTexture() { SizePx = customVs.Size, Texture = customVs.NormalTexture } }; m_styleDef.Padding = new MyGuiBorderThickness(customVs.HorizontalPadding, customVs.VerticalPadding); VisualStyle = ob.VisualStyle; } else { VisualStyle = MyGuiControlRadioButtonStyleEnum.Rectangular; } } else { VisualStyle = ob.VisualStyle; } }
public virtual void Init(MyObjectBuilder_GuiControlBase builder) { m_position = builder.Position; Size = builder.Size; Name = builder.Name; if (builder.BackgroundColor != Vector4.One) { ColorMask = builder.BackgroundColor; } if (builder.ControlTexture != null) { BackgroundTexture = new MyGuiCompositeTexture() { Center = new MyGuiSizedTexture() { Texture = builder.ControlTexture } } } ; OriginAlign = builder.OriginAlign; }
public override void Init(MyObjectBuilder_GuiControlBase objectBuilder) { base.Init(objectBuilder); m_label.MaxLineWidth = ComputeRichLabelWidth(); var ob = (MyObjectBuilder_GuiControlMultilineLabel)objectBuilder; this.TextAlign = (MyGuiDrawAlignEnum)ob.TextAlign; this.TextBoxAlign = (MyGuiDrawAlignEnum)ob.TextBoxAlign; this.TextScale = ob.TextScale; this.TextColor = new Color(ob.TextColor); this.Font = ob.Font; MyStringId textEnum; if (Enum.TryParse <MyStringId>(ob.Text, out textEnum)) { TextEnum = textEnum; } else { Text = new StringBuilder(ob.Text); } }