3 ms·
Buttons can't remember their state. The "fire" circle shouldn't exist, and after you click and release, it should go back to idle up or hover. This diagram is
by paxys 5y ago
Buttons can't remember their state. The "fire" circle shouldn't exist, and after you click and release, it should go back to idle up or hover.
This diagram is showing more checkbox behavior rather than button.
- kmill 5y agoAh, for illustration purposes this is showing a "one-shot" button. Notice the "fire" state is a double circle -- this means that it's a terminal state for the state machine, meaning the state machine is "done" once it enters that. In practice, the fire state would be wired up to the start state of another state machine, which would be wired up to the start state of the button machine to get things going again. The "Click to Reset", notice, isn't part of the state machine itself, and instead it's modeling the stuff that happens between firing and transitioning back through "start." A button that has no "on click," so to speak, could be represented by having the fire state transition immediately back through "start."