godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

multiple_resolutions.rst: Clear up confusing terms window and viewport

Open jpaugh opened this issue 5 months ago • 1 comments

Clear up a potential misunderstanding for new users.

When I first read this documentation, it left me with the impression that there's a /root viewport which lives inside of a window object, and that they must be sized separately. This false impression was reinforced by the existance of both get_window() and get_viewport() in the API.

jpaugh avatar Jan 26 '24 21:01 jpaugh

I built the docs locally to double check the formatting and the links. The "introduction" and "Window" links work okay on my box.

Here's what it looks like in context:

context

And, here's the generated HTML, after prettifying:

<p>There is often a need to support devices with screen and window sizes that are different from this base size. Godot offers many ways to control how the viewport will be resized and stretched to different screen sizes.</p>
<div class="admonition note">
    <p class="admonition-title">Note</p>
    <p>On this page, <em>window</em> refers to the screen area alloted to your game by the system, while <em>viewport</em> refers to the root object (accessible from <code class="docutils literal notranslate"><span class="pre">get_tree().root</span></code>) which the game controls to fill this screen area. This viewport is a <a class="reference internal" href="../../classes/class_window.html#class-window"><span class="std std-ref">Window</span></a> instance. Recall from the
        <a class="reference internal" href="viewports.html#doc-viewports"><span class="std std-ref">introduction</span></a> that <em>all</em> Window objects are viewports.</p>
</div>
<p>To configure the stretch base size at runtime from a script, use the

jpaugh avatar Jan 26 '24 21:01 jpaugh

Thanks! And congrats on your first merged PR!

skyace65 avatar Feb 20 '24 02:02 skyace65