PSP Hacks - Forums
Go Back   PSP Hacks - Forums > Tech Talk > LUA Scripting

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-24-2006, 12:36 PM
splodger15 splodger15 is offline
PSP Newbie
 
Join Date: Aug 2006
Posts: 39
splodger15 User Has a Beginner Reputation
Default

What i am having trouble is i want images to display one after another when x is pressed how would i do this

Thanks
__________________
Join my PSP site here: http://splodger15.forum5.com/
Reply With Quote
  #2  
Old 11-24-2006, 01:10 PM
ST@TIC ST@TIC is offline
PSP Newbie
 
Join Date: Nov 2006
Location: South Africa
Posts: 42
ST@TIC User Has a Beginner Reputation
Default

ok first you have to declare your pics
pic = {}
pic[1] = Image.load("1.jpg")
pic[2] = Image.load("2.jpg")
pic[3] = Image.load("3.jpg")
and so on..

then your count
cnt = 1 -- from 1 so it doesnt give us a error of no pic

then do this
red = Color.new(255,0,0)
while true do
pad = Controls.read()
if pad~= oldpad then
if pad:cross() then cnt = cnt + 1 end
if pad:triangle() then cnt = cnt - 1 end --to go to previous pic
if pad:start() then break end --cant forget that:mrgreen:
end
if pic[cnt] then --incase no such pic
screen:blit(0,0,pic[cnt])
else
screen:print(0,0,"Sorry no such pic",red)
end
screen:flip()
end


Hope it helps =)
__________________

\"Death be not proud, some have called thee mighty and great, thou art not so\"
Reply With Quote
  #3  
Old 11-24-2006, 01:35 PM
splodger15 splodger15 is offline
PSP Newbie
 
Join Date: Aug 2006
Posts: 39
splodger15 User Has a Beginner Reputation
Default

Thanks i will give that a try
__________________
Join my PSP site here: http://splodger15.forum5.com/
Reply With Quote
  #4  
Old 11-24-2006, 02:33 PM
splodger15 splodger15 is offline
PSP Newbie
 
Join Date: Aug 2006
Posts: 39
splodger15 User Has a Beginner Reputation
Default

I tried that and it worked but my images show and when i press x nothing happens
__________________
Join my PSP site here: http://splodger15.forum5.com/
Reply With Quote
  #5  
Old 11-24-2006, 03:01 PM
ST@TIC ST@TIC is offline
PSP Newbie
 
Join Date: Nov 2006
Location: South Africa
Posts: 42
ST@TIC User Has a Beginner Reputation
Default

i dont know what u mean by they show but x does nothing?
__________________

\"Death be not proud, some have called thee mighty and great, thou art not so\"
Reply With Quote
  #6  
Old 11-24-2006, 03:16 PM
splodger15 splodger15 is offline
PSP Newbie
 
Join Date: Aug 2006
Posts: 39
splodger15 User Has a Beginner Reputation
Default

my first image shows then you press x and then nothing happens it just stays on that image is what you posted i added my images

pic = {}
pic[1] = Image.load("images/1.PNG")
pic[2] = Image.load("images/2.PNG")
pic[3] = Image.load("images/3.PNG")
pic[4] = Image.load("images/4.PNG")


cnt = 1
cnt = 2
cnt = 3
cnt = 4


red = Color.new(255,0,0)
while true do
pad = Controls.read()
if pad~= oldpad then
if pad:cross() then cnt = cnt + 1 end
if pad:triangle() then cnt = cnt - 1 end
if pad:start() then break end
end
if pic[cnt] then
screen:blit(0,0,pic[cnt])
else
screen:print(0,0,"Sorry no such pic",red)
end
screen:flip()
end
__________________
Join my PSP site here: http://splodger15.forum5.com/
Reply With Quote
  #7  
Old 11-25-2006, 08:15 AM
ST@TIC ST@TIC is offline
PSP Newbie
 
Join Date: Nov 2006
Location: South Africa
Posts: 42
ST@TIC User Has a Beginner Reputation
Default

dude u have to use one count starting at 1, what u have done is made your count = 4.

so take out the:
cnt = 2
cnt = 3
cnt = 4

and have only this in its place:
cnt = 1

now try it sorry for late reply =) .

o and sorry forgot a line of code ( My bad =) )

cnt = 1
red = Color.new(255,0,0)
while true do
pad = Controls.read()
if pad~= oldpad then
if pad:cross() then cnt = cnt + 1 end
if pad:triangle() then cnt = cnt - 1 end
if pad:start() then break end
oldpad = pad -------Sorry forgot this
end
if pic[cnt] then
screen:blit(0,0,pic[cnt])
else
screen:print(0,0,"Sorry no such pic",red)
end
screen:flip()
end
__________________

\"Death be not proud, some have called thee mighty and great, thou art not so\"
Reply With Quote
  #8  
Old 11-25-2006, 10:49 AM
splodger15 splodger15 is offline
PSP Newbie
 
Join Date: Aug 2006
Posts: 39
splodger15 User Has a Beginner Reputation
Default

Thank you so much its finally working
__________________
Join my PSP site here: http://splodger15.forum5.com/
Reply With Quote
  #9  
Old 08-23-2008, 01:22 AM
lua scripter lua scripter is offline
PSP Newbie
 
Join Date: Aug 2008
Posts: 14
lua scripter User Has a Beginner Reputation
Default

use this code to load the image

Code:
"name"=Image.load("images/name.jpg")
do this code for the button

Code:
if pad:cross() then
screen.blit (0,0, name ,false)
screen.flip()
end
__________________


Email me your lua scripts ill fix them or help you fix them and Email you back on what you wanted :D
Reply With Quote
Reply

 



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:33 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©