Touch Released Issue and Possible Work Around?
KillerPenguinStudios
Member Posts: 1,291
I am going to explain this the best I can. I have a button actor that when pressed is released it brings in the drop down menu. So rules for main button are:
When touch is released
AND
game.DropDown is false
Change game.DropDown to true
When game.DropDown is true it brings in the drop down menu and a button for the menu and when game/DropDown is false it removes the drop down. The rules in that button are:
When touch is released
AND
When game.DropDown is true
Change game.DropDown to false
The issue I am having is after I press and release the main button to trigger the drop down menu, it's always going to keep registering that is is being released and keep changing game.DropDown to true right as it changes to false. The only way to stop in is by clicking on the main button then dragging your finger off the actor then releasing. It then won't continuing to register is as being released. Hopefully my description makes sense and someone can help out!
I decided to throw a small video together to show the issue I'm having as it was a little to confusing to type out. Below is a link to check out the video.
http://s1070.photobucket.com/user/killerpenguins/media/TouchReleasedIssue_zps0a416ac4.mp4.html
Thank you in ADVANCE!
When touch is released
AND
game.DropDown is false
Change game.DropDown to true
When game.DropDown is true it brings in the drop down menu and a button for the menu and when game/DropDown is false it removes the drop down. The rules in that button are:
When touch is released
AND
When game.DropDown is true
Change game.DropDown to false
The issue I am having is after I press and release the main button to trigger the drop down menu, it's always going to keep registering that is is being released and keep changing game.DropDown to true right as it changes to false. The only way to stop in is by clicking on the main button then dragging your finger off the actor then releasing. It then won't continuing to register is as being released. Hopefully my description makes sense and someone can help out!
I decided to throw a small video together to show the issue I'm having as it was a little to confusing to type out. Below is a link to check out the video.
http://s1070.photobucket.com/user/killerpenguins/media/TouchReleasedIssue_zps0a416ac4.mp4.html
Thank you in ADVANCE!
Comments
I understand what you are saying and I know by removing the "when game.DropDown = false" condition it won't immediately change it back to true once changed to false and will technically work properly. I attached another project and this one has another button that when touch is released, it plays a sound clip. I want the sound to play when touch is released but don't want the sound clip to play when the drop down menu is active. Hope that makes sense why I had the, "when game.DropDown = false."
https://www.dropbox.com/s/vik1ixuav8znqjv/drop_down_test.zip
No as I already know how to do that. What I am trying to get working is when button, "Press me to play sound!" touch is released, play sound. But when drop down is true, I don't want you to be able to press that button to play sound. Hopefully that makes more sense!
https://www.dropbox.com/s/vik1ixuav8znqjv/drop_down_test.zip
That is what I had originally. It works in the sense that if the drop down menu is not active it will play when, "Press me to play sound!" actor's touch is released and when menu is active, it wont play if touch is released. The issue is when the menu is active and you touch then release the "Press me to play sound!" actor then press the, "Press me again" button to remover the drop down menu, since you have touched then released the, "Press me to play sound!" actor it will play the sound right as the drop down menu goes away. Then every time after that when you activate the deactivate the drop down menu, the sound will always play unless you touch the, "Press me to play sound!" actor then while touching it you drag off the actor the release in the scene off the actor, it won't play the sound when the menu is deactivated. Hopefully what I wrote makes sense.
Thank you for your response. It is a tad bit confusing how you worded your response. Would you mind taking my attached file and doing that small tweak in it and leave a note in it so I can visually see what you are referring to.
Thank you in advance!!!
https://www.dropbox.com/s/z1nllmtradodhou/drop_down_test-fix.gameproj.zip
Touch is pressed
Change attribute Game.menu to (game.menu+1)%2
In menu
When game.menu = 1
Drop down
When game.menu = 0
Go up
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Thanks for the comment! I'm not actually wanting touch released in the actor that drops the menu down. The touch released is in the Play Sound button because I want it to where if the "Player" decided that after pressing the button, they didn't want the sound to play, they could drag off the Play sound button and it wont play the sound.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
in the Play Sound prototype:
Display Text: Press Me
Rule When Touch is pressed
-- Change Attribute: self.ready? To: true
otherwise
-- Change Attribute: self.ready? To: false
Rule When Touch is released
and Game.DropDown is false
and self.ready? is true
-- Play Sound: ActionEfforts2