SubViewportContainer.xml 1.3 KB

12345678910111213141516171819202122
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SubViewportContainer" inherits="Container" version="4.0">
  3. <brief_description>
  4. Control for holding [SubViewport]s.
  5. </brief_description>
  6. <description>
  7. A [Container] node that holds a [SubViewport], automatically setting its size.
  8. [b]Note:[/b] Changing a SubViewportContainer's [member Control.rect_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).
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <members>
  13. <member name="stretch" type="bool" setter="set_stretch" getter="is_stretch_enabled" default="false">
  14. If [code]true[/code], the sub-viewport will be scaled to the control's size.
  15. </member>
  16. <member name="stretch_shrink" type="int" setter="set_stretch_shrink" getter="get_stretch_shrink" default="1">
  17. Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
  18. For example, a 1280×720 sub-viewport with [member stretch_shrink] set to [code]2[/code] will be rendered at 640×360 while occupying the same size in the container.
  19. [b]Note:[/b] [member stretch] must be [code]true[/code] for this property to work.
  20. </member>
  21. </members>
  22. </class>