1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-03 16:55:53 +00:00
Files
godot/doc/classes
Hugo Locurcio 0cf99cf95d 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.
2024-11-19 23:11:13 +01:00
..
2024-09-29 17:27:36 +09:00
2024-09-29 17:27:36 +09:00
2024-09-26 13:00:17 -07:00
2024-06-18 11:06:31 -04:00
2024-06-18 11:06:31 -04:00
2024-09-27 20:07:36 +08:00
2024-09-25 12:08:06 +02:00
2024-10-04 22:36:12 +02:00
2024-10-01 21:39:16 +02:00
2024-08-12 00:17:11 +01:00
2024-07-07 22:15:23 +02:00
2024-09-30 12:21:30 +02:00
2024-09-30 12:21:30 +02:00
2024-07-17 18:53:03 +02:00
2024-09-16 16:26:15 +02:00
2024-09-01 17:00:47 +02:00
2024-10-22 17:16:39 -07:00
2024-10-17 00:21:52 +02:00
2024-06-15 18:21:05 +02:00
2024-06-15 18:21:05 +02:00
2024-09-30 12:21:30 +02:00