checkbox/checklist

i'm a total newcomer to this and I've searched all over but can't find the answer to this: How do you make a checkable checkbox and also keep the information (if a box is checked or not) local to the user after the app is closed? I'm on the windows version if that makes any difference.
thanks in advance for any help.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    I'm sure you could code that functionality, but there is nothing built in to make that happen.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Import two images, one of the empty box and one with the box checked. create an actor from the empty box image. Make an integer attribute called self.checked. Make a rule that says If touch is pressed --> change attribute self.checked to mod(self.checked+1,2). Make another rule that says if attribute self.checked = 0 --> change image to [empty box image]. In the Else area, change image to [checked box image].
  • Frank16Frank16 Member Posts: 5
    thanks so much, Tatiang. In Preview mode I click the box and the check appears. Is there a way to make it so that I can click it once again and uncheck it, ad infinitum? thanks so much again
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    thanks so much, Tatiang. In Preview mode I click the box and the check appears. Is there a way to make it so that I can click it once again and uncheck it, ad infinitum? thanks so much again
    Did you try the coding I suggested?

  • Frank16Frank16 Member Posts: 5
    yes, but in preview mode, I click the empty box and the check comes. when i click it again to uncheck it the check remains
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Can you post a screenshot of your rules? I made a demo but I realized you're using Windows and the demo is from Mac Creator so probably not so helpful. You can try using the technique in the Video tab here to open it: http://gshelper.com/shop/free-templates-and-tutorials/mac-to-windows-template-conversion-gamesalad-tutorial.
  • Frank16Frank16 Member Posts: 5
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay... I can't actually see inside the Do and Else portions of the rule. I'll trust you have it right until I can see otherwise. :P
  • Frank16Frank16 Member Posts: 5
    sorry about that, here's a redo:

    https://www.dropbox.com/s/is3z1i2sa5ns8ph/grab2.jpg
  • BladeBearerBladeBearer Member Posts: 5
    How do you name an atrribute? I myself am on the Windows version and can't seem to do so.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    In the Mod() expression, did you type the name of the attribute self.checked? If so, you need to select it from the drop-down menu instead. That's the only thing I can think of that would cause a problem.

    In Mac Creator, you rename an attribute by double-clicking on its name. If that doesn't work, try right-clicking on it.

  • Frank16Frank16 Member Posts: 5
    my apologies for being so ignorant with all this. "mod(self.checked+1,2)" doesn't appear in any of my drop downs that I see. AM I supposed to enter this in some other area so that it does appear in a drop down? again, thanks for all the help
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Don't worry about it... we've all been there. ;)

    I'm not sure about in Windows, but it should be in the same place:

    image

    Know that you can also type in any math functions including mod() but you have to make sure that you always select attributes and tables from the drop-down menu instead of typing them directly in.
  • jordanmckjordanmck Member, PRO Posts: 16

    This is exactly what i was looking for thank you tatiang it works perfectly

Sign In or Register to comment.