cancel
Showing results for 
Search instead for 
Did you mean: 

MoveAnimator - Best practice to move an object

uilter
Senior

Hi,

I'd like to discuss the best practice or approach to execute an infinite animation, like a GIF, to execute is while the screen is running.

I've done a simple Box object, as an example purpose of my subject, to help in this topic. It could be line, circle or etc. Note: My goal here is about the shapes objects only.

I'd like to know if its the best way to do it. My current touchgfx version is the 4.22.

Many thanks!

I attached my code.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Your code looks fine. Except maybe the invalidate() in the callback. This redraws the whole screen.
It is better to say seed.MoveTo(10,10). This only redraws the part where the box was and is.

Maybe do the animation back and forth, instead of jumping back.

View solution in original post

3 REPLIES 3

Your code looks fine. Except maybe the invalidate() in the callback. This redraws the whole screen.
It is better to say seed.MoveTo(10,10). This only redraws the part where the box was and is.

Maybe do the animation back and forth, instead of jumping back.

Hi @Flemming Gram CHRISTENSEN thanks for you reply!

Okay, I'll remove the invalidate().

Just a last question about the difference about the method setXY and moveTo.
The setXY just set the coordinates, unlike the moveTo function which, in addition to configuring, already invalidates the redraw?

Thanks.

Yes, that is true and the reason we have them.