I want to implement an options screen that has things like Sound on / off etc
Any ideas how I can setup some widgets for this like toggles?
I saw the toggle.lua but I cannot seem to work out how to trap the toggle change event to then set a global variable [import]uid: 9371 topic_id: 3795 reply_id: 303795[/import]
Create functions to toggle that value on or off, and to return that value.
For the display…
3a. If using two images as buttons, set one to isVisible = false and the other to true, depending on the value returned when you check that value.
3b. If using a sprite, set frame to the desired toggle state.
Make listeners to handle the button.
When button is clicked… adjust listener to do the following.
5a. If using images, set the visibility of one to off and the other to on.
5b. If using a sprite, set frame to the desired toggle state again. [import]uid: 11024 topic_id: 3795 reply_id: 11596[/import]
Looks sweet! But it relies on aligning the sliders to a gfx background and that’s a little painful isn’t it? [import]uid: 9371 topic_id: 3795 reply_id: 11604[/import]