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

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -