Page 1 of 1

resize rectangle

Posted: Wed Aug 17, 2022 9:37 am
by Marcus
Hi there,

I have the following simple setup - a textbox inside a rectangle. The text box has autosize = true

info.jpg
info.jpg (15.26 KiB) Viewed 1062 times

As the textbox size changes with the different text lengths, how can I configure the rectangle to automatically resize?

Many thanks
Marc

Re: resize rectangle

Posted: Wed Aug 17, 2022 11:12 am
by Hopki
Hi Marc,
There is no mechanism that will allow the parent rectangle to adjust its size depending on the text in the text box automatically.
This is why the text box has its own rectangle attributes so you don't need to have a separate rectangle, but of course, this does not work in every situation.

However, you can use actions in a button, for example, if you will have a button that will set text to the text box, the same button can set the size of the rectangle as well.

There is also the Node Changed action if changing the size of the rectangle when changing nodes as well as other source actions that can be used to trigger the size change depending on the use case.

Regards,

Re: resize rectangle

Posted: Wed Aug 17, 2022 12:22 pm
by Marcus
Hi Hopki,

Sorry, you're right, I had contained several text boxes within a rectangle ... but all I had to do was add ALL the text into a single textbox and format with CSS. The textbox now set to autosize and styled via the editor.
Apologies, had a bit of a break from Pano 2VR and just refreshing myself.

Many thanks
Marc

Re: resize rectangle

Posted: Wed Aug 17, 2022 2:22 pm
by Marcus
Hi Hopki,

As I'm now using just the textbox (no rectangle as a container) I've run into another small problem:

info2.jpg
info2.jpg (55.75 KiB) Viewed 1047 times

When the icon is clicked, I'd like the textbox to be transitioned off the screen (slid right). However, as textbox set to autosize, I do not know it's width and therefore cannot set trigger position to move -Xpx off the screen. I'd like to keep the button / icon on the screen, so I can transition the textbox back.

In the transition, I tried x = Calc(-100%) on the textbox. However, I believe calc is using the width of the textbox as defined in the skin editor, and not the actual autosized width of the textbox.

Looks like a common issue - is there a common approach to achieve this effect?

Many thanks
Marc