Page 1 of 1
Scripting 'fit to content'
Posted: Fri Mar 27, 2020 11:50 am
by glenn9
Hi everyone,
is it possible to script in the property browser 'fit to content' (when I hover over it the tooltip just shows either width or height but no 'fit to content' command?)
Thanks for any help.
Regards,
Glenn
Re: Scripting 'fit to content'
Posted: Fri Mar 27, 2020 11:56 am
by glenn9
apologies, my question didn't make sense, what i meant to ask is it possible to script the property browser option 'fit to content'!
Thanks,
Glenn
Re: Scripting 'fit to content'
Posted: Fri Mar 27, 2020 11:59 am
by bogs
I don't think you can do it that simply, in one line, but you can add up the widths of your objects for instance, and put that in a variable, then the height and put that in a variable, then something like (psuedo)~
set the left of this stack to ( the left of your left most object - 5)
set the width of this stack to (varW + 10)
set the height of this stack to (varH + 10)
Something like that, anyway.
Re: Scripting 'fit to content'
Posted: Fri Mar 27, 2020 1:04 pm
by Klaus
Not sure, but I suspect this is not scripted but something the engine does "on the spot".
Re: Scripting 'fit to content'
Posted: Fri Mar 27, 2020 1:15 pm
by LCMark
All the PI is doing is (I believe):
Code: Select all
set the width of <object> to the formattedWidth of <object>
OR
set the height of <object> to the formattedHeight of <object>
Re: Scripting 'fit to content'
Posted: Fri Mar 27, 2020 1:25 pm
by Klaus
Klaus wrote: ↑Fri Mar 27, 2020 1:04 pm
Not sure, but I suspect this is not scripted but something the engine does "on the spot".
Ooops, sorry, I mixed that with the "exactfit" FULLSCREENMODE.
Yep, what Mark said!