-
Ok i have a question. This code works perfectly fine but i dont know how to continue from this point onwards.
Pad buttons.
How do i clear the buttons once they have been used so that the next time X is pressed, it will display a complete new line of text not "This Is The X Button And The Colour Used Is Green".
Code:
System.usbDiskModeActivate()
screen:clear()
green = Color.new(0, 255, 0)
red = Color.new(255, 0, 0)
blue = Color.new(0, 0, 255)
pink = Color.new(255, 20, 147)
yellow = Color.new(255, 255, 0)
A = "This Is The X Button And The Colour Used Is Green"
B = "This Is The [] Button And The Colour Used Is Red"
C = "This Is The O Button And The Colour Used Is Blue"
D = "This Is The Button And The Colour Used Is Pink"
E = "This Is The Start Button And X O [] Will Now Appear"
while true do
pad = Controls.read()
pad2 = Controls.read()
if pad:cross() then
screen:clear()
screen:print(10, 10, A, green)
screen.flip()
screen.waitVblankStart(60)
screen:clear()
screen.flip()
end
if pad:square() then
screen:clear()
screen:print(10, 20, B, red)
screen.flip()
screen.waitVblankStart(60)
screen:clear()
screen.flip()
end
if pad:circle() then
screen:clear()
screen:print(10, 30, C, blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()
screen.flip()
end
if pad:triangle() then
screen:clear()
screen:print(10, 40, D, pink)
screen.flip()
screen.waitVblankStart(60)
screen:clear()
screen.flip()
end
if pad:start() then
screen:clear()
screen:print(10, 50, E, yellow)
screen.flip()
screen.waitVblankStart(120)
screen:print(10, 10, A, green)
screen:print(10, 20, B, red)
screen:print(10, 30, C, blue)
screen:print(10, 40, D, pink)
screen:print(10, 50, E, yellow)
screen.flip()
screen.waitVblankStart(500)
screen:clear()
screen.flip()
end
end
-
You need to make a counting function so that every time you press x its the var + 1
so the var would be:
count = 0
Then you would use:
If pad:cross() then count=count+1 end
And to display stuff to the screen you would put:
If count==1 then screen:print(x, y, "whatever")
elseif count==2 then screen:print(x, y, "more text here")
end
--and so on
-
-
Is it possable to do an If inside an IF in lua?
-
-
is there any way to make the lua aplication exit to the psp menu? other than the HOME button?
-
-
-
-
virtue u said nvm to my post sorry for being gon for a day or 2 but what were you ganna say??? and if anyone wants to see my problem just go back a page thy