You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Viewport do not affect camera space, just the render position on the screen.
observed behavior
I modified the rustaceanmark example minimally to try out the macroquad camera. During this I stumbled upon the fact that specifying a viewport does alter your cameras space. As you can see here specifying a viewport has the effect of zooming in:
experiment with from_display_rect camera configuration
I can get the right space back though, if I also set the zoom and target accordingly by using from_display_rect with the same dimensions as the viewport:
If we try to go one step further and restore the default camera (using set_default_camera) after drawing the sprites but before drawing the text we get this:
As you can see, now the text is being scaled down.
This is on
master
at 4e27d18Slightly related to #171
expected behavior
The docs state that
observed behavior
I modified the rustaceanmark example minimally to try out the macroquad camera. During this I stumbled upon the fact that specifying a viewport does alter your cameras space. As you can see here specifying a viewport has the effect of zooming in:
native (Ubuntu 23.10, Nvidia GTX 1060):
wasm (Firefox and Chromium):
Code:
experiment with
from_display_rect
camera configurationI can get the right space back though, if I also set the zoom and target accordingly by using
from_display_rect
with the same dimensions as the viewport:native (and wasm looks the same):
Code:
experiments with multiple cameras
If we try to go one step further and restore the default camera (using
set_default_camera
) after drawing the sprites but before drawing the text we get this:As you can see, now the text is being scaled down.
If we do something like this instead:
we get no text drawn at all (or probably somewhere we can't see):
The text was updated successfully, but these errors were encountered: