compsci_godot_albert/_subsections/sec03/lesson-05.org

37 lines
1.2 KiB
Org Mode
Raw Permalink Normal View History

2024-11-08 00:14:07 +02:00
#+title: Section 03 - Lesson 05 | Windows and Viewports
2024-11-29 06:41:22 +02:00
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../../_share/media/css/godot.css" />
2024-11-08 00:14:07 +02:00
* Links
- [[../../toc.org][TOC - Godot Notes]]
- [[https://www.udemy.com/course/jumpstart-to-2d-game-development-godot-4-for-beginners/learn/lecture/45303177#overview][S03:L13.05 - Windows and Viewports]]
* Notes
2024-11-10 00:37:55 +02:00
when running the game godot creates a window
and within that window is a child of it called a viewport which is the rendering surface
it initially fits inside the window
we frequently ask for the "visible rect" within the viewport
key properties are origin, height and width
we can move the viewport by changing the viewport origin
** changing window size
when the window is changed in size, the viewport is grown as opposed to stretched
there are options to change the scaling types.
** what is rendered
the viewport renders a single visual root scene at a time
this root has a scene playing on it.
get_tree().root - the root of the tree
a root can have a number of scenes, but only one is being rendered
we can change the scene being shown or rendered.
** subviewports
you can add scenes with their own sub viewports, e.g. mini maps