Page 1 of 1

noob help

Posted: Sat Apr 11, 2009 6:58 pm
by lismore
I'm just trying to follow the documentation for the second tutorial for clicking and dragging an image around, and i get this error::

"No matching function for overloaded 'draw'

Stack traceback:
[C]: in function 'draw'
main.lua:30: in function <main.lua:29>"

I don't understand, my code is not incorrect, I've even copy and pasted the code from the documentation and can't get it to work. When i download the source and run it is seems completely fine, I don't understand what I'm doing wrong here, and I'd hate to just give up on this when just getting started.

What's the deal? thanks

Re: noob help

Posted: Sat Apr 11, 2009 8:42 pm
by mikembley
The code is meant to be read as an example, as it explains what callback functions do

Copying and pasting from the example code boxes would not of worked as it was not meant to be copied and pasted, it was only pseudocode to explain each callback function. Also you would of needed the image file.

Download the full source: http://love2d.org/tutorials/002/callbackfunctions.love

Re: noob help

Posted: Sat Apr 11, 2009 8:47 pm
by lismore
maybe I should clarify. I didn't copy the code verbatim. I wrote the proper code first, and when I saw that this didn't work and i got the error I did I copied that code from the example and i still got the same traceback error. So I didn't just copy the whole code. I had applied the picture to a locally hosted image in my directory, and the picture isn't the problem, because the traceback isn't indicating that (I don't think).

I understand that the code is used as an example, and the source runs fine when i download it, but i can't view the source code for some reason (or I don't know how to open a .love file correctly into text form).

I appreciate the help, but i started moving in other directions and found that the functionality I was concerned with doesn't affect other projects. Still any input would be helpful.

best

Re: noob help

Posted: Sat Apr 11, 2009 9:06 pm
by benob
you might find that helpful: .love files are actually .zip files ;)
otherwise, post your source here.

Re: noob help

Posted: Sat Apr 11, 2009 9:07 pm
by qubodup
lismore wrote:I understand that the code is used as an example, and the source runs fine when i download it, but i can't view the source code for some reason (or I don't know how to open a .love file correctly into text form).
Too Slow: a love file is a zip file

did you write "draw" instead of "love.graphics.draw"?

did you give it correct parameters?

Too Slow: if above doesn't help: show us your code!

Re: noob help

Posted: Sun Apr 12, 2009 6:40 am
by bartbes
It sounds like the image is missing..