cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the circle progress?

Junde
Senior II

Hi,

I want to show a circle progress like below:

Junde_1-1729159898639.png

In touchgfx's circleProgress, there is't the little circle at the progress line end;

So I am drawing the little circle and update its position realtime;

Is there any simpler way to do the same things?

And more, I need the sine() and the cosine() to calculate the position of the little circle, I find some info from HERE, but I don't know how to use it. Is there any example?

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Junde,

Unfortunately, you have to manually move/animate the circle. You can use the provided Easing Equations for animating the movement of the circle. 
Also, it would be easier to use the sin() or cos() functions that are available in math.h since the functions you mentioned are used for sophisticated drawings. But, if you really like to use them, you can see how they are used in the source code for Circle. You can access Circle.cpp from your installed TouchGFX directory\touchgfx\framework\source\touchgfx\widgets\canvas

I hope this helps you!
Don't hesitate to ask more questions if you have any!

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

3 REPLIES 3

Hello @Junde,

Unfortunately, you have to manually move/animate the circle. You can use the provided Easing Equations for animating the movement of the circle. 
Also, it would be easier to use the sin() or cos() functions that are available in math.h since the functions you mentioned are used for sophisticated drawings. But, if you really like to use them, you can see how they are used in the source code for Circle. You can access Circle.cpp from your installed TouchGFX directory\touchgfx\framework\source\touchgfx\widgets\canvas

I hope this helps you!
Don't hesitate to ask more questions if you have any!

Mohammad MORADI
ST Software Developer | TouchGFX

Thank you @Mohammad MORADI ESFAHANIASL 

math.h is work well.

Glad to hear! :D

You're very welcome!

Best regards,

 

Mohammad MORADI
ST Software Developer | TouchGFX