-
variable stating code
i was just wondering if it is possible in LUA to state a code as a variable then using the variable in a function for example
Code:
Background = Image.load("image/screen")
3d = screen:blit
3donscreen = screen:flip
3dloop = screen.waitVblankStart()
3d(0, 0, Background)
3donscreen
3dloop
end
is this code valid and can this be done. I tried this when i was implamenting a map for splonger15 in psp turismo and i just wanted to find out if i could state code as a variable. I tried it but i got errors.
-
does no one no the anwser to this?
Im just wondering so when i code i dont have to keep using the code instead i can use the variable that the code is defined as...
-
No I don't think that's possible in lua. Maybe you should use functions instead?
function Background()
return Image.load("image/screen")
end
function 3d()
screen:blit
end
function 3donscreen()
screen:flip
end
function 3dloop()
screen.waitVblankStart()
end
3d(0, 0, Background())
3donscreen()
3dloop()
end
Something like that...I couldn't really understand your code because there weren't any line breaks and I don't use PSP lua I use DSLua.