Is it possible to capture an event when view is being animated?

Widget

Well-Known Member
Licensed User
Longtime User
If I am using Animation.InitializeTranslate and Animation.Start(MyView) to move MyView around on the screen, how can I have a click event for MyView that will get executed when MyView is moving (being animated)?

None of the Click or Touch events will execute for the view when the view is being animated. The Activity_Touch is activated but how do I determine which view was at that X,Y location at the time the touch event was executed?

Without being able to trap an event when a view is being animated (moved), it will have severe limitations on using B4A for game playing. :sign0085:

Does the Gestures library solve this problem?

TIA
Widget
 

Widget

Well-Known Member
Licensed User
Longtime User
Clicking on the original position will raise the event. This is probably not what you want however this is managed by Android OS. Not Basic4android.
For a game it will probably be easier to draw your own objects instead of using views.

So I should forget about the Animation library and handle the movements myself? I saw your breakout game after I posted the original message and I will test to see if it is fast enough for moving 3 or 4 objects at once. Without using views, I will have to handle my own background redraws when an object moves which of course is a PIA when multiple objects overlap. But I'll give it a try. Thanks.

Widget
 
Upvote 0
Top