Class ElementRenderer
Base class for UI element renderers
public class ElementRenderer : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
ElementRenderer
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ElementRenderer(IServiceRegistry)
Create an instance of an UI element renderer.
public ElementRenderer(IServiceRegistry services)
Parameters
services
IServiceRegistryThe list of registered services
Properties
Batch
Gets a reference to the UI image drawer.
public UIBatch Batch { get; }
Property Value
Content
A reference to the game asset manager.
public IContentManager Content { get; }
Property Value
DecreaseStencilValueState
A depth stencil state that decrease the stencil value if the stencil test passes.
public DepthStencilStateDescription DecreaseStencilValueState { get; }
Property Value
GraphicsDevice
A reference to the game graphic device.
public GraphicsDevice GraphicsDevice { get; }
Property Value
IncreaseStencilValueState
A depth stencil state that increase the stencil value if the stencil test passes.
public DepthStencilStateDescription IncreaseStencilValueState { get; }
Property Value
KeepStencilValueState
A depth stencil state that keep the stencil value in any cases.
public DepthStencilStateDescription KeepStencilValueState { get; }
Property Value
Methods
RenderClipping(UIElement, UIRenderingContext)
Render the clipping region of the provided UIElement.
public virtual void RenderClipping(UIElement element, UIRenderingContext context)
Parameters
element
UIElementThe element to render.
context
UIRenderingContextThe rendering context containing information how to draw the element.
Remarks
The render target, the depth stencil buffer and the depth stencil state are already correctly set when entering this function. If the user wants to perform some intermediate rendering, it is his responsibility to bind them back correctly before the final rendering.
RenderColor(UIElement, UIRenderingContext)
Render the provided UIElement.
public virtual void RenderColor(UIElement element, UIRenderingContext context)
Parameters
element
UIElementThe element to render.
context
UIRenderingContextThe rendering context containing information how to draw the element.
Remarks
The render target, the depth stencil buffer and the depth stencil state are already correctly set when entering this function. If the user wants to perform some intermediate rendering, it is his responsibility to bind them back correctly before the final rendering.