D ducphu Active Member Licensed User Longtime User Aug 29, 2015 #1 Hi all, Let say I have a label. It's initial position is X1, Y1. I would like to set an animation to move it to X2, Y2, then X3, Y3, something like making a ^ move. X2Y2 X1Y1 X3Y3 I tried to use 2 SetLayoutAnimated continuously B4X: lb.SetLayoutAnimated(1000,X2,Y2,width,height) lb.SetLayoutAnimated(1000,X3,Y3,width,height) But when I test, the lb seems to be appear immediately at X2 Y2 and then move to X3 Y3, e.g I can not see the movement from X1 Y1 to X2 Y2.
Hi all, Let say I have a label. It's initial position is X1, Y1. I would like to set an animation to move it to X2, Y2, then X3, Y3, something like making a ^ move. X2Y2 X1Y1 X3Y3 I tried to use 2 SetLayoutAnimated continuously B4X: lb.SetLayoutAnimated(1000,X2,Y2,width,height) lb.SetLayoutAnimated(1000,X3,Y3,width,height) But when I test, the lb seems to be appear immediately at X2 Y2 and then move to X3 Y3, e.g I can not see the movement from X1 Y1 to X2 Y2.
Erel B4X founder Staff member Licensed User Longtime User Aug 30, 2015 #2 This code cannot work as SetLayoutAnimated is not a blocking method. You can use a timer with an interval of 1000. Start the second animation from Timer_Tick event. Another option is to use the Animation library. Upvote 0
This code cannot work as SetLayoutAnimated is not a blocking method. You can use a timer with an interval of 1000. Start the second animation from Timer_Tick event. Another option is to use the Animation library.