Results 1 to 3 of 3

Thread: toggling a menu

  
  1. #1
    dracule's Avatar
    dracule is offline Senior Member -Hacks Veteran
    Join Date
    Oct 2005
    Posts
    1,447
    Rep Power
    17

    Default

    For some reason, i just cant get this to work:

    Code:
    menuup=1
    menu = Image.load("menu.png")
    
    while true do
    if pad:l() and menuup==0 then
    			menuup=1
    			end
    if pad:l() and menuup==1 then
    			menuup=0
    			end
    
    	
    
    	if menuup==1 then
    	screen:blit(0, 0, menu)
    	end
    end
    granted thats not near all of the code I have. I just put the parts that deal with what I am aiming for (a menu that comes up when you press left shoulder uutton, and stays up untill you press left shoulder button again.


    Fd! will forever be my hero. Please take the time to vote for my group for Ecomagination: here Thanks for voting FD., Jibbz, OGTiago, Scorpus, Jsamp, killaj

  2. #2
    illfoundedmind is offline -Hacks Enthusiast
    Join Date
    Nov 2005
    Location
    WTF~~~~~~~~~~> Rank: %NULL
    Posts
    389
    Rep Power
    15

    Default

    menuup=1
    menu = Image.load("menu.png")

    while true do
    if pad:l() and menuup==0 then
    menuup=1
    end
    if pad:l() and menuup==1 then
    menuup=0
    end



    if menuup==1 then
    screen:blit(0, 0, menu)
    end
    end
    notice anything? :paranoid:
    july 19

  3. #3
    dracule's Avatar
    dracule is offline Senior Member -Hacks Veteran
    Join Date
    Oct 2005
    Posts
    1,447
    Rep Power
    17

    Default

    ohhh, i see. I thought you have 1 button handling multiple functions. Thats at least how I remember it.....

    Do you think i could have something like this:

    if pad:l() then
    flipmenu()
    end

    if i define flipmenu before?
    flipmenu() would probably end up like this:

    function flipmenu()
    if menuup==1 then
    menuup=0
    end
    if menuup==0 then
    menuup=1
    end
    end

    you get the picture.

    EDIT: never mind. it doesnt work. for some reason it will take the menu down and not put it back up.

    Fd! will forever be my hero. Please take the time to vote for my group for Ecomagination: here Thanks for voting FD., Jibbz, OGTiago, Scorpus, Jsamp, killaj

Posting Permissions

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