Method SceneView
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
SceneView(Camera?, string?, string?, string?, float, StyleOverrides?, Func<VisualElement, Action>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?)
Creates a SceneView element displaying camera's output — the canvas-parity
element. The framework owns the RenderTexture: it is created at the element's laid-out pixel
size (times resolutionScale), resized when the element's geometry changes,
assigned to camera.targetTexture while mounted, and released on unmount (restoring the
camera's target only if it is still the framework's own texture). The output arrives through
the element's background image, so background utilities and rounded corners apply to it.
public static ElementNode SceneView(Camera? camera, string? className = null, string? key = null, string? name = null, float resolutionScale = 1, StyleOverrides? styles = null, Func<VisualElement, Action>? refCallback = null, string? whileHoverClass = null, string? whileTapClass = null, string? whileFocusClass = null, IReadOnlyDictionary<string, string>? data = null, IReadOnlyDictionary<string, string>? aria = null)
Parameters
cameraCameraCamera whose output the element displays. Null renders nothing (the element mounts as an empty box until a camera is supplied).
classNamestringCSS-like utility class string. Multiple classes separated by spaces.
keystringKey used to disambiguate siblings at the same position.
namestringElement name assigned to UnityEngine.UIElements.VisualElement.name for query/debug.
resolutionScalefloatRender-resolution multiplier over the element's laid-out pixel size (0.5 renders at half resolution).
stylesStyleOverridesInline style overrides applied on top of USS classes.
refCallbackFunc<VisualElement, Action>Callback invoked on mount with the created VisualElement; returned Action runs on unmount.
whileHoverClassstringUSS class toggled while the pointer hovers the element (gesture-driven).
whileTapClassstringUSS class toggled while the pointer is pressed on the element (gesture-driven).
whileFocusClassstringUSS class toggled while the element holds keyboard/UI focus (gesture-driven).
dataIReadOnlyDictionary<string, string>data-* attribute map matched by
data-[...]variants.ariaIReadOnlyDictionary<string, string>aria-* attribute map matched by
aria-[...]variants.
Returns
- ElementNode
The created ElementNode representing this scene view.
Exceptions
- ArgumentOutOfRangeException
resolutionScaleis <= 0 or NaN.