0 Members and 3 Guests are viewing this topic.
Shouldn't that be possible? Isn't it just stored in a property of the object? Your workaround is also a good solution, but not as clean as I'd like. :pWhat do you mean, the color can be changed when drawing an image?
Mmm, I'm not really sure about that. On one side I think it's a great idea: it's always better to have more people working on something and your BetterLuaAPI has a couple of great functions. On the other hand your library takes a different approach than the one I'm working on: I'm trying to keep all drawing code in the graphic context object, all logic (like clicks) in a to-be-created screen object and I've got a couple of other different ideas... Furthermore I'm a bit like a minimalist programmer, for example (to be blunt): I don't see the point in your color table or a square function...Not to mention that I've got just 50 lines of code... What do you think?
window = getmetatable(platform.window)function window:pixels() return self:height()*self:width()endfunction on.paint(gc) gc:drawString(tostring(platform.window:pixels()),10,10,"top")end
-- Doesn't work: attempt to index local 'self' (a user data value)platform.window.screen = main-- Doesn't work, I can call the function but the function throws the same error.function window:setScreen(screen) self.screen = screenendplatform.window:setScreen(main)