• Advertisement
Sign in to follow this  

Created Rect is bigger then circle in it, why?

This topic is 1906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
From the looks of it, you have a circle image that most likely has excess empty space around it. Make sure you trim all the excess blank space off from around the circle so that the image is no larger than the square needed to contain the circle.

However I can't be 100% positive that this is the case. It helps to be a bit more verbose with what you expect, what actually happened, and what you tried to do in order to fix it. Relevant code doesn't hurt either ;)

Hopefully it's just that you need to trim the image to fit the circle better.

EDIT: I'm making more assumptions than I usually do. I'm assuming you're making a rect with the same dimensions as your image which you want to use. Edited by caldiar

Share this post


Link to post
Share on other sites
[quote name='frob' timestamp='1351714572' post='4995926']
A link to your code would be useful.
[/quote]
Sorry, I thought there is a reson for it beside my erronous code [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[CODE]
def draw_circle(radius, color):

size = radius * 3

pict = pygame.Surface((size, size))

pygame.draw.circle( pict, color, (radius, radius), radius)

return pict, pict.get_rect()
[/CODE] Edited by Zed McJack

Share this post


Link to post
Share on other sites
[quote name='frob' timestamp='1351717922' post='4995945']
>> size = radius * 3

The width of a circle is twice its radius, not three times its radius.
[/quote]
Hey, where I was looking at? [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
Thanks a lot.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement