Table of Contents

Class SubViewportContainer

Namespace
Godot
Assembly
GodotSharp.dll

A container that displays the contents of underlying SubViewport child nodes. It uses the combined size of the SubViewports as minimum size, unless Stretch is enabled.

Note: Changing a SubViewportContainer's Scale will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container).

Note: The SubViewportContainer forwards mouse-enter and mouse-exit notifications to its sub-viewports.

public class SubViewportContainer : Container, IDisposable
Inheritance
SubViewportContainer
Implements
Inherited Members

Constructors

SubViewportContainer()

public SubViewportContainer()

Properties

Stretch

If true, the sub-viewport will be automatically resized to the control's size.

Note: If true, this will prohibit changing Size of its children manually.

public bool Stretch { get; set; }

Property Value

bool

StretchShrink

Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.

For example, a 1280×720 sub-viewport with StretchShrink set to 2 will be rendered at 640×360 while occupying the same size in the container.

Note: Stretch must be true for this property to work.

public int StretchShrink { get; set; }

Property Value

int

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

_PropagateInputEvent(InputEvent)

Virtual method to be implemented by the user. If it returns true, the event is propagated to SubViewport children. Propagation doesn't happen if it returns false. If the function is not implemented, all events are propagated to SubViewports.

public virtual bool _PropagateInputEvent(InputEvent @event)

Parameters

event InputEvent

Returns

bool