Page 1 of 1

Polygon Image

Posted: Wed May 22, 2013 3:12 am
by ColourTheory
Hello,
I am using love.physics for my game, and that uses polygons for drawing, my question is, how would I make it an image?

Re: Polygon Image

Posted: Wed May 22, 2013 10:05 am
by Plu
You can use love.graphics.polygon:
http://love2d.org/wiki/love.graphics.polygon

Of course you'll have to map the coördinates of the polygon you are drawing to the ones in the shape.

If you mean an actual image, then you can just use love.graphics.draw to draw an image on top of the polygon shape.

NOTE: love.physics uses the center of an object as x,y and love.graphics uses the top left corner. So if you're seeing weird collision effects, probably the image and its shape aren't overlapping properly.