Button troubles

iinsanw

  • Posts: 3
I'm creating a button that when created is tinted
Then when i click this button the tint is removed and a sound plays.
The only problem is I want it so that when you click it again the tint comes back and the sound stops
but am having serious confusion on what to do with boolean functions.

Any solutions?

SadiQ

  • Posts: 1795
You can create an actor behavior and add something like this:

If mouse is pressed on self
 if tinted // tinted is a boolean
    set tinted to false
    remove all effects from self
    loop someSound
 otherwise
    set tinted to true
    add effect tint for self
    Stop sound
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

iinsanw

  • Posts: 3
I did that but the button only seemed to stay non tinted with no sound,something I'm doing wrong?

SadiQ

  • Posts: 1795
Post a screenshot of your behavior so we can see where the problem lies.
Use the camera button on the lower left side to take a picture.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.


SadiQ

  • Posts: 1795
You have it in a when created event. Whatever is below that will only happen when the actor gets created. You can use a When Mouse is pressed on actor event for what you want(it's under input -> click on actor ).
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.