How to: make a number box only display multiples of two

Apr 30, 2012 at 8:46pm

How to: make a number box only display multiples of two

I have a number box with a range of 32. In presentation mode, I would like a user to be able to alter this number box by dragging the mouse, however, I only ever want the user to be able to select multiples of 2. i.e dragging the box down from 32 will display 30, 28 then 26 etc. Is there anything I can do to get around this?

#63324
Apr 30, 2012 at 9:09pm

Perhaps this is the most elegant way to achieve this.

– Pasted Max Patch, click to expand. –
#228415
Apr 30, 2012 at 9:11pm

hi,
I hope this will help you :

– Pasted Max Patch, click to expand. –
#228416
Apr 30, 2012 at 9:14pm

I meant “isn’t the most elegant way…”

Also, you’ll need the .txt file for coll.

Attachments:
  1. blergh.txt
#228417
Apr 30, 2012 at 9:17pm

put lcd in background or ubutton in foreground, and use those to get mousevalues.

scale mouse data to int, then *2

#228418
Apr 30, 2012 at 9:22pm

That is exactly what I am looking for Pierre G.

#228419
Apr 30, 2012 at 11:20pm
– Pasted Max Patch, click to expand. –
#228420
May 1, 2012 at 9:01am
– Pasted Max Patch, click to expand. –
#228421
May 1, 2012 at 9:42am

Broc I think you got the ‘most elegant way’…

#228422
May 1, 2012 at 5:50pm

Awesome! I really need to explore more of the live objects. I use live.gain almost exclusively now, but I haven’t really explored the others. Thanks for posting that!

#228423
May 1, 2012 at 6:23pm

Very cool that you can set the steps in live.numbox!

But…can Pierre or anyone else explain why his patch works the way it does? It’s confounding my brain…if the result of the “if” statement comes out, shouldn’t there be a stack overflow created?

#228424
May 1, 2012 at 9:18pm

Take a closer look at his patch, there is a hidden element that helps achieve this result :)

-Be

#228425
May 5, 2012 at 9:19pm

wow, I am an idiot :D

no wonder I couldn’t figure out how the number box was responding to clicks when “ignore click”… sheesh, it was the other one. DOH!

#228426

You must be logged in to reply to this topic.