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.
-
jbm222
- Prole
- Posts: 4
- Joined: Fri Apr 23, 2010 5:26 am
Post
by jbm222 »
So I'm having trouble with PolygonShape:getPoints(). I'm trying to call the function like so:
Code: Select all
love.graphics.polygon("fill", myShape:getPoints())
The error I see is "Incorrect Parameter Type : Expected User Data"
Any suggestions? I should mention that even though I've been programming for several years, I am new to lua and love2d.
-
nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
-
Contact:
Post
by nevon »
I think you need to do:
Code: Select all
love.graphics.polygon("fill", unpack(myShape:getPoints()))
-
jbm222
- Prole
- Posts: 4
- Joined: Fri Apr 23, 2010 5:26 am
Post
by jbm222 »
Dumb mistake.... I tried to do myShape.getPoints() instead of myShape:getPoints(). Told you I'm new to lua.
-
bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
-
Contact:
Post
by bartbes »
nevon wrote:I think you need to do:
Code: Select all
love.graphics.polygon("fill", unpack(myShape:getPoints()))
It's not returning a table...
Users browsing this forum: Bing [Bot] and 2 guests