M Markos Well-Known Member Licensed User Longtime User Sep 10, 2016 #1 Hi All The touch event for a panel in iOS behaviour is very different from B4A and unpredictable. I want find out if my assumptions are correct: 1) The Action_Up value is returned when you stop touching the panel 2) The Action_Down value is returned when you start touching the panel and does it repeat until you stop touching 3) The sub syntax is : Sub panel1_Touch(Action As Int, X As Float, Y As Float) As Boolean What I wish to do is to known when the panel is being touched and when it is not and get the coordinates at where it is touched and released/ I am returning true to consume the event but I get weird times the event fires and what action is reported as last experienced. Thanks for any guidance or help in advance as it's driving me crazy
Hi All The touch event for a panel in iOS behaviour is very different from B4A and unpredictable. I want find out if my assumptions are correct: 1) The Action_Up value is returned when you stop touching the panel 2) The Action_Down value is returned when you start touching the panel and does it repeat until you stop touching 3) The sub syntax is : Sub panel1_Touch(Action As Int, X As Float, Y As Float) As Boolean What I wish to do is to known when the panel is being touched and when it is not and get the coordinates at where it is touched and released/ I am returning true to consume the event but I get weird times the event fires and what action is reported as last experienced. Thanks for any guidance or help in advance as it's driving me crazy
Utopians New Member Licensed User Sep 10, 2016 #2 Code: Sub Panel1_Touch(Action As Int, X As Float, Y As Float) Select Action Case Panel1.ACTION_DOWN Log("DOWN") Case Panel1.ACTION_MOVE Log("MOVE") Case Panel1.ACTION_UP Log("X: " & X & " Y: " & Y) End Select End Sub Last edited: Sep 13, 2016 Upvote 0
Code: Sub Panel1_Touch(Action As Int, X As Float, Y As Float) Select Action Case Panel1.ACTION_DOWN Log("DOWN") Case Panel1.ACTION_MOVE Log("MOVE") Case Panel1.ACTION_UP Log("X: " & X & " Y: " & Y) End Select End Sub
Z Zakerg Member Licensed User Longtime User Sep 12, 2016 #3 I also had some issues with IOS panel touch behavior. My intention was to have the user touch the screen and keep their finger there while a sound effect played and an event triggered. In B4A using the Reflection Library, this works fine. I get the X and Y values one sound and one event is triggered. In B4I if the finger is left in place multiple sound and events can be triggered. I tried a few things to see if I could stop this from happening but nothing seemed to work. In reality I believe users tend to just tap the screen and the touch panel event works good for that. I would probably have had to add a note " For best experience keep finger on screen during sound effect" and that would have been awkward. I am concerned about the results a few user might get with a longer touch. Upvote 0
I also had some issues with IOS panel touch behavior. My intention was to have the user touch the screen and keep their finger there while a sound effect played and an event triggered. In B4A using the Reflection Library, this works fine. I get the X and Y values one sound and one event is triggered. In B4I if the finger is left in place multiple sound and events can be triggered. I tried a few things to see if I could stop this from happening but nothing seemed to work. In reality I believe users tend to just tap the screen and the touch panel event works good for that. I would probably have had to add a note " For best experience keep finger on screen during sound effect" and that would have been awkward. I am concerned about the results a few user might get with a longer touch.
narek adonts Well-Known Member Licensed User Longtime User Sep 12, 2016 #4 try this https://www.b4x.com/android/forum/t...zer-native-uigesturerecognizer.52836/#content Upvote 0
Z Zakerg Member Licensed User Longtime User Sep 12, 2016 #5 narek adonts said: try this https://www.b4x.com/android/forum/t...zer-native-uigesturerecognizer.52836/#content Click to expand... Thank you! It works great, there are no accidental extra sounds or events. Upvote 0
narek adonts said: try this https://www.b4x.com/android/forum/t...zer-native-uigesturerecognizer.52836/#content Click to expand... Thank you! It works great, there are no accidental extra sounds or events.