resize rectangle

Q&A about the latest versions
Post Reply
Marcus
Posts: 64
Joined: Mon Nov 08, 2021 12:17 pm

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 979 times

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

Many thanks
Marc
User avatar
Hopki
Gnome
Posts: 13004
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

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,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Marcus
Posts: 64
Joined: Mon Nov 08, 2021 12:17 pm

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
Marcus
Posts: 64
Joined: Mon Nov 08, 2021 12:17 pm

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 964 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
Post Reply