Options screen

Hi,

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]

Anyone? [import]uid: 9371 topic_id: 3795 reply_id: 11593[/import]

  1. Initiate the value somewhere.

  2. Create functions to toggle that value on or off, and to return that value.

  3. 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.

  4. Make listeners to handle the button.

  5. 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]

Any chance of a code sample for a newbie? [import]uid: 9371 topic_id: 3795 reply_id: 11597[/import]

Have a look (super horacebury’s work): http://developer.anscamobile.com/forum/2010/11/02/window
You can download an example #28. [import]uid: 8970 topic_id: 3795 reply_id: 11600[/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]