Class SubViewportContainer
- Namespace
- Forma
- Assembly
- Forma.dll
Texture-backed presentation surface for a render target or externally rendered subviewport.
public sealed class SubViewportContainer : TemplatedControl, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
- Inheritance
-
SubViewportContainer
- Implements
- Inherited Members
Constructors
SubViewportContainer()
Creates a viewport presentation surface with Godot's click focus mode.
public SubViewportContainer()
Properties
AccessibilityRole
public override AccessibilityRole AccessibilityRole { get; }
Property Value
MouseTarget
Indicates that pointer input should be considered targeted at the embedded viewport.
public bool MouseTarget { get; set; }
Property Value
Stretch
public bool Stretch { get; set; }
Property Value
StretchShrink
Godot's positive integer render-resolution divisor used when stretching a viewport texture.
public int StretchShrink { get; set; }
Property Value
ViewportClearColor
Color used to clear the hosted render target before drawing its independent UI tree.
public Color ViewportClearColor { get; set; }
Property Value
- Color
ViewportContext
Independent retained tree rendered into and receiving input through this viewport.
public UIContext ViewportContext { get; }
Property Value
ViewportTexture
public Texture2D ViewportTexture { get; set; }
Property Value
- Texture2D
Methods
Dispose()
public override void Dispose()
GetMinimumSize()
public override Vector2 GetMinimumSize()
Returns
- Vector2
GetStretchShrink()
Returns the active render-resolution divisor.
public int GetStretchShrink()
Returns
GetViewportSize()
Returns the render-target size required by the active stretch/shrink settings.
public Vector2 GetViewportSize()
Returns
- Vector2
IsMouseTargetEnabled()
Returns whether embedded viewport mouse targeting is enabled.
public bool IsMouseTargetEnabled()
Returns
IsStretchEnabled()
Returns whether viewport stretching is enabled.
public bool IsStretchEnabled()
Returns
MapPointerToViewport(Point)
Maps a global pointer position into the embedded viewport's coordinate space.
public Vector2 MapPointerToViewport(Point position)
Parameters
positionPoint
Returns
- Vector2
SetMouseTarget(bool)
Sets whether this container participates in embedded viewport mouse targeting.
public void SetMouseTarget(bool enable)
Parameters
enablebool
SetStretch(bool)
Sets whether the viewport texture stretches to the container bounds.
public void SetStretch(bool enable)
Parameters
enablebool
SetStretchShrink(int)
Sets the positive integer render-resolution divisor.
public void SetStretchShrink(int amount)
Parameters
amountint