3057 posts
Location
United States of America
Posted 23 December 2014 - 01:00 AM
local function getY( centerx, centery, radius, x )
local origin = math.sqrt( radius^2 - (x - centerx) ^2 )
return (centery + origin), (centery - origin)
end
Using this function, you can draw a circle. However, I'm unsure of what to adjust for. I've heard multiply by .66, but if I multiply the entire result, it doesn't start at the center. Ditto for everything else I've tried. Anyone got any ides?
188 posts
Location
Adelaide, Australia
Posted 23 December 2014 - 01:03 AM
take a look at
this, the maths might help.
3057 posts
Location
United States of America
Posted 23 December 2014 - 02:03 AM
take a look at
this, the maths might help.
That is using real blocks in game, which are perfectly square. I'm trying to adjust for CC's pixels, which are rectangles roughly
2/3 by 1.
7083 posts
Location
Tasmania (AU)
Posted 23 December 2014 - 06:40 AM
Characters have a width to height ratio of 2:3, so multiplying your y offsets by two thirds should indeed do the trick. If you want the center to remain where it would've been, then I suppose just add one third of your radius to all your y offsets afterwards.
7508 posts
Location
Australia
Posted 23 December 2014 - 07:52 AM
I have a Circle Drawing function
here, which you can see on line 8 deals with the non-squared pixels.