How do I draw a filled circle only from lines with Canvas ?

Get help using Construct 2

Post » Thu Oct 30, 2014 9:57 pm

Hi.
I was trying to draw a filled circle using this algorithm : http://stackoverflow.com/a/1201304
I am aware it's certainly possible to draw a filled circle using simpler way, but I'm trying to find a fast algorithm to iterate all the pixels contained in a circle, so I'm trying things.

disk2.png


disk.png


The question is : why doesn't Canvas draw full black lines here ? The "grey" here is like 25% opacity, it should not be transparent in any way, just plain black.
You do not have the required permissions to view the files attached to this post.
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Fri Oct 31, 2014 2:57 am

The lines are being drawn on sub-pixel lines. Mouse.x and .y aren't always integers.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Fri Oct 31, 2014 8:20 pm

Thank you for your reply :)
B
12
S
7
G
7
Posts: 450
Reputation: 4,276


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, GrogIsGood, plinkie, rayolf and 7 guests