View Full Version: lua help =)

CheatSync.net Forums > Developement > lua help =)



Title: lua help =)


cruisx - April 28, 2007 10:24 PM (GMT)
hi i need a bit of help. umm how can i make it so that i can load the first image for 3 secconds and after 3 secconds load another image?

red=Color.new(255,0,0)
head=Image.load("images/epic.png")

while true do
screen:clear()

screen:blit(0,0,head)
screen.waitVblankStart(60)



screen.flip()
end


Waterbottle - April 28, 2007 10:30 PM (GMT)
Don't know lua, but I think this would work.

red=Color.new(255,0,0)
head=Image.load("images/epic.png")
head2=Image.load("images/epic2.png")

screen:clear()

screen:blit(0,0,head)
screen.waitVblankStart(180)
screen:blit(0,0,head2)

screen.flip()

emcp - April 29, 2007 01:49 PM (GMT)
QUOTE (Waterbottle @ Apr 28 2007, 10:30 PM)
Don't know lua, but I think this would work.

red=Color.new(255,0,0)
head=Image.load("images/epic.png")
head2=Image.load("images/epic2.png")

screen:clear()

screen:blit(0,0,head)
screen.waitVblankStart(180)
screen:blit(0,0,head2)

screen.flip()

that will work also if you need to convert hours days or minutes then you can use this


V Blank Converter

[doHTML]
<iframe
src ="http://www.freewebs.com/emcprofile/PSP_VBlank_Converter.html"
width="700" height="255">
</iframe>
[/doHTML]


mm sorry for linking off site but i tried the dotHTML and pasting the javascipt but that whacked it up

cruisx - April 29, 2007 02:15 PM (GMT)
thx a lot XD, but i have one more problem with this code


CODE
--Load images into a table
Images = {
   Image.load("images/background.jpg"),
   Image.load("images/epic.png"),
   Image.load("images/test2.jpg"),
   Image.load("images/work2.jpg")
   
}

currentImageToDisplay = 1;  

while true do
   screen:clear()
   pad = Controls.read()
   
   if pad:r() and currentImageToDisplay < table.getn(Images) then
       currentImageToDisplay = currentImageToDisplay + 1;
   end
   
   if pad:l() and currentImageToDisplay > 1 then
       currentImageToDisplay = currentImageToDisplay - 1;
   end

   screen:blit(0, 0, Images[currentImageToDisplay]);
   
   screen.waitVblankStart()
   screen.flip()
end


when i try to run it, it skips rlly fast from pic 1 to pic 2. The pics in between load for like 0.1 secconds lol. can someone pls help =)

EDIT: nvm i think i got it =D




Hosted for free by InvisionFree