-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Option to un-center offset (origin) on collision shape rectangle #1170
Comments
Related to #452. I think modifying the editor tools to support this is a good enough solution.
Don't be so sure 🙂
Godot allows floating-point coordinates in 2D (even if pixel snap is enabled), so I don't think this is much of an issue.
It's easy to implement, but it also means having to add and document yet another property (and therefore bloating the Inspector). Everything has a cost, even if it's not obvious at first. |
I really do hope that something is done about this, and that people will support it.
I don't allow them though because they don't exist and make no sense.
That's my kind of work-ethic ;P We'll never accomplish anything thinking like that. Anyway, could you suggest some workaround for me in the meantime? It appears that the offset functionality isn't part of Node2D, so those properties don't even exist in the collision shapes? Could we inherit it somehow and then export the centered property? The goal is to be able to position collision shapes via code or editor, without using floating points, but real tangible pixel coordinates. Tnx! |
I made a PR for #452 and I actually use it already in my custom Godot build (it's the same as 3.2.2 stable plus some bonus stuff), you could use it in the meantime: https://ufile.io/icpr90x8 (also you can test if #452 solves your problem) |
this needs to be added. |
Any news on this convenient feature ? |
To my knowledge, nobody is currently working on implementing this. This feature doesn't seem to have a lot of community support, and would come with a fair bit of added complexity on its own. Also, we can have editor helpers to resize shapes from their top-left corner (like we have in 3D already). |
Describe the project you are working on:
Trying to have a node with a Sprite and Collision box/shape
Describe the problem or limitation you are having in your project:
The sprite's "origin" can be set to un-centered (top-left) as is the standard in many programs, but the collision shape allows for only the origin being "centered", messing everything up because now you can't just overlay the sprite and shape one over the other because they have two completely different origin points. Besides, what happens with pixel-perfection if the sprite has a size not divisible by 2? Where does then the center lie? That's why top-left is standard and superior.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Put a checkbox for "centered" in the collision shape, so people can un-check it just like they can on the sprite
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Collision shape rectangle should have some kind of centered property already, so just making the checkbox should be easy, if I am not wrong.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It will most definitely be used often because it is essential and absolutely logical to have
Is there a reason why this should be core and not an add-on in the asset library?:
This should be an easy fix, and a logical addition. The current system is flawed for not having this.
The text was updated successfully, but these errors were encountered: