sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    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

      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

        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

          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

            ...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

              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

                ... 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

                  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

                    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

                      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
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement