I had a question regarding sharing data from the parent node to a child node. Sharing fixed data like color or a double in the myCostumAPI example works, but when I want to use a speed from a textfield and it is not yet defined in “myCostumAPI”, I get stuck.
Can someone explain to me how this works, using the myCostumAPI example, or create a new small example where a Double/Int is entered in a textfield and this number can be taken over in the childNode?
I did it this way, only then I don’t get a double from the textfield, but the word “AIRSPEED”.
You don’t need to define the variables in the myCustomAPI, just the methods. Just store the Airspeed into the Data Model on the parent like any other, and in the same method you’re using to do this, call “setChildAirspeed(value)” where “value” was the textfield’s value (and what you’re storing to the model). As long as the function “setAirSpeed(Double value)” is declared in in the myCustomAPI, then the traverse() should pass this value into that method.
Then in the child node, make sure to @Override the setAirSpeed() method and then just do a basic model.set() with the value (being passed from the parent).
Hope that helps
@eric.feldmann Yeah it helped a lot! Thank you!