Support => NGUI 3 Support => Topic started by: Dover8 on March 15, 2013, 06:00:32 AM
Title: UIGrid - maxPerLine wrong (answered)
Post by: Dover8 on March 15, 2013, 06:00:32 AM
the public variable maxPerLine is either poorly named, or it's behaviour is not as intended. When setting this to 2, instead of there being 2 items in each line, there will be 2 lines.
Either the variable should be named "maxLines", or this code:
if(++x >= maxPerLine && maxPerLine >0)
{
x =0;
++y;
}
should be changed to:
if(++y >= maxPerLine && maxPerLine >0)
{
y =0;
++x;
}
Title: Re: UIGrid - maxPerLine wrong
Post by: ArenMook on March 16, 2013, 11:07:53 AM
That depends on the direction of the grid. If it's horizontal, it will be 2 items per line. If it's vertical, it will be 2 items per column.
Title: Re: UIGrid - maxPerLine wrong
Post by: Dover8 on March 18, 2013, 04:06:04 AM