I've added a function to Image like this:
function Image:printb(x,y,str,clr)
and it works ok for images but it won't work for screen:printb. I get "attempt to call method 'printb' (a nil value" I have to explicitly write the exact same routine for screen like this:
function screen:printb(x,y,str,clr)
Seems like a waste as screen is supposed to be an Image right?
Here the really weird part: when i delete the screen:printb function and save it, Image:printb will work for screen. It's only until I quit Luaplayer and run it again that I get the same error again.
Can anyone help me out?
Problems with adding a function to Image
Moderators: Shine, Insert_witty_name
-
- Posts: 31
- Joined: Sat Mar 04, 2006 1:35 am
-
- Posts: 123
- Joined: Mon Oct 03, 2005 4:25 am
- Location: Netherlands
screen is a special type of image; and it has it's own functions like screen.flip() and screen:waitVblankstart(). That's why you have to specify the function for both Image and screen. I think that when you restart luaplayer by pressing the start button or something like that the screen set of functions won't be reset/reloaded so your function will remain to exist in memory. Only when you close luaplayer, the memory will be completely cleaned
Still, I didn't even know you could add functions to screen. Nice one.
Still, I didn't even know you could add functions to screen. Nice one.
Behold! The Underminer got hold of a PSP