Table of Contents

Class UIRenderFeature

Namespace
Stride.Rendering.UI
Assembly
Stride.UI.dll
public class UIRenderFeature : RootRenderFeature, IComponent, IReferencable, ICollectorHolder, IGraphicsRendererCore, IDisposable
Inheritance
UIRenderFeature
Implements
Inherited Members
Extension Methods

Constructors

UIRenderFeature()

public UIRenderFeature()

Properties

SupportedRenderObjectType

Gets the type of render object supported by this RootRenderFeature.

public override Type SupportedRenderObjectType { get; }

Property Value

Type

UIElementUnderMouseCursor

Represents the UI-element thats currently under the mouse cursor. Only elements with CanBeHitByUser == true are taken into account. Last processed element_state / ?UIComponent? with a valid element will be used.

public UIElement UIElementUnderMouseCursor { get; }

Property Value

UIElement

Methods

Draw(RenderDrawContext, RenderView, RenderViewStage, int, int)

Performs GPU updates and/or draw.

public override void Draw(RenderDrawContext context, RenderView renderView, RenderViewStage renderViewStage, int startIndex, int endIndex)

Parameters

context RenderDrawContext
renderView RenderView
renderViewStage RenderViewStage
startIndex int
endIndex int

GetElementAtScreenPosition(UIElement, ref Ray, ref Matrix, ref Vector3)

Gets the element with which the clickRay intersects, or null if none is found

public static UIElement GetElementAtScreenPosition(UIElement rootElement, ref Ray clickRay, ref Matrix worldViewProj, ref Vector3 intersectionPoint)

Parameters

rootElement UIElement

The root UIElement from which it should test

clickRay Ray

Ray from the click in object space of the ui component in (-Resolution.X/2 .. Resolution.X/2, -Resolution.Y/2 .. Resolution.Y/2) range

worldViewProj Matrix
intersectionPoint Vector3

Intersection point between the ray and the element

Returns

UIElement

The UIElement with which the ray intersects

GetElementsAtPosition(UIElement, ref Ray, ref Matrix)

Gets all elements that the given ray intersects.

public static ICollection<UIRenderFeature.HitTestResult> GetElementsAtPosition(UIElement rootElement, ref Ray ray, ref Matrix worldViewProj)

Parameters

rootElement UIElement

The root UIElement from which it should test

ray Ray

Ray from the click in object space of the ui component in (-Resolution.X/2 .. Resolution.X/2, -Resolution.Y/2 .. Resolution.Y/2) range

worldViewProj Matrix

Returns

ICollection<UIRenderFeature.HitTestResult>

A collection of all elements hit by this ray, or an empty collection if no hit.

GetRenderer(UIElement)

public ElementRenderer GetRenderer(UIElement element)

Parameters

element UIElement

Returns

ElementRenderer

InitializeCore()

Initializes this instance. Query for specific cbuffer (either new one, like PerMaterial, or parts of an existing one, like PerObject=>Skinning)

protected override void InitializeCore()

RegisterRenderer(UIElement, ElementRenderer)

public void RegisterRenderer(UIElement element, ElementRenderer renderer)

Parameters

element UIElement
renderer ElementRenderer

RegisterRendererFactory(Type, IElementRendererFactory)

public void RegisterRendererFactory(Type uiElementType, IElementRendererFactory factory)

Parameters

uiElementType Type
factory IElementRendererFactory