Touch Release Broken
11clock
Member Posts: 450
I've discovered that Touch Release is broken. I have 2 actors that toggle sound and music. When I release my touch on one actor, it works. Then when I try to toggle the other actor, BOTH actors are affected by the touch release. Same thing happens when I press the other button first. I can't use Touch Press because my menu is a scrollable menu and it's set up to only push a button when the finger is in the same position when it pressed and released on the button.
This is a game breaking bug. I'd really like it to be fixed.
This is a game breaking bug. I'd really like it to be fixed.
Comments
How are you doing the toggle buttons, if you do a forum search you'll see there is a nice little bit of rule you can use... something like
if button released:
Change attribute button_toggle to (Button_toggle+1)%2
Thats probably not it...but its something that looks like that.
and it will change an 'integer' number from 1 to 0, and 0 to 1.
You can then use this to turn sound on or off.
You say one button is working fine...
double check all your rules, perhaps one of you attributes is an 'integer' when it should be a 'boolean' or vice versa....
Happy to take a look if you'd like me to...
I am doing my toggles very similar to what you explained. Touch release, it will check to see if the boolean is true. If it is, set it to false, otherwise, set it to true. Then there is another rule that changes the button's appearance based on if the boolean is true or not and it changes the volume in similar manner.
its not a workaround, its modulo and the proper way to toggle in gs
However, that didn't change anything at all. The problem is still there.
make sure your attributes are 'integer' numbers and not 'booleans.'
and also if you have two buttons you will need two separate attributes (thats if they are game.attributes, should be fine if they are self.attributes.)
Then have:
if released
change attribute
(attribute+1)%2.
Then if attribute = 0
change image to image 1
Otherwise
change image to image 2
..Should work...
if its still not working
either send your project over to jon@stormystudio.com and I'll take a look tonight.
Or ask again here and one of us will try and help.
Cheers...time for some breakfast...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: Extra tip in life...when reinstalling iOS on phone, remember to set a new alarm for work...otherwise you'll wake up late.... just discovered this problem. doh!
Here are 2 screenshots of the behaviors I have in the music actor. The sound actor looks exactly the same, but with game.music replaced with game.sound and it changes the sound volume instead of the music volume. Yes, I checked all Otherwise sections as well.
http://iliveinavillage.tk/up/d684323b14d615b4a4e1cb51d00b414c.png
http://iliveinavillage.tk/up/dc7dbc0a638d097656f4117a8141efb0.png
Not entirely sure why you have the mouse positon rule (something to do with your scrolling scene).
If you just put you buttons in a new scene... and try them without the touch position rules...
does it work then?
feel free to email it to me and I'll take a quick look tonight... (1 hour left of work).
jon@stormystudio.com
Based on this, it appears that my toggable buttons aren't compatible with the scrollable menu. One work around could be to have an Options button that goes to a different scene where you can toggle the music and sound, but I want the menu to be only one scene.
I'll email you the project file. Hopefully there is a way to have the toggable buttons work on the scrollable menu, otherwise I'll simply remove the option to toggle the music and sound.
problem solved...toggle buttons on scrollable page.
changed it so each button has a self.pressed attribute.
then if button is pressed change to 0, if released change to 1
if its one then do the (attribute+1)%2 thing to toggle your value to turn some thing on or off.
...
All works well with the scroll menu so if the player touches the button it won't activate the button until they release, so if they are just scrolling the screen and don't mean to touch the button it won't go off accidentally...
Cheers
Jon
Quick advert for me:
Grab some cool templates available over at www.stormystudio.com
I'll add you in the credits as a bug fixer/beta tester/whatever they call the guys who fix bugs. What do you want to be credited as?
just buy my next game for a few cents when its launched in the distant future... :-)