public MyNotification(String notificationText, MyGuiScreenGamePlayType LifeArea, float scale, MyGuiFont font, MyGuiDrawAlignEnum textAlign, int disapearTimeMs, MyEntity owner = null, bool showConfirmMessage = false, object[] textFormatArguments = null) : this(0, notificationText, LifeArea, scale, font, textAlign, disapearTimeMs, owner, showConfirmMessage, textFormatArguments) { }
private MyNotification(int notificationTextId, string notificationString, MyGuiScreenGamePlayType LifeArea, float scale, MyGuiFont font, MyGuiDrawAlignEnum textAlign, int disapearTimeMs, MyEntity owner, bool showConfirmMessage = false, object[] textFormatArguments = null) { Owner = owner; m_originalText = notificationString; m_notificationText = notificationString; m_notificationTextID = (int)notificationTextId; m_isTextDirty = false; // always false: m_isDisappeared = false; m_actualScale = scale; m_actualFont = font; m_actualTextAlign = textAlign; m_textFormatArguments = textFormatArguments; // timing: m_disappearTimeMs = disapearTimeMs; m_aliveTime = 0; // life space; m_lifeSpace = LifeArea; // show standart message? m_showConfirmMessage = showConfirmMessage; }
public MyMessageBoxConfiguration(MyTexture2D texture, Vector4 textColor, Vector4 backgroundColor, Vector4 buttonColor, Vector4 rotatingWheelColor, Vector4 interferenceVideoColor, MyGuiFont font, MyTexture2D buttonTexture) { Texture = texture; TextColor = textColor; BackgroundColor = backgroundColor; ButtonColor = buttonColor; RotatingWheelColor = rotatingWheelColor; InterferenceVideoColor = interferenceVideoColor; Font = font; ButtonTexture = buttonTexture; }
public MySolarSystemMapNavigationMark(MyMwcVector3Int sector, string name, MyMissionID?missionID, Color color, MyTransparentMaterialEnum texture) { Sector = sector; Name = name; Color = color; Texture = texture; Importance = 1; DrawVerticalLine = true; MissionID = missionID; Font = MyGuiManager.GetFontMinerWarsWhite(); }
// IMPORTANT: This class isn't initialized by constructor, but by Start() because it's supposed to be used in memory pool public void Start(MyGuiFont font, Vector2 position, Color color, float scale, MyGuiDrawAlignEnum alignement) { Font = font; Position = position; Color = color; Scale = scale; Alignement = alignement; // Clear current text MyMwcUtils.ClearStringBuilder(m_text); }
public void Display(object[] parameters) { if (Text != null) { MyGuiFont font = GetFontDelegate(); MyHudNotification.MyNotification notification = new MyHudNotification.MyNotification(Text.Value, font, 5000, null, parameters); MyHudNotification.AddNotification(notification); } if (SoundCue != null) { MyAudio.AddCue2D(SoundCue.Value); } }
// initialize: public static void LoadContent() { MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyHudNotification::LoadContent"); m_usedFont = MyGuiManager.GetFontMinerWarsWhite(); if (m_screenNotifications == null) { int allScreensCount = (int)MyGuiScreenGamePlayType.ALL_SCREEN_COUNT; m_screenNotifications = new MyScreenNotifications[allScreensCount]; for (int i = 0; i < allScreensCount; ++i) { m_screenNotifications[i] = new MyScreenNotifications(); } } m_fogColor = MyGuiConstants.SELECT_AMMO_TIP_BACKGROUND_FADE_COLOR; m_fogColor.A = (byte)(m_fogColor.A * 0.85f); MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock(); }
public MyNotification(MyTextsWrapperEnum notificationText, MyGuiFont font, MyEntity owner = null) : this(notificationText, GetCurrentScreen(), 1.0f, font, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, DONT_DISAPEAR, owner) { }
public MyNotification(string notificationText, MyGuiFont font, int disapearTimeMs, MyEntity owner = null, object[] textFormatArguments = null) : this(notificationText, GetCurrentScreen(), 1.0f, font, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, disapearTimeMs, owner, false, textFormatArguments) { }
public MyNotification(string notificationText, MyGuiFont font, MyEntity owner = null, bool showConfirmMessage = false) : this(notificationText, GetCurrentScreen(), 1.0f, font, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, DONT_DISAPEAR, owner) { m_showConfirmMessage = showConfirmMessage; }
/// <summary> /// Creates new instance with text's color /// </summary> /// <param name="text">Warning text</param> /// <param name="textFont">Text's font</param> public MyHudTextWarning(StringBuilder text, MyGuiFont textFont) { Text = text; TextFont = textFont; }
/// <summary> /// Creates new instance with text's font /// </summary> /// <param name="text">Warning text</param> /// <param name="textFont">Text's font</param> public MyHudTextWarning(MyTextsWrapperEnum text, MyGuiFont textFont) : this(MyTextsWrapper.Get(text), textFont) { }
protected void AddLabel(StringBuilder text, Vector4 color, float scale, List <MyGuiControlBase> controlGroup = null, MyGuiFont font = null) { MyGuiControlLabel label = new MyGuiControlLabel(this, m_currentPosition, null, text, color, MyGuiConstants.LABEL_TEXT_SCALE * MyGuiConstants.DEBUG_LABEL_TEXT_SCALE * scale * m_scale, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, font); float labelWidth = label.GetTextSize().Size.X + 0.02f; m_maxWidth = Math.Max(m_maxWidth, labelWidth); Controls.Add(label); m_currentPosition.Y += 0.04f * m_scale; if (controlGroup != null) { controlGroup.Add(label); } }