Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Sergey_Russia on October 05, 2019, 02:36:02 PM

Title: Scroll View - Help. (Rect Transform and Construct Count param)
Post by: Sergey_Russia on October 05, 2019, 02:36:02 PM
Please tell me, how can I set the height and width in the Rect Transform parameters through PlayMaker?
The Rect Transform Get Rect command is there, but the Rect Transform Set Rect command is not.
And also I did not find how it is possible to set the Construct Count parameter in the Grid Layout Group, is this possible?
If this is not done through PlayMaker, then how can this be done with a script in conjunction with PlayMaker?
Title: Re: Scroll View - Help. (Rect Transform and Construct Count param)
Post by: Sergey_Russia on October 06, 2019, 04:43:29 PM
made using a script, but now I'm trying to figure out how to change the "NumberColumnCount" variable from PlayMaker

GridLayoutGroup greed;
public int NumberColumnCount;
void Update()
{
greed = gameObject.GetComponent<GridLayoutGroup>();
       // Debug.Log(greed);
        greed.constraint = GridLayoutGroup.Constraint.FixedColumnCount;  //**
        greed.constraintCount = NumberColumnCount; 
}
Title: Re: Scroll View - Help. (Rect Transform and Construct Count param)
Post by: Sergey_Russia on October 06, 2019, 04:46:40 PM
A function call also fails.

function ApplyGrid (NumberColumnCount : int)
{
greed = gameObject.GetComponent<GridLayoutGroup>();
        greed.constraint = GridLayoutGroup.Constraint.FixedColumnCount; 
        greed.constraintCount = NumberColumnCount;   
}
Title: Re: Scroll View - Help. (Rect Transform and Construct Count param)
Post by: jeanfabre on October 07, 2019, 02:45:50 AM
Hi,

 width and height of a recttransform depends on the setup of the rect, and how it is anchored.

turn debug on on the inspector to check the actual values of each properties, then you'll know which one to control for that rect.

usually it's sizedelta property that you want to control for pixel based width/heights, else you'll need to control the anchoring themselves.
Bye,

 Jean