void AddTextWithShadow(GuiRenderer renderer, Engine.Renderer.Font font, string text, Vec2 position, HorizontalAlign horizontalAlign, VerticalAlign verticalAlign, ColorValue color) { Vec2 shadowOffset = 2.0f / renderer.ViewportForScreenGuiRenderer.DimensionsInPixels.Size.ToVec2(); renderer.AddText(font, text, position + shadowOffset, horizontalAlign, verticalAlign, new ColorValue(0, 0, 0, color.Alpha / 2)); renderer.AddText(font, text, position, horizontalAlign, verticalAlign, color); }
void workAreaControl_RenderUI(MultiViewRenderTargetControl sender, int viewIndex, GuiRenderer renderer) { if (fontMedium == null) { fontMedium = FontManager.Instance.LoadFont("Default", .04f); } if (fontBig == null) { fontBig = FontManager.Instance.LoadFont("Default", .07f); } AddTextWithShadow(renderer, fontBig, string.Format("View {0}", viewIndex), new Vec2(.99f, .01f), HorizontalAlign.Right, VerticalAlign.Top, new ColorValue(1, 1, 1)); if (viewIndex == 0) { AddTextWithShadow(renderer, fontMedium, "Camera control: W A S D, right mouse button", new Vec2(.99f, .99f), HorizontalAlign.Right, VerticalAlign.Bottom, new ColorValue(1, 1, 1)); } Draw2DRectangles(renderer); }
void workAreaControl_RenderUI( MultiViewRenderTargetControl sender, int viewIndex, GuiRenderer renderer ) { if( fontMedium == null ) fontMedium = FontManager.Instance.LoadFont( "Default", .04f ); if( fontBig == null ) fontBig = FontManager.Instance.LoadFont( "Default", .07f ); AddTextWithShadow( renderer, fontBig, string.Format( "View {0}", viewIndex ), new Vec2( .99f, .01f ), HorizontalAlign.Right, VerticalAlign.Top, new ColorValue( 1, 1, 1 ) ); if( viewIndex == 0 ) { AddTextWithShadow( renderer, fontMedium, "Camera control: W A S D, right mouse button", new Vec2( .99f, .99f ), HorizontalAlign.Right, VerticalAlign.Bottom, new ColorValue( 1, 1, 1 ) ); } Draw2DRectangles( renderer ); }