Results 1 to 3 of 3

Thread: variable stating code

                  
   
  1. #1
    DCEmu Legend gunntims0103's Avatar
    Join Date
    May 2006
    Location
    Brentwood, NY
    Age
    33
    Posts
    2,976
    Rep Power
    108

    Default 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.

  2. #2
    DCEmu Legend gunntims0103's Avatar
    Join Date
    May 2006
    Location
    Brentwood, NY
    Age
    33
    Posts
    2,976
    Rep Power
    108

    Default

    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...

  3. #3

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •