draw primitives forms

17 views
Skip to first unread message

avazqu...@gmail.com

unread,
Jun 14, 2017, 11:20:54 AM6/14/17
to PlayN
Hi, All.
I have been testing drawing primitive forms on screen using canvas.
I have been able to draw some basic figures: rectangles, circles but I need draw arcs, curves. 

Is there any way I can draw these forms?

Thanks!

Michael Bayne

unread,
Jun 14, 2017, 11:28:44 AM6/14/17
to pl...@googlegroups.com
On Wed, Jun 14, 2017 at 8:20 AM, <avazqu...@gmail.com> wrote:
Is there any way I can draw these forms?

Use Canvas.createPath() and then the Path API to draw curved shapes:

http://playn.io/docs/api/core/playn/core/Path.html

Then you can stroke or fill the path to a Canvas.

avazqu...@gmail.com

unread,
Jun 14, 2017, 6:28:17 PM6/14/17
to PlayN
Thanks, Michael!!
I can see that there isn't specific function to draw arcs (Ex: arc(x, y, radius, startAngle, endAngle, counterClockwise)).
Is there any way to draw an arc using the functions we have available (bezierTo / quadraticCurveTo)?
I have been looking but I don't find anything similar. I have also been playing with the bezierTo / quadraticCurveTo functions but I can't correctly draw an arc.
Reply all
Reply to author
Forward
0 new messages