コード例 #1
0
        private void DrawInternal()
        {
            Color colorQuote = new Color(255, 255, 255, 250);     //  White

            colorQuote.A = (byte)(colorQuote.A * m_transitionAlpha);
            {
                //////////////////////////////////////////////////////////////////////
                //  Normal loading screen
                //////////////////////////////////////////////////////////////////////

                //  Random background texture
                Rectangle backgroundRectangle;
                MyGuiManager.GetSafeHeightFullScreenPictureSize(MyGuiConstants.LOADING_BACKGROUND_TEXTURE_REAL_SIZE, out backgroundRectangle);
                MyGuiManager.DrawSpriteBatch(m_backgroundScreenTexture, backgroundRectangle, new Color(new Vector4(1f, 1f, 1f, m_transitionAlpha)));
                MyGuiManager.DrawSpriteBatch(MyGuiConstants.TEXTURE_BACKGROUND_FADE, backgroundRectangle, new Color(new Vector4(1f, 1f, 1f, m_transitionAlpha)));

                //  Game logo
                MyGuiSandbox.DrawGameLogo(m_transitionAlpha);
            }

            LastBackgroundTexture = m_backgroundScreenTexture;

            //  Loading Please Wait
            MyGuiManager.DrawString(m_font, MyTexts.Get(MyCommonTexts.LoadingPleaseWaitUppercase),
                                    MyGuiConstants.LOADING_PLEASE_WAIT_POSITION, MyGuiSandbox.GetDefaultTextScaleWithLanguage() * MyGuiConstants.LOADING_PLEASE_WAIT_SCALE, new Color(MyGuiConstants.LOADING_PLEASE_WAIT_COLOR * m_transitionAlpha),
                                    MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_BOTTOM);

            // Draw quote
            {
                if (string.IsNullOrEmpty(m_customTextFromConstructor))
                {
                    var font = m_font;
                    var controlBottomLeft = m_quoteTextControl.GetPositionAbsoluteBottomLeft();
                    var textSize          = m_quoteTextControl.TextSize;
                    var controlSize       = m_quoteTextControl.Size;
                    var authorTopLeft     = controlBottomLeft +
                                            new Vector2((controlSize.X - textSize.X) * 0.5f + 0.025f, 0.025f);
                    MyGuiManager.DrawString(font, m_authorWithDash, authorTopLeft,
                                            MyGuiSandbox.GetDefaultTextScaleWithLanguage());
                }
                m_quoteTextControl.Draw(1, 1);
            }
        }