What is the industry standard way to communicate effectively between widgets please?

No.

In such a direct case you make the top level UI that spawns the widgets keep track of the variables, and apply them to the widget.

Technically, you want to also reduce memory footprint, so it serves no ourpose having 5000 variable instances to the same value.
Practically - you actually void or make it hard to Artemony/cheatengine your variables if you have at least one or 2 “passes” that leave a copy.

But either way:
Something creates the widget and adds to screen.
That something stores the widget, then the next.
Then, if you pull from that stored reference and type the var you can set the var of that widget to the right amount.

For what you describe, this will work without complications.

Re the dispatchers.
The dispatcher is the one that sends.
Then the recevier handles the event.

Dispatcher should check “does x implement interface” before the call. So you limit casting.

The receiver implements the interface and just does what it needs. No casting needed as it works locally to itself.

1 Like