playMaker

Author Topic: Scroll View - Help. (Rect Transform and Construct Count param)  (Read 1200 times)

Sergey_Russia

  • Playmaker Newbie
  • *
  • Posts: 18
Scroll View - Help. (Rect Transform and Construct Count param)
« 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?

Sergey_Russia

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Scroll View - Help. (Rect Transform and Construct Count param)
« Reply #1 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; 
}

Sergey_Russia

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Scroll View - Help. (Rect Transform and Construct Count param)
« Reply #2 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;   
}

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Scroll View - Help. (Rect Transform and Construct Count param)
« Reply #3 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