QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Homebrew and Hacks Discussion
The above video goes away if you are a member and logged in, so log in now!

A little bit of lua help

This is a discussion on A little bit of lua help within the PSP Homebrew and Hacks Discussion forums, part of the PSP Development, Hacks, and Homebrew category; I'm trying to write some LUA for the first time and I need help with one statement. If i wanted ...

Reply
 
LinkBack Thread Tools
Old 12-12-2006, 04:03 PM   #1
 
Join Date: Jul 2006
Posts: 30
Trader Feedback: 0
Default A little bit of lua help

I'm trying to write some LUA for the first time and I need help with one statement. If i wanted something to come up when you press x and then go away when you press triangle. How would i do that? Heres my code snippet for that one part=

Quote:
if pad:cross() and menustatus == 2 then
screen:clear(black)
screen:blit(0, 0, image, true)
screen.flip()
System.sleep(3000) -- I actually want it to be forever but i cant tell if nil makes it crash until the triangle exit is done
if pad:triangle() then
end
end
If you could help that would be great!

EDIT: I was surfing the homebrew and developers forums at the same time, could a dev move this?
Hockeytree is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-12-2006, 04:12 PM   #2

Mindless Self Indulgence
 
Realn0whereman's Avatar
 
Join Date: Oct 2005
Location: afk
Posts: 7,212
Trader Feedback: 0
Default

im a bit rusty w. lua but i guess pad:triangle() then dosent really have a defined then

i dont recognize screen:clear(black) and system.sleep
__________________
PSN:realn0whereman
NEW MSI ALBUM APRIL 29TH: IF
*orgasm*
Realn0whereman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-12-2006, 06:49 PM   #3
 
Join Date: Jul 2006
Posts: 30
Trader Feedback: 0
Default

Nevermind, mods can close this but heres my code snippet for displaying a picture from a menu if i can help.

this is from my index.lua
Quote:
if pad:cross() and menustatus == 1 then
dofile("scripts/menu1.lua")
end

if pad:cross() and menustatus == 2 then
dofile("scripts/menu2.lua")
end
And whats in my menu1 or menu2
Quote:
black = Color.new(0, 0, 0)

pad = Controls.read()

background = Image.load("--image you want to be displayed--")

while true do

screen:clear(black)
screen:blit(0, 0, background, true)
pad = Controls.read()

if pad:triangle() then
break
end

screen.flip()
screen.waitVblankStart()
end
Your picture will load and stay thier until you press triangle.
Not very useful, but I needed it.
Hockeytree is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-12-2006, 06:51 PM   #4
 
HeaD_ShOt's Avatar
 
Join Date: Oct 2006
Location: 貴方のうしろにいます。
Posts: 1,157
Trader Feedback: 0
Default

you know there is a lua help thread in the development forum
HeaD_ShOt is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-12-2006, 07:40 PM   #5
 
Join Date: Jul 2006
Posts: 30
Trader Feedback: 0
Default

Yep, and thats why I asked for a mod to close this.
Hockeytree is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
bit , lua

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 09:42 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us