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: 27
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 » Wed Jul 05, 2017 9:55 pm

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 1076 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 22 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 » Wed Jul 05, 2017 10:11 pm

It does say on the wiki that "fill" must be convex https://love2d.org/wiki/love.graphics.polygon Image

User avatar
Ovidios
Prole
Posts: 27
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 » Wed Jul 05, 2017 10:21 pm

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 34 guests