I'm writing scenes with exported parameters so that I can manipulate them in the editor. The editor has a nice feature for float fields where you can click and drag in them to change the value. Unfortunately, for some of my fields the default amount the value changes when you drag the mouse is much too small to be useful. Is there any way to hint to the editor how much the value should change when you drag the mouse one pixel?
You can specify min/max range as well as change step: export(float, -10, 10, 1.0) var foo There are some examples of other export options in the docs.
export(float, -10, 10, 1.0) var foo
What if you don't want to specify a min/max range? My field could potentially have any value. Also, would you know how to specify that for C#?
What if you don't want to specify a min/max range? My field could potentially have any value.
You can use very high and low values – I think the -INF and INF constants might be accepted in export fields, but I'm not sure.
-INF
INF
Supported in C# as well. Syntax is explained in the docs.
I was able to get something that is functional, but INF and -INF don't seem to be accepted.
[Export(PropertyHint.Range, "-10000,10000,1")] public float overlayTop = 10;
You could try with C# numeric limits float.MinValue and float.MaxValue
Unfortunately that doesn't work.
There's no reason for it not to work. Values should be concatenated into the hint string: [Export(PropertyHint.Range, float.MinValue + ", " + float.MaxValue + ",1")] public float overlayTop = 10;
[Export(PropertyHint.Range, float.MinValue + ", " + float.MaxValue + ",1")] public float overlayTop = 10;
Oh, I thought you meant to use "float.MinValue" as part of the string.