Open KaenguruuDev opened 2 months ago
This is done by design, but should probably be something you can configure, and not do when used in plugins etc: https://github.com/godotengine/godot/blob/4788f54d9767425bf5435b1cc940885d357795c5/scene/gui/texture_progress_bar.cpp#L538-L553
A few questions:
1) It's to help you align things I'd say
2) That would be hard, though we could use is_part_of_edited_scene
, will see if I can test that out some
3) I'd say that'd be the most useful solution
I think this maybe could be reworked to use Marker2D as internal node.
I made dirty but working prototype and this is how it may look:
4.4dev2 | Prototype | |
---|---|---|
1024x1024 | ||
48x48 |
And you should be able to access crosshair from code as internal Marker2D child node.
I change crosshair visibility inside set_fill_mode()
, so you should be able to change Marker2D visibility after setting fill mode.
Another possible solution - add editor-only metadata to set crosshair visibility.
Sorry for not answering for so long I got distracted again. Does your prototype allow for disabling the crosshair even in the normal editor (without having to attatch a tool script or something to the node)?
Sorry for not answering for so long I got distracted again. Does your prototype allow for disabling the crosshair even in the normal editor (without having to attatch a tool script or something to the node)?
No, I did not add/change any methods. You still should change visibility of internal Marker2D node using script. Having additional parameters or methods for this looks like overkill.
Also there is controversial moment - should it be always added (for consistency) or only for editor?
Moreover, Marker2D is Node2D
and TextureProgressBar is Control
.
So this is not an ideal solution at the moment, and the implementation details should be discussed in more detail.
Oh, it looks like this problem was reported a few years ago. See https://github.com/godotengine/godot/issues/46266
Tested versions
Reproducible in: v4.3.stable.mono.official [77dcf97d8] (Latest)
System information
Godot v4.3.stable.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 32.0.15.6094) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)
Issue description
When selecting either "Clockwise", "Counter Clockwise" or "Clockwise and Counter Clockwise" as the FillMode, a cross is displayed in the center of the rect. This does not disappear, even when selecting another node or left clicking somewhere else in the scene view. Additionally, the crosshair is also visible when the TextureProgressBar node is used in an EditorPlugin.
Steps to reproduce
Minimal reproduction project (MRP)
Mrp.zip