本文整理汇总了C#中IMyGuiControlsParent类的典型用法代码示例。如果您正苦于以下问题:C# IMyGuiControlsParent类的具体用法?C# IMyGuiControlsParent怎么用?C# IMyGuiControlsParent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMyGuiControlsParent类属于命名空间,在下文中一共展示了IMyGuiControlsParent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyGuiControlMultilineText
public MyGuiControlMultilineText(
IMyGuiControlsParent parent, Vector2 position,
Vector2 size, Vector4? backgroundColor,
MyGuiFont font, float textScale, MyGuiDrawAlignEnum textAlign, StringBuilder contents, bool drawBorders = true, bool drawScrollbar = true)
: base(parent, position, size, backgroundColor, null)
{
m_font = font;
m_textScale = textScale;
m_textAlign = textAlign;
m_drawBorders = drawBorders;
m_drawScrollbar = drawScrollbar;
TextColor = new Color(MyGuiConstants.LABEL_TEXT_COLOR);
m_scrollbar = new MyVScrollbar(this);
m_scrollbar.TopBorder = m_scrollbar.RightBorder = m_scrollbar.BottomBorder = false;
m_scrollbar.LeftBorder = drawBorders;
m_scrollbarSize = new Vector2(0.0334f, MyGuiConstants.COMBOBOX_VSCROLLBAR_SIZE.Y);
m_scrollbarSize = MyGuiConstants.COMBOBOX_VSCROLLBAR_SIZE;
float minLineHeight = MyGuiManager.MeasureString(m_font,
MyTextsWrapper.Get(MyTextsWrapperEnum.ServerShutdownNotificationCaption),
m_parent.GetPositionAbsolute() + m_position, m_textScale,
m_textAlign).Size.Y;
m_label = new MyRichLabel(size.X, minLineHeight);
if (contents != null && contents.Length > 0)
{
SetText(contents);
}
}
示例2: MyGuiControlTabControl
public MyGuiControlTabControl(IMyGuiControlsParent parent, Vector2 position, Vector2 size, Vector2 headSize, Vector4 color)
: base(parent, position, size, color, null, null)
//: base(parent, position, size, color, null, null, null, null, true)
{
m_headSize = headSize;
m_color = color;
}
示例3: MyLayoutTable
public MyLayoutTable(IMyGuiControlsParent parent)
{
m_parent = parent;
m_parentTopLeft = -0.5f * (m_parent.GetSize() ?? Vector2.One);
m_prefixScanX = null;
m_prefixScanY = null;
}
示例4: MyGuiControlCheckbox
public MyGuiControlCheckbox(IMyGuiControlsParent parent, Vector2 position, Vector2 size, MyTexture2D texture, MyTexture2D checkedTexture,
StringBuilder toolTip, bool checkedVal, Vector4 color, bool highlightWhenChecked, MyGuiControlLabel label, Vector2? innerSize = null)
: base(parent, position, size, color, toolTip, texture, null, null, true)
{
m_canHandleKeyboardActiveControl = true;
m_checked = checkedVal;
m_highlightWhenChecked = false; // highlightWhenChecked; this feature is depracted
m_checkedTexture = checkedTexture;
m_label = label;
if (m_label != null) {
m_label.MouseEnter += delegate
{
m_highlight = true;
};
m_label.MouseLeave += delegate
{
m_highlight = false;
};
m_label.Click += delegate
{
UserCheck();
};
}
if (innerSize == null) m_innerSize = size;
else m_innerSize = innerSize;
}
示例5: MyGuiControlUseProperties
public MyGuiControlUseProperties(IMyGuiControlsParent parent, Vector2 position, MyUseProperties useProperties, Vector4 labelColor)
: base(parent, position, new Vector2(0.7f, 0.35f), Vector4.Zero, null, MyGuiManager.GetBlankTexture())
{
m_labelColor = labelColor;
m_useProperties = useProperties;
InitControls();
}
示例6: MyLayoutTable
public MyLayoutTable(IMyGuiControlsParent parent, Vector2 topLeft, Vector2 size)
{
m_parent = parent;
m_parentTopLeft = topLeft;
m_size = size;
m_prefixScanX = null;
m_prefixScanY = null;
}
示例7: MyGuiControlPanel
public MyGuiControlPanel(IMyGuiControlsParent parent, Vector2 position, Vector2? size, Vector4 backgroundColor, MyTexture2D texture,
MyTexture2D hoverTexture, MyTexture2D pressedTexture, int borderSize, Vector4 borderColor, StringBuilder toolTip)
: base(parent, position, size, backgroundColor, toolTip, texture, hoverTexture, pressedTexture, false)
{
Visible = true;
m_borderSize = borderSize;
m_borderColor = borderColor;
}
示例8: MyGuiControlWheelControl
public MyGuiControlWheelControl(IMyGuiControlsParent parent)
: base(parent, new Vector2(0.5f, 0.5f), new Vector2(1,1), null, null)
{
Visible = false;
m_selected = 0;
m_first = 0;
m_size = new Vector2(673/1600f, 910/1200f);
}
示例9: MyGuiControlEntityUse
protected MyGuiControlEntityUse(IMyGuiControlsParent parent, Vector2 size, MyEntity entity, MyTexture2D texture)
: base(parent, Vector2.Zero, size, Vector4.One, new StringBuilder(entity.DisplayName), MyGuiManager.GetHubItemBackground())
{
m_entity = entity;
m_topLeftPosition = -m_size.Value / 2f + new Vector2(0.025f, 0.025f);
Controls.Add(new MyGuiControlLabel(this, m_topLeftPosition + new Vector2(0.063f, 0.0f), null, GetEntityName(entity), MyGuiConstants.LABEL_TEXT_COLOR, MyGuiConstants.LABEL_TEXT_SCALE, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue()));
LoadControls();
m_texture = texture;
}
示例10: MyGuiControlLabel
public MyGuiControlLabel(IMyGuiControlsParent parent, Vector2 position, Vector2? size, MyTextsWrapperEnum textEnum, Vector4 textColor, float textScale, MyGuiDrawAlignEnum textAlign)
: base(parent, position, size, null, null, false)
{
m_type = MyGuiControlLabelType.DEFINED_BY_TEXT_WRAPPER_ENUM;
m_textEnum = textEnum;
Init(textColor, textScale, textAlign);
}
示例11: MyLayoutVertical
public MyLayoutVertical(IMyGuiControlsParent parent, float horizontalPaddingPx)
{
m_parent = parent;
// not sure if Vector2.One is correct, screens without size might be positioning things differently
m_parentSize = parent.GetSize() ?? Vector2.One;
m_currentPosY = m_parentSize.Y * -0.5f;
m_horizontalPadding = horizontalPaddingPx / MyGuiConstants.GUI_OPTIMAL_SIZE.X;
}
示例12: MyGuiControlRotatingWheel
public MyGuiControlRotatingWheel(IMyGuiControlsParent parent, Vector2 position, Vector4 color, float scale, MyGuiDrawAlignEnum align, MyTexture2D texture)
: base(parent, position, null, null, null, false)
{
m_rotatingAngle = MyMwcUtils.GetRandomRadian();
m_color = color;
m_wheelScale = scale;
//m_scale = 4;
m_align = align;
m_texture = texture;
}
示例13: MyGuiControlListboxDragAndDrop
public MyGuiControlListboxDragAndDrop(IMyGuiControlsParent parent, List<MyGuiControlListbox> listboxesToDrop, MyGuiControlPreDefinedSize predefinedSize, Vector4 backgroundColor, Vector4 textColor, float textScale, Vector2 textOffset, bool supportIcon)
: base(parent, new Vector2(0.0f, 0.0f), predefinedSize, backgroundColor, null, true)
{
m_listboxesToDrop = listboxesToDrop;
m_textColor = textColor;
m_textScale = textScale;
m_textOffset = textOffset;
m_supportIcon = supportIcon;
m_size = GetPredefinedControlSize();
DrawBackgroundTexture = true;
}
示例14: MyGuiControlListboxScrollBar
public MyGuiControlListboxScrollBar(IMyGuiControlsParent parent, Vector2 position, Vector2 size, Vector4? backgroundColor, Color sliderColor, MyScrollDirection scrollDirection, MyTexture2D texture)
{
m_parent = parent;
m_position = position;
m_size = size;
m_scrollDirection = scrollDirection;
m_texture = texture;
m_isScrollSliderDragging = false;
InitializeScrollBar(1.0f);
SetScrollValue(1.0f);
}
示例15: MyGuiControlSize
public MyGuiControlSize(IMyGuiControlsParent parent, Vector2 position, Vector2 size, Vector4 backgroundColor, StringBuilder toolTip, float value, float minValue, float maxValue, StringBuilder description, MyGuiSizeEnumFlags flags, float offset)
: base(parent, position, size, backgroundColor, toolTip, null)
{
m_minValue = minValue;
m_maxValue = maxValue;
m_flags = flags;
m_description = description;
m_offset = offset;
InitControls();
SetValue(value);
}