ViewportContainer.xml 1.4 KB

123456789101112131415161718192021222324252627
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ViewportContainer" inherits="Container" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Control for holding [Viewport]s.
  5. </brief_description>
  6. <description>
  7. A [Container] node that holds a [Viewport], automatically setting the viewport's size.
  8. [b]Note:[/b] Changing a ViewportContainer'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. <methods>
  13. </methods>
  14. <members>
  15. <member name="stretch" type="bool" setter="set_stretch" getter="is_stretch_enabled" default="false">
  16. If [code]true[/code], the viewport will be scaled to the control's size.
  17. </member>
  18. <member name="stretch_shrink" type="int" setter="set_stretch_shrink" getter="get_stretch_shrink" default="1">
  19. Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
  20. For example, a 1280×720 viewport with [member stretch_shrink] set to [code]2[/code] will be rendered at 640×360 while occupying the same size in the container.
  21. [b]Note:[/b] [member stretch] must be [code]true[/code] for this property to work.
  22. </member>
  23. </members>
  24. <constants>
  25. </constants>
  26. </class>