Comments

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    I haven't yet put sounds.

    I was working on the setting page and testing with a text actor to see if it change the attribute and the image, but it does nothing.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Well two things...

    First, you're only checking for touch DOWN, you also need to check for touch INSIDE. currently, that button will be triggered from anywhere on the screen.

    Secondly, even if you add the condition for touching INSIDE,
    Even though you have two separate rules for capturing touches, they are both fired all the time.
    So one is setting it to 1 and the other one set it immediately back to 0. causing it to flicker.

    I make toggle buttons like this:

    Create two attributes in the toggle button:
    myCurrentState(integer)
    buttonIsBeingPressed(boolean)

    Rule
    ALL
    When Mouse is DOWN
    When Mouse is INSIDE
    When buttonIsBeingPressed is FALSE
    Change Attribute: buttonIsBeingPressed to TRUE
    Change Attribute: myCurrentState to (myCurrentState+1)%2

    Rule
    When myCurrentState = 0
    Change Attribute: gameSoundsOnOff to 1
    Change Image: SoundsOFF.png

    Rule
    When myCurrentState = 1
    Change Attribute: gameSoundsOnOff to 0
    Change Image: SoundsON.png

    Rule
    When Mouse is UP
    Change Attribute: buttonIsBeingPressed to FALSE

    Hope this helps!
    Joe
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Thanks. I went for the simpler solution but it seems you have to do it the hard way...
    I didn't thought you needed so many rules for a simple button :)
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Thanks tshirtbooth your is working now (i was using / instead of %).
Sign In or Register to comment.