drawq question
Posted: Mon Mar 19, 2012 5:25 am
Did a forum and google search, couldn't find an answer to my question. So....
I'm pretty new to Lua and LOVE, I'm getting the hang of it. I was loosely following the tutorials on the wiki, and I've ran into a problem when trying to execute.
I create a .love (quadruple checked I did it right), and I get the following:
"main.lua:68: Incorrect parameter type: expected user data."
I realized I most of put a variable in my drawq function wrong (it referenced to that point). I've tried a couple different things, used the function like it is used here:
https://love2d.org/wiki/love.graphics.newQuad (down at the bottom)
and here:
https://love2d.org/wiki/love.graphics.drawq
Neither worked.
Here is the function its in:
Also tried this:
Got anything for me?
Thanks
I'm pretty new to Lua and LOVE, I'm getting the hang of it. I was loosely following the tutorials on the wiki, and I've ran into a problem when trying to execute.
I create a .love (quadruple checked I did it right), and I get the following:
"main.lua:68: Incorrect parameter type: expected user data."
I realized I most of put a variable in my drawq function wrong (it referenced to that point). I've tried a couple different things, used the function like it is used here:
https://love2d.org/wiki/love.graphics.newQuad (down at the bottom)
and here:
https://love2d.org/wiki/love.graphics.drawq
Neither worked.
Here is the function its in:
Code: Select all
function draw_map()
for y=0, mapHeight do
for x=0, mapWidth do
love.graphics.drawq(terrainSetImage,
terrainQuads[map[y+1][x+1]],
x*terrainSize, y*terrainSize, 0, 1, 1, 0, 0)
end
end
end
Code: Select all
function draw_map()
for y=0, mapHeight do
for x=0, mapWidth do
love.graphics.drawq(terrainSetImage,
terrainQuads[map[y+1][x+1]],
x*terrainSize, y*terrainSize)
end
end
end
Thanks