Hello, I am currently having an issue with loading a png image on to my programme.
The error message is:
main.lua:65: Incorrect parameter type: expected userdata.
Traceback
[C]: in function 'draw'
main.lua: in function 'draw'
[C]: in function 'xpcall'
Any help with this error would be great
I can post the code also, but I have attached the file in question on this post.
Thanks
Help with loading an image on to screen
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Help with loading an image on to screen
- Attachments
-
- main.lua
- Main code
- (3.16 KiB) Downloaded 74 times
Re: Help with loading an image on to screen
love.graphics.draw expects an Image as an argument, not a string that is the name of some image. You are passing in "barrel" instead of barrel.s (whose definion you need to uncomment again in line 29).
-
- Party member
- Posts: 125
- Joined: Wed Nov 26, 2014 6:43 am
Re: Help with loading an image on to screen
You forgot to add a image. You would need something like this:
theLocationOfTheImage would be something like
You got it?
Code: Select all
--under barrel = []
--i stands for image
barrel.i = love.graphics.newImage(theLocationOfTheImage)
Code: Select all
'textures/images/entities/barrel.png'
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests