 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
matriculated
Joined: 04 Mar 2006 Posts: 31
|
Posted: Mon Mar 26, 2007 9:07 am Post subject: Problems with adding a function to Image |
|
|
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? |
|
| Back to top |
|
 |
the underminer
Joined: 03 Oct 2005 Posts: 124 Location: Netherlands
|
Posted: Tue Mar 27, 2007 6:44 pm Post subject: |
|
|
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. _________________ Behold! The Underminer got hold of a PSP |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|