Polygon drawing correctly with mode "line" but not with mode "fill"

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
User avatar
Ovidios
Prole
Posts: 29
Joined: Thu Dec 04, 2014 12:00 pm
Location: Berlin, Germay

Polygon drawing correctly with mode "line" but not with mode "fill"

Post by Ovidios »

The title pretty much says it all. This is what happens:
ss+(2017-07-05+at+11.53.01).png
ss+(2017-07-05+at+11.53.01).png (3.5 KiB) Viewed 2915 times

Here is the main.lua (although the .love is also attached to this post):

Code: Select all

function love.load()
	v = {500,300, 400,300, 400,400, 300,300, 400,200}
end

function love.draw()
	love.graphics.setColor(100, 100, 100)
	love.graphics.polygon("fill", v)
	love.graphics.setColor(255, 255, 0)
	love.graphics.polygon("line", v)
end
Can someone explain what's happening here? Thanks in advance!
Attachments
polygonProblem.love
(245 Bytes) Downloaded 103 times
User avatar
whiteland92
Prole
Posts: 12
Joined: Fri Jul 04, 2014 1:30 am

Re: Polygon drawing correctly with mode "line" but not with mode "fill"

Post by whiteland92 »

It does say on the wiki that "fill" must be convex https://love2d.org/wiki/love.graphics.polygon Image
User avatar
Ovidios
Prole
Posts: 29
Joined: Thu Dec 04, 2014 12:00 pm
Location: Berlin, Germay

Re: Polygon drawing correctly with mode "line" but not with mode "fill"

Post by Ovidios »

Huh, thanks. Now I feel stupid for missing the big yellow box, though...
Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests