Forums > MaxMSP

Centering digits in a number box

July 6, 2008 | 11:41 pm

I have a GUI with a nice place to display some numbers. A numberbox, with the transparency set to full is placed appropriately to display the numbers. But I can’t seem to figure out how to center the numbers. Of course, for any given number it’s easy to center, but when the number of digits changes, the center shifts… here’s a simple patch that shows the problem — as you increase the number from 1 digit to 2 digits to 3 digits, the display appears to move to the right. So my question is if there a clever way to center the display no matter how many digits there are?

Any help much appreciated…

Bill Sethares

Here’s a patch:

— Pasted Max Patch, click to expand. —
July 7, 2008 | 12:22 am

you can use tab:

— Pasted Max Patch, click to expand. —
July 7, 2008 | 1:03 am

Thanks Ben, that’s perfect!

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP