Amerio.Stephane Posted January 17, 2023 Share Posted January 17, 2023 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
cash-metall Posted January 18, 2023 Share Posted January 18, 2023 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 1 Link to comment
Amerio.Stephane Posted January 18, 2023 Author Share Posted January 18, 2023 3 hours ago, cash-metall said: 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 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 Posted January 18, 2023 Share Posted January 18, 2023 Try to press "Read more" button to get the samples: How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted January 18, 2023 Author Share Posted January 18, 2023 ... (facepalm) Thank you for your patience :) Link to comment
silent Posted January 18, 2023 Share Posted January 18, 2023 No problem, we need to think how to make samples more visible :) How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts