Page 1 of 1

Using multiple files, drawing

Posted: Thu Sep 27, 2012 1:32 am
by luaz
For some reason, I'm getting an error when trying to draw from a separate file... It's just an example code, as main.lua has grown HUGE.

Code: Select all

Tutorial = {};
function Tutorial.draw()
  love.graphics.setColor(255, 0, 255, 255)
  love.graphics.rectangle("fill", 100, 100, 100, 100 )
end
I get a black screen, OR if I set something to be drawn in main.lua, I also get the result from main.lua, but not from this file. It is included in main.lua, by the way.

Re: Using multiple files, drawing

Posted: Thu Sep 27, 2012 1:43 am
by Titousensei
Do you call Tutorial.draw() from the draw function in main?

Re: Using multiple files, drawing

Posted: Thu Sep 27, 2012 1:47 am
by luaz
Oh, I didn't know that.

Apparently, I'm getting errors with Advanced Tile Loader then.