summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/wayland/vulkan_context_wayland.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2023-08-24 18:22:20 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2024-11-19 23:11:13 +0100
commit0cf99cf95d098392d7d1943aac37b12bd831a1d9 (patch)
tree6d148ad2a80fc59bd77a2ce34075e0dfd1ca91cd /platform/linuxbsd/wayland/vulkan_context_wayland.cpp
parenta3080477ac0421aef24ca0916c40559abbf4846b (diff)
downloadredot-engine-0cf99cf95d098392d7d1943aac37b12bd831a1d9.tar.gz
Add a Viewport method to get automatically computed 2D stretch transform
`Viewport.get_stretch_transform()` returns the automatically computed 2D stretch transform. Combined with `Transform2D.get_scale()`, this is useful when using the `canvas_items` stretch mode in a project. There are many situations where knowing this factor is useful: - Divide Camera2D zoom to keep the size of the 2D game world identical regardless of the 2D scale factor (so that UI elements can still be scaled). - Make certain controls always drawn at 1:1 scale (e.g. for the crosshair in a FPS). This is done by dividing the Control node's scale by the scale factor.
Diffstat (limited to 'platform/linuxbsd/wayland/vulkan_context_wayland.cpp')
0 files changed, 0 insertions, 0 deletions