Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Groo Gadgets on July 02, 2017, 10:23:33 AM

Title: Set rect width and/or height?
Post by: Groo Gadgets on July 02, 2017, 10:23:33 AM
Hey guys,

I would like to set the width and/or height of a rect transform.

I have downloaded the "Rect Transform Get Rect" action from the ecosystem, I would like to know if there is a "Rect Transform Set Rect" action I can use?

I've tried using the "Set Property" action but I can't find a width or height property.

Any help would be great!

Cheers,

Simon
Title: Re: Set rect width and/or height?
Post by: jeanfabre on July 03, 2017, 02:45:31 AM
Hi,

 for this you need to use the dedicated RectTransform actions.
(http://i.imgur.com/YTr8adX.png)

namely "SetSizeDelta" which will affect width and heigh

you need to be very careful with the rectTransform values because the anchoring presets will use the rect values differently.

Bye,

 Jean
Title: Re: Set rect width and/or height?
Post by: Groo Gadgets on July 03, 2017, 08:03:49 AM
Ahh thank you so much Jean! I was confused since I was looking for a width or height action.

I'm actually using this action to build an expandable menu system. I can't do it without this action.  ;D
Title: Re: Set rect width and/or height?
Post by: jeanfabre on July 04, 2017, 02:31:34 AM
Hi,

 actually you can, you can change anchoring and then your system will adapt to all screen size and ratios. So make sure you fully read on rectransform and experiment with it, because animating pixels may backfire when you'll need to support various screensizes.

Bye,

 Jean