Skip to content

Conversation

@AGulev
Copy link
Contributor

@AGulev AGulev commented Aug 10, 2025

Changes in APIs:
camera.get_aspect_ratio() – Now returns the effective aspect ratio (auto-calculated if auto is enabled, manual value if disabled)
camera.set_aspect_ratio() – Sets the manual aspect ratio value, which is used only if auto is disabled
camera.get_auto_aspect_ratio() – Returns whether auto-calculation is enabled
camera.set_auto_aspect_ratio() – Controls whether to use auto-calculation or the manual value

Fix #10632

@AGulev AGulev requested a review from britzl August 10, 2025 12:56
{"get_orthographic_zoom", RenderScriptCamera_GetOrthographicZoom},
{"set_orthographic_zoom", RenderScriptCamera_SetOrthographicZoom},
{"get_auto_aspect_ratio", RenderScriptCamera_GetAutoAspectRatio},
{"set_auto_aspect_ratio", RenderScriptCamera_SetAutoAspectRatio},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though initially that it should be is_auto_aspect_ration because this is a checkbox? as in gui: https://defold.com/ref/gui/#gui.is_enabled:node-recursive

But then a conversation poped up in my head that when I implemented https://defold.com/ref/gui/#gui.get_visible:node
we agree that we always use get, and this is_ in gui is the only place

/*# get aspect ratio
* Gets the effective aspect ratio of the camera. If auto aspect ratio is enabled,
* returns the aspect ratio calculated from the current render target dimensions.
* Otherwise returns the manually set aspect ratio.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better explanation what it returns

@AGulev AGulev merged commit d6cf8a8 into dev Aug 12, 2025
24 checks passed
@AGulev AGulev deleted the issue-10632 branch August 12, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Camera auto aspect ratio as field

3 participants