Lua Syntax and Drawing a Canvas (Solved)
Posted: Sat Dec 06, 2014 4:55 am
I'm kinda' new to both lua and love, so I don't completely know how lua syntax, or the love API, work in every situation.
I'm trying to have everything be drawn to a canvas, then the canvas drawn to the window and stretched to fit it. To do this, I draw the canvas with a scaling factor of the window's dimensions divided by the canvas' dimensions. No matter what I do, my code produces errors.
Here's the line I'm having problems with:
This produces "function arguments expected near ',' " (Keep in mind, this is all one line in the actual code)
First of all, what does this mean? Can I use functions inside other functions? If I can, am I doing it right?
Even if I assign the values of the functions in question to variables first, then use the variables in the draw function, it still produces errors.
I'm trying to have everything be drawn to a canvas, then the canvas drawn to the window and stretched to fit it. To do this, I draw the canvas with a scaling factor of the window's dimensions divided by the canvas' dimensions. No matter what I do, my code produces errors.
Here's the line I'm having problems with:
Code: Select all
love.graphics.draw(mainCanvas, 0, 0, 0, love.window.getWidth/mainCanvas:getWidth, love.window.getHeight/mainCanvas:getHeight)
First of all, what does this mean? Can I use functions inside other functions? If I can, am I doing it right?
Even if I assign the values of the functions in question to variables first, then use the variables in the draw function, it still produces errors.