What are flags, specifically named in https://docs.godotengine.org/en/stable/classes/class_%40globalscope.html#enum-globalscope-propertyusageflags. I found this when looking up Object.get_property_list() has to return a list of dictionaries where the value for the “hint” key refers to this. I have found that flags is not a keyword in gdscript, so I am lost as to what this “PropertyUsageFlags” is or how to manipulate it.
like you said _get_property_list has a good outline on their usage. Flags are an idea based on binary, where each “flag” is represented by a single bit. We prefer to use bit-wise operations to manipulate flags. To combine flags use | like so
FIrst i am just trying to display a property, have it be editable as a slider, make it resetable, and make the editor value bound to a float variable. Basically @export_range but manually.
Then i will want to manipulate the exported parameters dinamically, based on their values, but that is for the future. Now I just want to undertsand how the editor works.
I agree that the documentation is great, i got pretty far with it. But the sudden introduction of Flags in the documentation where the type is supposed to be got me stuck. To my understanding PROPERTY_HINT_RANGE is just an integer value, right? I got the first part working with returning the following list
Since this works, I assumed that hint is just a bitmask, and godot uses some special class/type to represent them, and PROPERTY_HINT_TYPE refers to an integer, useful in this context. However I found no documentation on Flags.
Thanks, I think I understand it. So then the documentation mentions at here that “usage is a combination of PropertyUsageFlags” then “combination” means I can just add different constants together to get the desired result? Or use bitwise operations to avoid the carry bit.