Runtime/UI/Public/TnxBind.h file

TnxBind: a UI binding to a field of an entity or a view model, read from the frame on screen.

ui.Label(TnxBind(wallet, &CWallet<>::Gold), { .Notation = NumberNotation::Suffix });
ui.Progress({}, TnxBind(Player->Body, &CHealth<>::Value) / TnxBind(Player->Body, &CHealth<>::Max));
ui.Visible(TnxBind(Player->Body, &CHealth<>::Value) < 1.0f);

The first argument is an entity in a world, or any ConstructView. The field is a member of a component registered with TNX_*_FIELDS. Nothing is copied or polled: the value is read where the UI reads every binding, and a change patches what shows it.

Bindings of one entity combine with + - * / < > <= >= and with numbers. One binding has one entity: combining two is reported, with the lines that bound them, and reads as nothing.

Classes

class TnxBinding
A binding TnxBind made: a target and an expression over its fields, passed wherever a GGUI::GGBinding goes, combined with others of the same target by arithmetic and comparison.