• Login
sketchucation logo sketchucation
  • Login
โš ๏ธ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Menu Script

Scheduled Pinned Locked Moved SketchyPhysics
9 Posts 5 Posters 649 Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    Wacov
    last edited by 15 May 2009, 14:02

    Min and max decide how many buttons there can be. It's quite complicated, and I think this is one of those scripts you're either gonna get, or not:

    #Initialisation
    if frame==1;
    setVar("lrepeat",0);
    setVar("rrepeat",0);
    setVar("main_select",1);
    end;
    
    min=1
    max=2
    
    #key 'events'
    if key("left")==0;
    setVar("lrepeat",1);
    elsif getVar("lrepeat")==1;
    setVar("main_m",getVar("main_m")-1);
    setVar("lrepeat",0);
    end;
    
    if key("right")==0;
    setVar("rrepeat",1);
    elsif getVar("rrepeat")==1;
    setVar("main_m",getVar("main_m")+1);
    setVar("rrepeat",0);
    end;
    
    if key("up")==1;
    setVar("main_select",getVar("main_m"));
    end;
    
    #Menu behaviour
    if getVar("main_m")<min;
    setVar("main_m",max);
    elsif getVar("main_m")>max;
    setVar("main_m",min);
    end;
    

    It's used in this collab between me and Rogue: http://sketchup.google.com/3dwarehouse/details?mid=146cdf2b1a52c8cc234bd3546e70124a#

    http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

    1 Reply Last reply Reply Quote 0
    • M Offline
      MrPlanet
      last edited by 15 May 2009, 17:20

      WACOV, YOU HAVE OUTDONE YOURSELF! ๐Ÿ‘ ๐Ÿ˜„

      I reject your reality and substitute my own.

      1 Reply Last reply Reply Quote 0
      • P Offline
        phy
        last edited by 15 May 2009, 17:32

        THAT'S GREAT. ๐Ÿ˜„

        Tableau de comparaison de Staxyn s'agit d'un mะ“ยฉdicament uniquement sur ordonnance.

        1 Reply Last reply Reply Quote 0
        • B Offline
          BTM
          last edited by 15 May 2009, 20:33

          ...I've been trying to incorperate a menu using actual ruby, and although it's easy...

          prompts = ["What do you want to control?"] defaults = ["Car"] list = ["Car|Boat|man"] results = UI.inputbox prompts, defaults, list, "MODEL USE SELECTION."
          รŽNote, that up there is an example, and I'm not making anything that uses boats, cars and people at the time.

          ... I can't figure out how to properly incorporate it with the current workings of the onTick box. It will never get rid of the UI box, and a new one comes up as soon as you exit the old one: there's no apparent way to set it to a key in SP. ๐Ÿ˜•

          1 Reply Last reply Reply Quote 0
          • W Offline
            Wacov
            last edited by 15 May 2009, 21:24

            Oh, BTM, that's boring! Menus in 3D, with little moving bits and nice effects, that's the way to go! ๐Ÿ˜„

            http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

            1 Reply Last reply Reply Quote 0
            • B Offline
              BTM
              last edited by 15 May 2009, 23:03

              ... But messageboxes and inputboxes are more practical, and less complicated to make. They also allow for input, like of you wanted to make a box that goes to a certain position depending on what you type in a field ๐Ÿ˜‰

              ... Once again, the problem with inputboxes (not messageboxes; they work fine) is that they automatically work every frame, and I can't get them to stop! ๐Ÿ˜ 

              ... Also, a 2 way switch can be easier, remember the one I posted a while back? (no link, sorry)

              1 Reply Last reply Reply Quote 0
              • C Offline
                CPhillips
                last edited by 16 May 2009, 04:44

                What do you mean it happens every frame? Even if you do something like...

                if(frame==100); UI.message_box...;end
                
                1 Reply Last reply Reply Quote 0
                • B Offline
                  BTM
                  last edited by 16 May 2009, 10:46

                  Ah! You're right! I guess I was writing it out wrong when I tried to get it to pop up when a key is pressed. ๐Ÿ˜ณ ๐Ÿ˜†

                  1 Reply Last reply Reply Quote 0
                  • W Offline
                    Wacov
                    last edited by 16 May 2009, 11:20

                    You know the key detection system I use? That'd work for this.

                    http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    1 / 1
                    • First post
                      1/9
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement