N
NoFontNL
Guest
I have a circle, divided into optionCount parts. How would I go about drawing sprites on each
center of one part.
The sprites are located in the variable item[n] where n is the sprite index.
So item[0] would be sprite 1 in above image.
How do I calculate the positions of the sprites?
I wanted an universal method which works with every optionCount.
I thought of using
But that doesn't work. Any help would be appreciated.
center of one part.
The sprites are located in the variable item[n] where n is the sprite index.
So item[0] would be sprite 1 in above image.
How do I calculate the positions of the sprites?
I wanted an universal method which works with every optionCount.
I thought of using
Code:
for (var i = 0; i<optionCount; i++){
var dir = i/optionCount*360 + 1/optionCount*360/2;
draw_sprite(item[i],0,x+lengthdir_x(128,dir),y+lengthdir_y(128,dir));
}