Page cover

Toggle

Modular Option Widget 3 of 4

Now its time to get familiar with the widget that produces bool type - the Toggle.


This whole widget concept is so simple, so we will just cover a single important thing worth mention here. Take a look, i filled both Text fields with some particular words:

memorize what texts for On/Off i specified

Despite the Texts for On and Off states being set, there is one issue that you can not afford to neglect. Look how this displayed in the game:

"Text Block"?! And style is incorrect as well, not what you expected it to be. You might already understand why it is happening, that is because there is no initial state was pre-selected. Since this(and WholeWord as well btw) widgets are Animation-Based, it has to be at least a single animation played in order for both of those widgets to get their correct appearance. And even more important, none was setting your Option Toggle to True, as you might think looking at the Toggle's state above, so your displayed value has a 50% chance to be what it actually is.

That's why it is mandatory to Toggle to State(or Event-free) on Pre-Construct or Construct:

Last updated