Drawing in LÖVE

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
sabino
Prole
Posts: 4
Joined: Thu Jun 19, 2014 4:10 pm

Drawing in LÖVE

Post by sabino »

Hi all,
reading my LÖVE reference ebook, I've found an example to draw a circle:

love.graphics.circle("fill", 200, 300, 50, 50)

"fill" means that the circle is full colored;
200 is the position X
300 is the position Y
50 is the length of the radius
and the 2nd "50" is the length of the segment.
What does it mean? If this is a circle, why there is the length of a segment?
Thank you :)
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Drawing in LÖVE

Post by Plu »

It's not the length of the segment but the number of segments. The reason it's there is because you cannot render a perfect circle on a display that only draws squares/pixels.

So you tell it how many segments to draw so that it knows roughly how accurately the circle should be drawn. If you make the number very low the circle's edge will look a little blockier but rendering will be faster; if you make the number very high the circle will look extremely round even when it's very large or if you zoom in; but rendering will be slower.

For most purposes, the default value is perfectly fine.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], slime and 5 guests