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

Allow configuring the primary line x/y components independently for the 2d editor grid snap #7588

Closed
duncathan opened this issue Aug 31, 2023 · 2 comments · Fixed by godotengine/godot#81255

Comments

@duncathan
Copy link

Describe the project you are working on

A 2D puzzle-platformer with fixed-camera rooms (30x17 tiles).

Describe the problem or limitation you are having in your project

The 2D editor's grid snap and grid view features are extremely useful, but the "Primary Line Every" setting being uniform for both the X and Y components is limiting. Since my project is fixed-camera, the square tiling of primary lines is often more annoying than it is helpful. I can mitigate the annoyance by setting it to every 1 step, of course, but it would be nice if it could be leveraged into something more useful.

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

#7569 has identified a similar issue, but I'd like to propose an alternative/complementary solution. Being able to adjust the X/Y components independently (like you already can for the snap size itself!) would provide a major improvement to projects that need it, while changing virtually nothing for projects that don't.

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

image
When configuring the snap, simply adjust the components independently as you already would for offset or size.

image
If this would be cumbersome for users that only need square primary lines, a button to lock/unlock the ratio (like exists for Node2D.scale) could be added, defaulting to locked.

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

While you can certainly write a @tool script to achieve similar behavior, (and indeed I already have such a script that draws a grid dividing the screens), having the behavior built into the editor in the same place as everything else about the grid is certainly far more convenient in terms of usability.

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

I can imagine that use cases like this are far from uncommon, and it's a relatively simple extension of the existing featureset of the grid snap configuration window.

@Calinou
Copy link
Member

Calinou commented Aug 31, 2023

I prefer this solution to the one outlined in #7569, as it's simpler to implement and maintain while providing the base functionality requested (drawing room separators).

@JohnGabrielUK
Copy link

I prefer this solution, too; it achieves the same thing as my proposal, but in a much more elegant way.

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.

4 participants