public MyBrushGUIPropertyNumberSelect( float value, float valueMin, float valueMax, float valueStep, MyVoxelBrushGUIPropertyOrder order, MyStringId labelText) { // first is default var labelPos = new Vector2(-0.1f, -0.15f); var valuePos = new Vector2( 0.035f, -0.15f); var lowerPos = new Vector2( 0f, -0.1475f); var upperPos = new Vector2( 0.08f, -0.1475f); switch (order) { case MyVoxelBrushGUIPropertyOrder.Second: labelPos.Y = -0.07f; valuePos.Y = -0.07f; lowerPos.Y = -0.0675f; upperPos.Y = -0.0675f; break; case MyVoxelBrushGUIPropertyOrder.Third: labelPos.Y = 0.01f; valuePos.Y = 0.01f; lowerPos.Y = 0.0125f; upperPos.Y = 0.0125f; break; } Value = value; ValueMin = valueMin; ValueMax = valueMax; ValueStep = valueStep; m_label = new MyGuiControlLabel { Position = labelPos, TextEnum = labelText, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_lowerValue = new MyGuiControlButton { Position = lowerPos, VisualStyle = MyGuiControlButtonStyleEnum.ArrowLeft, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_upperValue = new MyGuiControlButton { Position = upperPos, VisualStyle = MyGuiControlButtonStyleEnum.ArrowRight, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_labelValue = new MyGuiControlLabel { Position = valuePos, Text = Value.ToString(), OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_lowerValue.ButtonClicked += LowerClicked; m_upperValue.ButtonClicked += UpperClicked; }
public MyBrushGUIPropertyNumberSlider( float value, float valueMin, float valueMax, float valueStep, MyVoxelBrushGUIPropertyOrder order, MyStringId labelText) { // first is default var labelPos = new Vector2(-0.1f, -0.15f); var valuePos = new Vector2( 0.075f, -0.15f); var sliderPos = new Vector2(-0.1f, -0.12f); switch (order) { case MyVoxelBrushGUIPropertyOrder.Second: labelPos.Y = -0.07f; valuePos.Y = -0.07f; sliderPos.Y = -0.04f; break; case MyVoxelBrushGUIPropertyOrder.Third: labelPos.Y = 0.01f; valuePos.Y = 0.01f; sliderPos.Y = 0.04f; break; } Value = value; ValueMin = valueMin; ValueMax = valueMax; ValueStep = valueStep; m_label = new MyGuiControlLabel { Position = labelPos, TextEnum = labelText, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_labelValue = new MyGuiControlLabel { Position = valuePos, Text = Value.ToString(), OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_sliderValue = new MyGuiControlSlider { Position = sliderPos, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_sliderValue.Size = new Vector2(0.212f, 0.1f); m_sliderValue.MaxValue = ValueMax; m_sliderValue.Value = Value; m_sliderValue.MinValue = ValueMin; m_sliderValue.ValueChanged += Slider_ValueChanged; }
public MyBrushGUIPropertyNumberCombo(MyVoxelBrushGUIPropertyOrder order, MyStringId labelText) { var labelPos = new Vector2(-0.1f, -0.15f); var comboPos = new Vector2(-0.1f, -0.12f); switch (order) { case MyVoxelBrushGUIPropertyOrder.Second: labelPos.Y = -0.07f; comboPos.Y = -0.04f; break; case MyVoxelBrushGUIPropertyOrder.Third: labelPos.Y = 0.01f; comboPos.Y = 0.04f; break; } m_label = new MyGuiControlLabel { Position = labelPos, TextEnum = labelText, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_combo = new MyGuiControlCombobox(); m_combo.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_combo.Position = comboPos; m_combo.Size = new Vector2(0.212f, 0.1f); m_combo.ItemSelected += Combo_ItemSelected; }