SubViewportContainer
继承: Container
< Control
< CanvasItem
< Node
< Object
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 SubViewport
s as minimum size, unless 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 margins instead (if it's not already in a container).
Note: The SubViewportContainer forwards mouse-enter and mouse-exit notifications to its sub-viewports.
属性
FocusMode | focus_mode |
bool | stretch |
int | stretch_shrink |
方法
bool | _propagate_input_event ( event: InputEvent ) virtual1 const2 |
属性说明
bool
stretch = false
If true
, the sub-viewport will be automatically resized to the control's size.
Note: If true
, this will prohibit changing SubViewport.size
of its children manually.
int
stretch_shrink = 1
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 stretch_shrink
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.
方法说明
bool
_propagate_input_event ( event: InputEvent
) virtual1 const2
实验性: 未来版本中可能会修改或移除该方法。
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.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。