Buttons not retaining images after scene change

Hi,

In my app I have the option to change the time it can be played for; infinite, 2, 5 or 10 minutes. Whenever the user taps on a button, that button changes to green.Also, infinite is set as default. This part is no problem :) However, this is what happens next.

When the user goes back to the main menu and then goes back into the options screen, the buttons have changed and now show the default setting again, in this instance, infinite is the highlighted option. I've created a few temporary actors to display the values and, by all accounts, it should work, but it doesn't.

I set it up by having the buttons call variables such as 2active and setting that to true or false. If it's true, it turns to green, if it's false, it reverts to default.

Any help/assistance anyone can give would be great.

Thanks in advance!

Best Answer

  • colandercolander Posts: 1,610
    Accepted Answer
    @welshkiwi if you stick an @ in front of their name the system will send an email letting the person know about the post.

    Every time you change the value in your attribute you must change the value in the table with the "Change Table Value" behaviour and save the table with the "Save Table" behaviour otherwise it won't remember it.

Answers

  • colandercolander Member Posts: 1,610
    edited December 2013
    @welshkiwi It must be getting reset somewhere are you saving your setting to a table or using the Save Attribute.

    EDIT: In this situation I always save it to a table. Then on my main menu I have a actor off scene called Load Saves which has a bunch of attributes set to the saved values in a table. I put it at the bottom of all the other actors so when a player goes to the main menu it is the first actor to load and run. Apparently GS loads all the actors from the bottom up.
  • DaveGWelshDaveGWelsh Member Posts: 60
    Neither at the moment, just to the variable. Should I be using one of what you suggetsted?
  • DaveGWelshDaveGWelsh Member Posts: 60
    Thanks for the update! I'll give it a go.
  • colandercolander Member Posts: 1,610
    @welshkiwi I just edited my op while you were posting see above
  • DaveGWelshDaveGWelsh Member Posts: 60
    Thanks colander. :) I'll give it a go. I was hoping I wouldn`t have to use tables on this as its just a simple app. Oh well :)
  • colandercolander Member Posts: 1,610
    @welshkiwi There are plenty of tutorial videos on tables and they are simple to use once you have done one, have fun :)
  • DaveGWelshDaveGWelsh Member Posts: 60
    Hi Colander,

    I'm not having much luck at the moment. I change the table value and it works initially, but then it doesn't seem to allow any further changes. Any words of wisdom?
  • DaveGWelshDaveGWelsh Member Posts: 60
    Thanks for the help. This was awesome!
Sign In or Register to comment.