I have no idea why I am getting this error, I am a new dev.
Posted: Sun Mar 28, 2021 10:55 pm
I have a table set up like this
In draw I have thissprites = {}
sprites.background = love.graphics.newImage('sprites/background.png')
sprites.player = love.graphics.newImage('sprites/player.png')
But I'm getting this errorfunction love.draw()
love.graphics.draw(sprites.background, 0, 0)
world:draw()
love.graphics.draw(sprites.player, px, py, .1, .1, sprites.player.getWidth() / 2, sprites.player.getHeight() / 2)
end
can somebody please tell me what's going on and how to fix itError
main.lua:56: bad argument #1 to 'getWidth' (Texture expected, got no value)
Traceback
[C]: in function 'getWidth'
main.lua:56: in function 'draw'
[C]: in function 'xpcall'