예제 #1
0
        private void DrawBlood(float alpha)
        {
            RectangleF destination     = new RectangleF(0f, 0f, (float)MyGuiManager.GetFullscreenRectangle().Width, (float)MyGuiManager.GetFullscreenRectangle().Height);
            Rectangle? sourceRectangle = null;

            MyRenderProxy.DrawSprite(@"Textures\Gui\Blood.dds", ref destination, false, ref sourceRectangle, new Color(new Vector4(1f, 1f, 1f, alpha)), 0f, new Vector2(1f, 0f), ref Vector2.Zero, SpriteEffects.None, 0f, true, null);
        }
예제 #2
0
        protected void DrawGuiIndicators()
        {
            if (MyHud.MinimalHud)
            {
                return;
            }

            if (!MySandboxGame.Config.ShowBuildingSizeHint)
            {
                return;
            }

            if (MyGuiScreenGamePlay.ActiveGameplayScreen != null)
            {
                return;
            }

            if (IsCubeSizeModesAvailable)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat(MyTexts.GetString(MySpaceTexts.CubeBuilder_CubeSizeModeChange), MyGuiSandbox.GetKeyName(MyControlsSpace.CUBE_BUILDER_CUBESIZE_MODE));
                Vector2 coords2D = new Vector2(0.5f, 0.13f);
                MyGuiManager.DrawString(MyFontEnum.White, sb, coords2D, 1.0f, null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);

                coords2D = new Vector2(0.52f, 0.2f);
                float alphaValue         = CubeBuilderState.CubeSizeMode != MyCubeSize.Small ? 0.8f : 1.0f;
                Color premultipliedColor = new Color(alphaValue, alphaValue, alphaValue, alphaValue);
                MyRenderProxy.DrawSprite(MyGuiConstants.CB_SMALL_GRID_MODE, coords2D, Vector2.One, premultipliedColor, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, 0, Vector2.UnitX, 1.0f, null);

                coords2D           = new Vector2(0.48f, 0.2f);
                alphaValue         = CubeBuilderState.CubeSizeMode != MyCubeSize.Large ? 0.8f : 1.0f;
                premultipliedColor = new Color(alphaValue, alphaValue, alphaValue, alphaValue);
                MyRenderProxy.DrawSprite(MyGuiConstants.CB_LARGE_GRID_MODE, coords2D, Vector2.One, premultipliedColor, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, 0, Vector2.UnitX, 1.0f, null);
            }

            if (BuildInputValid)
            {
                Vector2 screenPos = new Vector2(0.5f, 0.1f);
                string  texture   = DynamicMode ? MyGuiConstants.CB_FREE_MODE_ICON : MyGuiConstants.CB_LCS_GRID_ICON;

                MyRenderProxy.DrawSprite(texture, screenPos, Vector2.One, Color.White, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, 0, Vector2.UnitX, 1.0f, null);
            }
        }