SubViewportContainer
A container used for displaying the contents of a SubViewport.
A container used for displaying the contents of a SubViewport.
A container that displays the contents of underlying SubViewport child nodes. It uses the combined size of the SubViewports as minimum size, unless SubViewportContainer.Stretch is enabled.
Note: Changing a SubViewportContainer's Control.Scale will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's offset properties instead (if it's not already in a container).
Note: The SubViewportContainer forwards mouse-enter and mouse-exit notifications to its sub-viewports.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
SubViewportContainerConstructor
public SubViewportContainer();Creates a container displaying child SubViewports. Add a SubViewport as a direct child; an ordinary Control is not a viewport-image source.
Properties3
MouseTargetProperty
public bool MouseTarget { get; set; }Selects mouse-feature targets such as cursors and drag-and-drop. true targets the container itself; false permits Controls inside child SubViewports. Not a switch for all event forwarding; use _PropagateInputEvent to filter.
StretchProperty
public bool Stretch { get; set; }Stretches the displayed texture and controls direct child SubViewport output Size from the container size and StretchShrink. Disable Stretch to change a child Size manually.
StretchShrinkProperty
public int StretchShrink { get; set; }Integer divisor of child SubViewport resolution when Stretch is enabled, at least 1. For example, a 128 by 96 container at 2 uses a 64 by 48 target. Does not shrink the container itself; changes target quality and cost.
Methods7
GetStretchShrinkint
public int GetStretchShrink();Returns the requested StretchShrink value. Integer divisor of child SubViewport resolution when Stretch is enabled, at least 1. For example, a 128 by 96 container at 2 uses a 64 by 48 target. Does not shrink the container itself; changes target quality and cost.
intValue of StretchShrink; account for the documented distinction between a setting and its effective result.
IsMouseTargetEnabledbool
public bool IsMouseTargetEnabled();Selects mouse-feature targets such as cursors and drag-and-drop. true targets the container itself; false permits Controls inside child SubViewports. Not a switch for all event forwarding; use _PropagateInputEvent to filter.
boolSelects mouse-feature targets such as cursors and drag-and-drop. true targets the container itself; false permits Controls inside child SubViewports. Not a switch for all event forwarding; use _PropagateInputEvent to filter.
IsStretchEnabledbool
public bool IsStretchEnabled();Returns the requested Stretch value. Stretches the displayed texture and controls direct child SubViewport output Size from the container size and StretchShrink. Disable Stretch to change a child Size manually.
boolValue of Stretch; account for the documented distinction between a setting and its effective result.
SetMouseTargetvoid
public void SetMouseTarget(bool amount);Selects mouse-feature targets such as cursors and drag-and-drop. true targets the container itself; false permits Controls inside child SubViewports. Not a switch for all event forwarding; use _PropagateInputEvent to filter.
| Name | Type | Default |
|---|---|---|
amount | bool | — |
amounttrue targets the container for mouse features; false targets nested Controls.
SetStretchvoid
public void SetStretch(bool enable);Sets Stretch. Stretches the displayed texture and controls direct child SubViewport output Size from the container size and StretchShrink. Disable Stretch to change a child Size manually.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableStretches the displayed texture and controls direct child SubViewport output Size from the container size and StretchShrink. Disable Stretch to change a child Size manually.
SetStretchShrinkvoid
public void SetStretchShrink(int amount);Sets StretchShrink. Integer divisor of child SubViewport resolution when Stretch is enabled, at least 1. For example, a 128 by 96 container at 2 uses a 64 by 48 target. Does not shrink the container itself; changes target quality and cost.
| Name | Type | Default |
|---|---|---|
amount | int | — |
amountInteger divisor of child SubViewport resolution when Stretch is enabled, at least 1. For example, a 128 by 96 container at 2 uses a 64 by 48 target. Does not shrink the container itself; changes target quality and cost.
_PropagateInputEventbool
public virtual bool _PropagateInputEvent(InputEvent @event);Return true to permit event forwarding to child viewports, false to stop it. Applies to positional and nonpositional input paths. Do not assume the base C# method permits the event: its default bool is false. Do not dispose the supplied InputEvent.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
eventBorrowed input event; true permits forwarding.
boolReturn true to permit event forwarding to child viewports, false to stop it. Applies to positional and nonpositional input paths. Do not assume the base C# method permits the event: its default bool is false. Do not dispose the supplied InputEvent.