ElementRenderer Class
Namespace: Stride.UI.RenderersAssembly: Stride.UI.dll
Base class for UI element renderers
public class ElementRenderer : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
| Name | Description | |
|---|---|---|
| Constructors | ||
| ElementRenderer(IServiceRegistry) | Create an instance of an UI element renderer. |
|
| Properties | ||
| Batch | Gets a reference to the UI image drawer. |
|
| Content | A reference to the game asset manager. |
|
| DecreaseStencilValueState | A depth stencil state that decrease the stencil value if the stencil test passes. |
|
| GraphicsDevice | A reference to the game graphic device. |
|
| IncreaseStencilValueState | A depth stencil state that increase the stencil value if the stencil test passes. |
|
| KeepStencilValueState | A depth stencil state that keep the stencil value in any cases. |
|
| Methods | ||
| RenderClipping(UIElement, UIRenderingContext) | Render the clipping region of the provided UIElement. |
|
| RenderColor(UIElement, UIRenderingContext) | Render the provided UIElement. |
|
Constructors
ElementRenderer(IServiceRegistry)
Create an instance of an UI element renderer.
public ElementRenderer(IServiceRegistry services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceRegistry | services | The list of registered services |
Properties
Batch
Gets a reference to the UI image drawer.
public UIBatch Batch { get; }
Property Value
| Type | Description |
|---|---|
| UIBatch |
Content
A reference to the game asset manager.
public IContentManager Content { get; }
Property Value
| Type | Description |
|---|---|
| IContentManager |
DecreaseStencilValueState
A depth stencil state that decrease the stencil value if the stencil test passes.
public DepthStencilStateDescription DecreaseStencilValueState { get; }
Property Value
| Type | Description |
|---|---|
| DepthStencilStateDescription |
GraphicsDevice
A reference to the game graphic device.
public GraphicsDevice GraphicsDevice { get; }
Property Value
| Type | Description |
|---|---|
| GraphicsDevice |
IncreaseStencilValueState
A depth stencil state that increase the stencil value if the stencil test passes.
public DepthStencilStateDescription IncreaseStencilValueState { get; }
Property Value
| Type | Description |
|---|---|
| DepthStencilStateDescription |
KeepStencilValueState
A depth stencil state that keep the stencil value in any cases.
public DepthStencilStateDescription KeepStencilValueState { get; }
Property Value
| Type | Description |
|---|---|
| DepthStencilStateDescription |
Methods
RenderClipping(UIElement, UIRenderingContext)
Render the clipping region of the provided UIElement.
public virtual void RenderClipping(UIElement element, UIRenderingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| UIElement | element | The element to render. |
| UIRenderingContext | context | The 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
| Type | Name | Description |
|---|---|---|
| UIElement | element | The element to render. |
| UIRenderingContext | context | The 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.