-
-
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
Expose _edit_get_rect, _edit_use_rect to gdscript #5289
Comments
I've run into this issue a small number of times now when creating nodes with custom draw calls and it makes me wonder if in addition to exposing those hooks, if we should discuss implementing a picking flag as part of this proposal. Picking is common in many engines, and while not suitable for all use cases, it makes it very easy for anyone to allow complex shapes to be easily selected. To make it work, we would need to capture the output of any |
I was curious so for complex shapes you can also have a custom function like does the polygon contain this point. https://github.com/godotengine/godot/blob/master/scene/2d/polygon_2d.cpp#L61-L90 |
I'm less interested in the complex shapes/picking element to this, and just being able to use the draggable rect ui for custom nodes in the editor. Unless I'm mistaken the only way to get similar functionality without there methods being acessable through script would be to completely re-implement the draggable rect gui? |
This would be really useful in a project I'm building now. In my game, every object is an individual window, and I need to get the scenes rect so I can properly set the window size during instantiation. My current work around is to use a reference rect and size the scene manually, but this method would be significantly easier and safer. |
This is also not available to GDExtensions, so currently there is no way to make any custom nodes which can be clicked in the 2D editor. |
Describe the project you are working on
Plugin that uses custom rendering, needs to set the 2D rect bounds for the editor.
Describe the problem or limitation you are having in your project
The engine provides GDScript no way to set the editor rect bounds manually via gdscript.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Expose _edit_get_rect, _edit_use_rect as virtual functions for Canvas Item.
https://github.com/godotengine/godot/blob/2d210fecf03bf751bcf660d6439a51db8d6032f5/scene/main/canvas_item.h#L183
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Similar to this: https://github.com/godotengine/godot/blob/2.1/scene/2d/node_2d.cpp#L217-L226
If this enhancement will not be used often, can it be worked around with a few lines of script?
There is no workaround.
Is there a reason why this should be core and not an add-on in the asset library?
This is for the purpose of writing an add-on. Need engine help.
The text was updated successfully, but these errors were encountered: