Using multiple files, drawing

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
luaz
Citizen
Posts: 83
Joined: Sun Sep 16, 2012 2:55 pm

Using multiple files, drawing

Post 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.
If you're going to reply to my post, consider posting an (preferably working) example - 99.7% of time time, I already know how to implement the feature theoretically! ;) I don't learn very well from references, etc....
Titousensei
Prole
Posts: 13
Joined: Mon Aug 20, 2012 11:35 pm

Re: Using multiple files, drawing

Post by Titousensei »

Do you call Tutorial.draw() from the draw function in main?
luaz
Citizen
Posts: 83
Joined: Sun Sep 16, 2012 2:55 pm

Re: Using multiple files, drawing

Post by luaz »

Oh, I didn't know that.

Apparently, I'm getting errors with Advanced Tile Loader then.
If you're going to reply to my post, consider posting an (preferably working) example - 99.7% of time time, I already know how to implement the feature theoretically! ;) I don't learn very well from references, etc....
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests