Draw a dartboard shape at runtime

Get help using Construct 2

Post » Wed Nov 13, 2013 4:08 pm

Hi All

I am wondering if it is possible to draw something akin to a dartboard using the Draw commands in the canvas. Essentially all i need to do is be able to draw a wedge shape - a triangle with one edge as a curve - and then be able to fill that shape with a colour. I can then set up a loop to draw all the pieces based on values in an array to produce something like this

http://www.speechmark.net/practical-suggestions-teaching-social-skills-issue-25

Many thanks

Brian
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Wed Nov 13, 2013 4:41 pm

I can imagine something like

Get a circle on the layout, with its origin point in the center. (add more circles for the 1* value, double, triple, etc)

Put a thin black sprite on the layout with its origin at the bottom and height half of that of the circle width.

On layout start, set thin sprite to image point 0 of the circle.

x=0
while x < 20
add 1 to x
circle spawn thin sprite with angle (360 / 20) * x

this wil get you the circle with the parts.


should get you on your way I supose :)lennaert2013-11-13 16:42:15
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Wed Nov 13, 2013 6:37 pm

Ok - thats approaching it from a very different angle than I was, but I see what you are trying to do. Very clever!

Will have a play and let you know how I get on

Many thanks
B
8
S
2
G
1
Posts: 45
Reputation: 1,007


Return to How do I....?

Who is online

Users browsing this forum: kofstreet and 50 guests