3 using SiliconStudio.Core;
4 using SiliconStudio.Core.Mathematics;
5 using SiliconStudio.Core.Serialization.Assets;
6 using SiliconStudio.Paradox.Graphics;
8 namespace SiliconStudio.
Paradox.UI.Renderers
15 internal UISystem UI {
get;
private set; }
17 private static Color blackColor;
33 return GraphicsDeviceService == null? null: GraphicsDeviceService.GraphicsDevice;
55 return UI.KeepStencilValueState;
66 return UI.IncreaseStencilValueState;
77 return UI.DecreaseStencilValueState;
84 public Matrix ProjectionMatrix
88 return UI.ProjectionMatrix;
106 public Matrix ViewProjectionMatrix
110 return UI.ViewProjectionInternal;
121 return UI.VirtualResolution;
131 UI = services.GetSafeServiceAs<
UISystem>();
145 var backgroundColor = element.Opacity * element.BackgroundColor;
148 if (backgroundColor ==
new Color())
152 Batch.DrawBackground(ref element.WorldMatrixInternal, ref element.RenderSizeInternal, ref backgroundColor, context.DepthBias);
155 context.DepthBias += 1;
168 Batch.DrawBackground(ref element.WorldMatrixInternal, ref element.RenderSizeInternal, ref blackColor, context.DepthBias);
171 context.DepthBias += 1;
Provides a base class for all the User Interface elements in Paradox applications.
Service providing method to access GraphicsDevice life-cycle.
Contains depth-stencil state for the device.
A utility class to batch and draw UI images.
Interface of the asset manager.
Represents a three dimensional mathematical vector.
A service registry is a IServiceProvider that provides methods to register and unregister services...
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Base class for UI element renderers
SiliconStudio.Core.Mathematics.Color Color
virtual void RenderClipping(UIElement element, UIRenderingContext context)
Render the clipping region of the provided UIElement.
virtual void Load()
Loads this instance. This method is called when the element renderer is added to the rendering pipeli...
Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A).
Interface of the UI system.
The UI drawing context. It provides information about how to render UIElements for drawing...
ElementRenderer(IServiceRegistry services)
Create an instance of an UI element renderer.
virtual void RenderColor(UIElement element, UIRenderingContext context)
Render the provided UIElement.
virtual void Unload()
Unloads this instance. This method is called when the element renderer is removed from the rendering ...
Represents a 4x4 mathematical matrix.