Jump to content

[SOLVED] PROP_ARRAY_STRUCT example?


photo

Recommended Posts

Hi,

would you have some C++ code sample on using all PROP_* types? The documentation and samples only shows a few here https://developer.unigine.com/en/docs/2.16.1/code/usage/using_component_system/index?rlang=cpp

Especially, I couldn't find a way to write and use a correct PROP_ARRAY_STRUCT(type, name);

Additionally, the docs doesn't show how to specify all various tags for min/max, tooltip, etc.

Thank you!

Link to comment

Hello!

you can find samples for using PROP_ types here: https://developer.unigine.com/en/docs/2.16.1/api/library/common/logic/component_system/cpp/class.componentbase?rlang=cpp&words=prop_array_struct#example

for specify condition and limitation for parameters you can use 

PROP_PARAM(Switch, my_type, 0, "one,two,three", "Title", "ToolTip for param", "Group");
PROP_PARAM(Float, my_float_2, 0.0f, "Float Title", "Float ToolTip for param", "Group", "my_type=2;max=10;min=-10");

last parameter "args" - for specify any additional property attributes "name1=value1;name2=value2"
https://developer.unigine.com/en/docs/2.16.1/code/formats/property_format?rlang=cpp#element_parameter
for example
my_type=2 - it is condition for showing my_float_2 param only when my_type=2 

  • Thanks 1
Link to comment
3 hours ago, cash-metall said:

Sorry to bother, but this link doesn't show any code sample. Are you sure the doc is up to date?

Can you post a PROP_ARRAY_STRUCT sample code here?

 

3 hours ago, cash-metall said:

for specify condition and limitation for parameters you can use 

Thanks for the template, but it doesn't appear in the online doc. Also, "Property format" refers to the serialized property file, but it's not readily evident you have to look up some info at two places in the doc. It would be best to also states this in the Component documentation directly :)

Thanks!

Link to comment
  • silent changed the title to [SOLVED] PROP_ARRAY_STRUCT example?
×
×
  • Create New...