Results 1 to 4 of 4

Thread: how do i make the text stay on the screen?

  
  1. #1
    Organized_Chaos's Avatar
    Organized_Chaos is offline Senior Member -Hacks Titan
    Join Date
    May 2008
    Posts
    4,768
    Rep Power
    53963

    Default

    Here is my code. I want the text: "PAUSED --Press O to resume" to stay on the screen for a few seconds after I push X. Or maybe stay there until I press O. Right now it only displays when I am holding down the X button. Help please?

    Code:
    white = Color.new(255,255,255)
    yellow = Color.new(255,255,0)
    green = Color.new(0,255,0)
    counter = Timer.new()
    counter:start()
    while true do
    screen:clear()
    pad = Controls.read()
    currentTime = counter:time()
    screen:print(10,10,"Counter Time: " .. currentTime,white)
    if currentTime < 1000 then
    screen:print(100,100,"Less than 1000",white)
    end
    if currentTime > 1000 and currentTime < 2000 then
    screen:print(100,100,"Greater than 1000",yellow)
    end
    if currentTime > 2000 then
    counter:reset(0)
    counter:start()
    end
    if pad:cross() then
    counter:stop()
    screen:print(75,150,"PAUSED --Press O to resume",green)
    end
    if pad:circle() then
    counter:start()
    end
            if pad:start() then
                break
                end
    screen.waitVblankStart()
    screen.flip()
    end


  2. #2
    Organized_Chaos's Avatar
    Organized_Chaos is offline Senior Member -Hacks Titan
    Join Date
    May 2008
    Posts
    4,768
    Rep Power
    53963

    Default

    Anyone at all? I mean I know this section is dead but still...

    Wait.. its not dead, I heard a cricket chirping in the background. :lol:

  3. #3
    Dariusc123456 is offline -Hacks Member
    Join Date
    Jun 2008
    Posts
    214
    Rep Power
    12

    Default

    add this at the end of your code. Maybe this will help

    Code:
    screen.flip()
    while true do
    screen.waitVblankStart()
    end
    Leaving the screen.flip() on the outside of the "while" cmd.

    Hope this help, if you didnt get it.
    Have you ever want to use your computer away from your home? Do you wish you can have your desktop/laptop at the palm of your hand.

    Comming soon within 2008, homebrew program call \"NetPlay\" which will allow you to use your computer where ever you go. Ether through Adhoc or Wifi, it can be done. All you need is a router, for wifi, or a wifi card/adapter for adhoc. Goto http://www.psp-hacks.com/forums/viewtopic.php?id=146907 and learn more.

  4. #4
    lua scripter is offline -Hacks Newbie
    Join Date
    Aug 2008
    Posts
    14
    Rep Power
    0

    Default

    your code should be this
    Code:
    white = Color.new(255,255,255)
    yellow = Color.new(255,255,0)
    green = Color.new(0,255,0)
    counter = Timer.new()
    counter:start()
    while true do
    screen:clear()
    screen.flip()
    pad = Controls.read()
    currentTime = counter:time()
    screen:print(10,10,"Counter Time: " .. currentTime,white)
    if currentTime < 1000 then
    screen:print(100,100,"Less than 1000",white)
    end
    if currentTime > 1000 and currentTime < 2000 then
    screen:print(100,100,"Greater than 1000",yellow)
    end
    if currentTime > 2000 then
    counter:reset(0)
    counter:start()
    end
    if pad:cross() then
    counter:stop()
    screen:print(75,150,"PAUSED --Press O to resume",green)
    end
    if pad:circle() then
    counter:start()
    end
            if pad:start() then
                break
                end
    screen.waitVblankStart()
    screen.flip()
    end
    screen:clear() and screen.flip() need to be in the loop

Posting Permissions

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