javascript - is there any way to draw canvas images with relative positioning -


i trying have wheel on canvas multiple equal size segments similar wheel of fortune. on circumference of wheel, i.e arc of each segment, want have image attached needs rotate wheel.

i able draw multiple images, have positioned respect (0, 0) (top-left) of canvas only. there way position them relative point instead of origin? in case centre of circle (300, 300)?

you can translate origin of canvas calling .translate(x, y) method of canvas drawing context; in example both x , y 300.

see https://developer.mozilla.org/en-us/docs/web/api/canvas_api/tutorial/transformations more information on canvas transformations.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -