public ComponentLineControl(Vector2 size, float iconSize) : base(size: size, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP) { var m_iconSize = new Vector2(iconSize) * new Vector2(0.75f, 1); var middleLeft = new Vector2(-this.Size.X / 2, 0); var middleRight = new Vector2(this.Size.X / 2, 0); var iconPos = middleLeft - new Vector2(0, m_iconSize.Y / 2); //IconPanel = new MyGuiControlPanel(); //IconPanelBackground = new MyGuiControlPanel(); IconImage = new MyGuiControlImage(); IconPanelProgress = new MyGuiControlPanel(); NameLabel = new MyGuiControlLabel(text: String.Empty); NumbersLabel = new MyGuiControlLabel(text: String.Empty); //IconPanel.Size = m_iconSize; //IconPanel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; //IconPanel.Position = iconPos; //IconPanelBackground.Size = m_iconSize; //IconPanelBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; //IconPanelBackground.Position = iconPos; //IconPanelBackground.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); IconImage.Size = m_iconSize; IconImage.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; IconImage.Position = iconPos; IconImage.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); IconPanelProgress.Size = m_iconSize; IconPanelProgress.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; IconPanelProgress.Position = iconPos; IconPanelProgress.BackgroundTexture = MyGuiConstants.TEXTURE_GUI_BLANK; float gray = 0.1f; IconPanelProgress.ColorMask = new Vector4(gray, gray, gray, 0.5f); NameLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER; NameLabel.Position = middleLeft + new Vector2(m_iconSize.X + 0.01225f, 0); NameLabel.AutoEllipsis = true; NumbersLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER; NumbersLabel.Position = middleRight + new Vector2(-0.033f, 0); //topRight + new Vector2(-0.02f, 0.004f); //Elements.Add(IconPanelBackground); //Elements.Add(IconPanel); Elements.Add(IconImage); Elements.Add(IconPanelProgress); Elements.Add(NameLabel); Elements.Add(NumbersLabel); }
public MyGuiDetailScreenBase(bool isTopMostScreen, MyGuiBlueprintScreenBase parent, string thumbnailTexture, MyGuiControlListbox.Item selectedItem, float textScale) : base(new Vector2(0.37f, 0.325f), new Vector2(0.725f, 0.4f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, isTopMostScreen) { m_thumbnailImage = new MyGuiControlImage() { BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK, }; m_thumbnailImage.SetPadding(new MyGuiBorderThickness(3f, 2f, 3f, 2f)); m_thumbnailImage.SetTexture(thumbnailTexture); m_selectedItem = selectedItem; m_blueprintName = selectedItem.Text.ToString(); m_textScale = textScale; m_parent = parent; }
public MyGuiControlScenarioButton(MyScenarioDefinition scenario): base(key: MyDefinitionManager.Static.GetScenarioDefinitions().IndexOf(scenario)) { VisualStyle = MyGuiControlRadioButtonStyleEnum.ScenarioButton; OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; Scenario = scenario; m_titleLabel = new MyGuiControlLabel(text: scenario.DisplayNameText, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP); m_previewImage = new MyGuiControlImage(textures: scenario.Icons, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP); MyGuiSizedTexture image = new MyGuiSizedTexture() { SizePx = new Vector2(229f, 128f), }; m_previewImage.Size = image.SizeGui; m_previewImage.BorderEnabled = true; m_previewImage.BorderColor = MyGuiConstants.THEMED_GUI_LINE_COLOR.ToVector4(); SetToolTip(scenario.DescriptionText); Size = new Vector2(Math.Max(m_titleLabel.Size.X, m_previewImage.Size.X), m_titleLabel.Size.Y + m_previewImage.Size.Y); Elements.Add(m_titleLabel); Elements.Add(m_previewImage); }
public MyGuiControlBlockInfo(MyControlBlockInfoStyle style, bool progressMode = true, bool largeBlockInfo = true) : base(backgroundTexture: new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_LARGE_DEFAULT.Texture)) { m_style = style; m_progressMode = progressMode; m_leftColumnBackground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_leftColumnBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; Elements.Add(m_leftColumnBackground); m_titleBackground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_titleBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; Elements.Add(m_titleBackground); if (m_progressMode) { m_integrityBackground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_integrityBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM; Elements.Add(m_integrityBackground); m_integrityForeground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_integrityForeground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM; Elements.Add(m_integrityForeground); m_integrityCriticalLine = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_integrityCriticalLine.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM; Elements.Add(m_integrityCriticalLine); } //m_blockIconPanelBackground = new MyGuiControlPanel(); //m_blockIconPanelBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; //m_blockIconPanelBackground.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); //m_blockIconPanelBackground.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); //m_blockIconPanelBackground.Size *= new Vector2(0.75f, 1); //Elements.Add(m_blockIconPanelBackground); //m_blockIconPanel = new MyGuiControlPanel(); //m_blockIconPanel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; //m_blockIconPanel.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); //m_blockIconPanel.Size *= new Vector2(0.75f, 1); //Elements.Add(m_blockIconPanel); m_blockIconImage = new MyGuiControlImage(); m_blockIconImage.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_blockIconImage.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); m_blockIconImage.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); m_blockIconImage.Size *= new Vector2(0.75f, 1); Elements.Add(m_blockIconImage); m_blockTypePanelBackground = new MyGuiControlPanel(); m_blockTypePanelBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_blockTypePanelBackground.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); m_blockTypePanelBackground.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); m_blockTypePanelBackground.Size *= new Vector2(0.75f, 1); Elements.Add(m_blockTypePanelBackground); m_blockTypePanel = new MyGuiControlPanel(); m_blockTypePanel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_blockTypePanel.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); m_blockTypePanel.Size *= new Vector2(0.75f, 1); m_blockTypePanel.BackgroundTexture = new MyGuiCompositeTexture(largeBlockInfo ? @"Textures\GUI\Icons\Cubes\LargeBlock.dds" : @"Textures\GUI\Icons\Cubes\SmallBlock.dds"); Elements.Add(m_blockTypePanel); m_blockNameLabel = new MyGuiControlLabel(text: String.Empty); m_blockNameLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_blockNameLabel.TextScale = 1 * baseScale; m_blockNameLabel.Font = m_style.BlockNameLabelFont; m_blockNameLabel.AutoEllipsis = true; Elements.Add(m_blockNameLabel); String blockTypeLabelText = String.Empty; if (style.EnableBlockTypeLabel) blockTypeLabelText = MyTexts.GetString(largeBlockInfo ? MySpaceTexts.HudBlockInfo_LargeShip_Station : MySpaceTexts.HudBlockInfo_SmallShip); m_blockTypeLabel = new MyGuiControlLabel(text: blockTypeLabelText); m_blockTypeLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_blockTypeLabel.TextScale = 1 * baseScale; m_blockTypeLabel.Font = MyFontEnum.White; Elements.Add(m_blockTypeLabel); m_componentsLabel = new MyGuiControlLabel(text: MyTexts.GetString(m_style.ComponentsLabelText)); m_componentsLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_componentsLabel.TextScale = m_smallerFontSize * baseScale; m_componentsLabel.Font = m_style.ComponentsLabelFont; Elements.Add(m_componentsLabel); m_installedRequiredLabel = new MyGuiControlLabel(text: MyTexts.GetString(m_style.InstalledRequiredLabelText)); m_installedRequiredLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_installedRequiredLabel.TextScale = m_smallerFontSize * baseScale; m_installedRequiredLabel.Font = m_style.InstalledRequiredLabelFont; Elements.Add(m_installedRequiredLabel); m_blockBuiltByLabel = new MyGuiControlLabel(text: String.Empty); m_blockBuiltByLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_blockBuiltByLabel.TextScale = m_smallerFontSize * baseScale; m_blockBuiltByLabel.Font = m_style.InstalledRequiredLabelFont; Elements.Add(m_blockBuiltByLabel); if (m_progressMode) { m_integrityLabel = new MyGuiControlLabel(text: String.Empty); m_integrityLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_BOTTOM; m_integrityLabel.Font = m_style.IntegrityLabelFont; m_integrityLabel.TextScale = 0.75f * baseScale; Elements.Add(m_integrityLabel); } m_separator = new MyGuiControlSeparatorList(); Elements.Add(m_separator); EnsureLineControls(m_componentLines.Capacity); Size = m_progressMode ? new Vector2(0.325f, 0.4f) : new Vector2(0.22f, 0.4f); }
public MyGuiControlCampaignButton(string title, string imagePath) { IsWorkshopMod = false; IsLocalMod = false; VisualStyle = MyGuiControlRadioButtonStyleEnum.ScenarioButton; OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_titleLabel = new MyGuiControlLabel() { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, Text = title }; m_previewImage = new MyGuiControlImage(textures: new [] {imagePath}) { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP }; m_workshopIconNormal = new MyGuiControlImage(textures: new[] { MyGuiConstants.TEXTURE_ICON_MODS_WORKSHOP.Normal }) { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, Size = MyGuiConstants.TEXTURE_ICON_MODS_WORKSHOP.SizeGui }; m_workshopIconHighlight = new MyGuiControlImage(textures: new[] { MyGuiConstants.TEXTURE_ICON_MODS_WORKSHOP.Highlight }) { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, Size = MyGuiConstants.TEXTURE_ICON_MODS_WORKSHOP.SizeGui }; m_localmodIconNormal = new MyGuiControlImage(textures: new[] { MyGuiConstants.TEXTURE_ICON_MODS_LOCAL.Normal }) { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, Size = MyGuiConstants.TEXTURE_ICON_MODS_WORKSHOP.SizeGui }; m_localmodIconHighlight = new MyGuiControlImage(textures: new[] { MyGuiConstants.TEXTURE_ICON_MODS_LOCAL.Highlight }) { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, Size = MyGuiConstants.TEXTURE_ICON_MODS_WORKSHOP.SizeGui }; m_previewImage.Size = new Vector2(229f, 128f)/MyGuiConstants.GUI_OPTIMAL_SIZE; m_previewImage.BorderEnabled = true; m_previewImage.BorderColor = MyGuiConstants.THEMED_GUI_LINE_COLOR.ToVector4(); Size = new Vector2(Math.Max(m_titleLabel.Size.X, m_previewImage.Size.X), m_titleLabel.Size.Y + m_previewImage.Size.Y); Elements.Add(m_titleLabel); Elements.Add(m_previewImage); }
public MyGuiControlBlockInfo(MyControlBlockInfoStyle style, bool progressMode = true, bool largeBlockInfo = true) : base(backgroundTexture: new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_LARGE_DEFAULT.Texture)) { m_style = style; m_progressMode = progressMode; m_leftColumnBackground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_leftColumnBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; Elements.Add(m_leftColumnBackground); m_titleBackground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_titleBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; Elements.Add(m_titleBackground); if (m_progressMode) { m_integrityBackground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_integrityBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM; Elements.Add(m_integrityBackground); m_integrityForeground = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_integrityForeground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM; Elements.Add(m_integrityForeground); m_integrityCriticalLine = new MyGuiControlPanel(backgroundColor: Color.Red.ToVector4()); m_integrityCriticalLine.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM; Elements.Add(m_integrityCriticalLine); } //m_blockIconPanelBackground = new MyGuiControlPanel(); //m_blockIconPanelBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; //m_blockIconPanelBackground.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); //m_blockIconPanelBackground.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); //m_blockIconPanelBackground.Size *= new Vector2(0.75f, 1); //Elements.Add(m_blockIconPanelBackground); //m_blockIconPanel = new MyGuiControlPanel(); //m_blockIconPanel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; //m_blockIconPanel.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); //m_blockIconPanel.Size *= new Vector2(0.75f, 1); //Elements.Add(m_blockIconPanel); m_blockIconImage = new MyGuiControlImage(); m_blockIconImage.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_blockIconImage.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); m_blockIconImage.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); m_blockIconImage.Size *= new Vector2(0.75f, 1); Elements.Add(m_blockIconImage); m_blockTypePanelBackground = new MyGuiControlPanel(); m_blockTypePanelBackground.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_blockTypePanelBackground.BackgroundTexture = new MyGuiCompositeTexture(MyGuiConstants.TEXTURE_HUD_BG_MEDIUM_DEFAULT.Texture); m_blockTypePanelBackground.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); m_blockTypePanelBackground.Size *= new Vector2(0.75f, 1); Elements.Add(m_blockTypePanelBackground); m_blockTypePanel = new MyGuiControlPanel(); m_blockTypePanel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_blockTypePanel.Size = m_progressMode ? new Vector2(0.088f) : new Vector2(0.04f); m_blockTypePanel.Size *= new Vector2(0.75f, 1); m_blockTypePanel.BackgroundTexture = new MyGuiCompositeTexture(largeBlockInfo ? @"Textures\GUI\Icons\Cubes\LargeBlock.dds" : @"Textures\GUI\Icons\Cubes\SmallBlock.dds"); Elements.Add(m_blockTypePanel); m_blockNameLabel = new MyGuiControlLabel(text: String.Empty); m_blockNameLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_blockNameLabel.TextScale = 1 * baseScale; m_blockNameLabel.Font = m_style.BlockNameLabelFont; m_blockNameLabel.AutoEllipsis = true; Elements.Add(m_blockNameLabel); String blockTypeLabelText = String.Empty; if (style.EnableBlockTypeLabel) { blockTypeLabelText = MyTexts.GetString(largeBlockInfo ? MySpaceTexts.HudBlockInfo_LargeShip_Station : MySpaceTexts.HudBlockInfo_SmallShip); } m_blockTypeLabel = new MyGuiControlLabel(text: blockTypeLabelText); m_blockTypeLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_blockTypeLabel.TextScale = 1 * baseScale; m_blockTypeLabel.Font = MyFontEnum.White; Elements.Add(m_blockTypeLabel); m_componentsLabel = new MyGuiControlLabel(text: MyTexts.GetString(m_style.ComponentsLabelText)); m_componentsLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP; m_componentsLabel.TextScale = m_smallerFontSize * baseScale; m_componentsLabel.Font = m_style.ComponentsLabelFont; Elements.Add(m_componentsLabel); m_installedRequiredLabel = new MyGuiControlLabel(text: MyTexts.GetString(m_style.InstalledRequiredLabelText)); m_installedRequiredLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP; m_installedRequiredLabel.TextScale = m_smallerFontSize * baseScale; m_installedRequiredLabel.Font = m_style.InstalledRequiredLabelFont; Elements.Add(m_installedRequiredLabel); if (m_progressMode) { m_integrityLabel = new MyGuiControlLabel(text: String.Empty); m_integrityLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_BOTTOM; m_integrityLabel.Font = m_style.IntegrityLabelFont; m_integrityLabel.TextScale = 0.75f * baseScale; Elements.Add(m_integrityLabel); } m_separator = new MyGuiControlSeparatorList(); Elements.Add(m_separator); EnsureLineControls(m_componentLines.Capacity); Size = m_progressMode ? new Vector2(0.325f, 0.4f) : new Vector2(0.22f, 0.4f); }
private void AddSeparator(string sectionName) { var panel = new MyGuiControlCompositePanel() { BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, Position = Vector2.Zero }; var label = new MyGuiControlLabel() { OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, Text = sectionName, Font = MyFontEnum.Blue, PositionX = 0.005f }; var imageOffset = 0.003f; var colorMask = MyGuiConstants.THEMED_GUI_LINE_COLOR; var img = new MyGuiControlImage(textures: new[] { @"Textures\GUI\FogSmall3.dds" }) { Size = new Vector2(label.Size.X + imageOffset * 10, 0.007f), OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, //ColorMask = new Vector4(0,0,0,1), ColorMask = colorMask.ToVector4(), Position = new Vector2(-imageOffset, label.Size.Y) }; var parent = new MyGuiControlParent { Size = new Vector2(m_campaignList.Size.X, label.Size.Y), OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, Position = Vector2.Zero }; panel.Size = parent.Size + new Vector2(-0.035f, 0.01f); panel.Position -= parent.Size / 2 - new Vector2(-0.01f, 0f); label.Position -= parent.Size / 2; img.Position -= parent.Size / 2; parent.Controls.Add(panel); parent.Controls.Add(img); parent.Controls.Add(label); m_campaignList.Controls.Add(parent); }
private MyGuiControlImage AddIcon(Vector2 position, string texture, Vector2 size) { var image = new MyGuiControlImage() { Position = position, Size = size, }; image.SetTexture(texture); Controls.Add(image); return image; }
public void RefreshThumbnail() { m_thumbnailImage = new MyGuiControlImage(); m_thumbnailImage.Position = new Vector2(-0.31f, -0.2f); m_thumbnailImage.Size = new Vector2(0.2f, 0.175f); m_thumbnailImage.BackgroundTexture = MyGuiConstants.TEXTURE_RECTANGLE_DARK; m_thumbnailImage.SetPadding(new MyGuiBorderThickness(3f, 2f, 3f, 2f)); m_thumbnailImage.Visible = false; }