I have some code that generates co-ordinates to be passed to the polygon shape function, the code generates a table of coordinates of the map (I can't save the coordinates of the map to create the body that would just be stupid) the thing is the polygon shape doesn't accept a table and to my knowledge there is no way of converting a table into a series of arguments.
Can anyone shed any light on this?
nevermind IRC saves the day
There should still be an option for it to accept a table.
Passing a table to newPolygonShape?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Passing a table to newPolygonShape?
(In love 0.5,) This works for me:
points = {x1,y1,x2,y2,x3,y2}
love.graphics.polygon(type,points)
note that points is a one dimensional array.
EDIT: just realized I misread and you're talking about polygonshapes, not drawing a polygon. Still, I'm pretty sure that what I said is relevant to polygonshapes as well.
points = {x1,y1,x2,y2,x3,y2}
love.graphics.polygon(type,points)
note that points is a one dimensional array.
EDIT: just realized I misread and you're talking about polygonshapes, not drawing a polygon. Still, I'm pretty sure that what I said is relevant to polygonshapes as well.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Passing a table to newPolygonShape?
For anyone wanting to know the answer:
Code: Select all
t = {1, 2, 3, "a", "b", "c"}
unpack(t) --> 1, 2, 3, "a", "b", "c"
Who is online
Users browsing this forum: No registered users and 5 guests