Re: Draw Single Pixel?
Posted: Thu Nov 28, 2013 1:33 pm
It depends how you think of the LÖVE functions that makes it OO. Treat them as the tables they really are and it's not looking so OO anymore:
Still works fine and maybe shows more easily the table structure. It's just a bit easier to write it as love.graphics.print, but the meaning is the same.
Don't think of returned objects as objects. For example, love.graphics.newImage returns an image object, but I don't like objects, so I just call it an image type. Remember how in x = 5, x is now of type number? And in var = false, now var is type boolean. Well, just see LÖVE as an extension to Lua, making img = love.graphics.newImage(...) return an image type.
(In fact, I believe it's actually a userdata type, which is one of the 8 types in Lua anyway)
Code: Select all
love['graphics']['print']("Hello lol", 5, 5)
Don't think of returned objects as objects. For example, love.graphics.newImage returns an image object, but I don't like objects, so I just call it an image type. Remember how in x = 5, x is now of type number? And in var = false, now var is type boolean. Well, just see LÖVE as an extension to Lua, making img = love.graphics.newImage(...) return an image type.
(In fact, I believe it's actually a userdata type, which is one of the 8 types in Lua anyway)