using sprintf to dynamically size textbutton
Hello all
I'm sure I'm just being daft but I can't get sprintf to set the size of my textbutton.
I've written [sprintf script newobject textbutton @text go @varname go_button @textcolor 0.2 0.6 0.9 1. @fontface bold @fontsize 32 @patching_position %i %i]
and have tried adding @size, size, @patching_size, patching_size (followed by two integers) to set the size but nothing seems to work.
Am I missing something blindingly obvious?
Change "@patching_position 1 2" to "@patching_rect 1 2 3 4" and it will work.
Max Patch
Copy patch and select New From Clipboard in Max.
You might also want to avoid using sprintf which really made for string concatenation.
Thank you Emmanuel for a much neater solution!