Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Just wondered what a good way to create a simple on off button would be?
It depends, there some ways
Global Variable = 0 means Off, 1 means On
For instances, create an instance variable and select Boolean, you can set true or false in event.
Develop games in your browser. Powerful, performant & highly capable.
Create the item you want to use as the button (the button object or a sprite for example) Give it an instance variable called ONOFF (could be anything you want) and set it as BOOLEAN. Then on clicked with the mouse use the TOGGGLE BOOLEAN option. This will switch the FALSE (default value) to TRUE. Clicking again will switch it back ... and so on.
You just need to test for the value of the instance boolean variable.
Easier to show that describe so I knocked this up :) Hope it helps.
Mouse Right Click : Insert New Object /// Form Controls | Button
As Easy as this ...
Thank you all that has worked a charm, never knew about inverting.