Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve 2D editor zoom controls #2658

Closed
mathias17 opened this issue Apr 27, 2021 · 4 comments · Fixed by godotengine/godot#48252
Closed

Improve 2D editor zoom controls #2658

mathias17 opened this issue Apr 27, 2021 · 4 comments · Fixed by godotengine/godot#48252

Comments

@mathias17
Copy link

Describe the project you are working on

A 2D shootemup game.

Describe the problem or limitation you are having in your project

I am unable to set the Godot editor's zoom level how I want, quickly and easily.
Sometimes I want to set Godot's zoom so it matches my game's scale, while I'm making levels.
This helps a ton in giving me a good sense of how things look and feel on-screen when playing the game (without needing to run the game of course).
It's a very basic, natural desire for a level designer to want to have a good sense of what his level looks like, as he's making it (as much as possible).

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Because I know my game is rendered at a certain resolution and is blown up to fill my screen, if I zoom to 500% while working on a new level, it perfectly matches the run-time zoom level when playing the game. Godot's zoom function doesn't facilitate this at all.

It could, though. A small change could mean a nice increase in user-friendliness.

Solutions? I have three ideas for you guys:
IDEA 01) Add new zoom shortcuts so users can jump to 200%, 300%, 400%, etc, in one keystroke.
Add shortcut slots for 200%, 300%, 400%, 500%, 600%, 700%, and 800% to Editor Settings.

I recommend not setting default keystrokes for new these keyboard shortcut slots, since users may already be using the keystrokes.

We only have these currently:
(https://i.imgur.com/Avhxh0L.png)
Screenshot of current Godot zoom keyboard shortcut slots.

Something like this would be absolutely ideal:
(https://i.imgur.com/orf9w6L.png)
Screenshot of zoom keyboard shortcuts.

If I could simply press CTRL+5 to go to right to 500% zoom, it would be great!

IDEA 02) Standardize Godot's zoom level snapping when using scrollwheel or clicking plus/minus buttons.
Lock zoom increments to be more predictable whole number increments, or let users hold a modifier key when zooming that would do this. ie ALT+SCROLLWHEEL rounds to nearest 100% increment then each ALT_SCROLLWHEEL tick thereafter snaps to 100's.
As user continues to zoom out beyond 100%, then decrease the zoom snap increments.
For reference, Photoshop snaps to 100% increments just like I'm describing, and once zoomed to 100% and user continues to zoom out then zoom snaps to these numbers in this order: 66%, 50%, 33%, 25%, 16.5%, 12.5%, 8.3%, 6.25%, 5%, and so on.

Currently, Godot 3.3's zooming is unpredictable and seems a little random:
-Screen recording of Godot 3.3 while zooming-
I can't get to 500% even if I want to! This does not seem right at all. It's a minor matter but honestly it feels dysfunctional, to me.

IDEA 03) Let users right-click on zoom percentage number (top left of editor) and input a zoom percentage and press ENTER to jump to that exact zoom level. (currently RMB on the top left zoom percent does nothing)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

(N/A? Please see above; I don't want to be overly verbose and waste your time)

TL;DR: With this idea in place, users would be able to use a single keystroke to jump straight to very common zoom levels, or use their mouse scrollwheel to do so, if holding a modifier key.
At the least - add new shortcut slots users can set that affect the editor's zoom level.
At the most - change the math used for calculating zoom level changes so that simpler whole number increments are used.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. It concerns modifying the editor, fundamentally.

Is there a reason why this should be core and not an add-on in the asset library?

Yes. This proposal is suggesting unobtrusive, optional enhancements for the Godot Editor which can be ignored.
In my opinion, this change would be embraced as purely beneficial by a large percentage of 2D users.

@Calinou
Copy link
Member

Calinou commented Apr 27, 2021

Currently, Godot 3.3's zooming is unpredictable and seems a little random:
-Screen recording of Godot 3.3 while zooming-
I can't get to 500% even if I want to! This does not seem right at all. It's a minor matter but honestly it feels dysfunctional, to me.

If you press the + (Ctrl + -) and - (Ctrl + =) buttons, it will use sqrt(2) as a zoom factor, which means it will always go through power-of-two zoom factors as long as you start from 100% and don't use the mouse wheel.

The rest of the proposed changes sound good to me. I'm accustomed to GIMP's 1-5 shortcuts which set the zoom to 100%, 200%, 400%, 800% and 1600% respectively. We can do something different for Godot (as 1600% is kind of excessive), but similar in spirit.

In the meantime, you can implement those features as a plugin.

@mathias17
Copy link
Author

Hey Calinou, thanks for the info!
When I reset zoom to 100% and use CTRL+= to zoom in, the zoom levels go as follows:
141.4%
200%
282.8%
400%
565.7%
800%
1131%
. . . and so on.

I guess everyone sees the same zoom increments like I am. I always figured Godot was calculating zoom levels based on the dimensions of the editor window or something like that, given their seeming randomness.

@Calinou Calinou changed the title Improve editor zoom controls Improve 2D editor zoom controls Apr 27, 2021
@akien-mga akien-mga added this to the 4.0 milestone Jul 13, 2021
@circuitbone
Copy link

Is there a command to set this via code?, additionally point the camera to the 0,0,0 position in the editor at the same time.

@Calinou
Copy link
Member

Calinou commented Oct 20, 2022

Is there a command to set this via code?, additionally point the camera to the 0,0,0 position in the editor at the same time.

See #3287.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants