I have a score system that I would like to ‘Pass a reference to’ to automatically update a text on change.
Something like this, myTextBox.text = &score;
And when score changes so does the text field, can this be done with either passing a reference to the property or by an observer?
Hey Weird, I’m curious what benefit this would have over myTextBox.text = score; I’m looking basically for a event or a listener to automatically set the value once changed through code.
defineProperty will define a new property to an object, I’m just looking to update an existing objects property.
Here’s a small sample using the global “window” object as “parent”/container.
The comments should explain, but if any doubt, just ask. https://playground.babylonjs.com/#P1S5JY