#Horizontal Layout Issue

1 messages ยท Page 1 of 1 (latest)

dire maple
#

I'm not sure if I can help you, but I have an inkling of what may be the problem

#

can you post a screenshot of this?

unique scaffold
#

I added a second picture with red lines to show how the horizontal layout group is ordering things.

The first pic is the desired effect, it puts the blue and white rows after eachother. The orange box also is a child, and I want it put right after the blue boxes, but the white boxes need to be shown on top.

My latest finding is that I can't even get the position.x of the blue boxes.

#

lastRow = the gameObject of the blue boxes in the code above.

#

(I manually placed the orange box at the correct position here, since it would not be visible at all)

#

Perhaps this presents the code a bit cleaner:
https://gdl.space/sabanufeji.php

for some reason lastRow.position.x and lastRowRect.sizedelta.x return incorrect values, and the equation does not equal the value I find returned to the new position.x. ๐Ÿ˜

dire maple
#

have you tried looking at the values using Inspector (Debug) ?

#

right click the Inspector word

#

are you spawning these procedurally?

unique scaffold
unique scaffold
#

I think I can take it from here, I see some oddly behaving values now. Thanks ๐Ÿ‘

dire maple
#

Oh nice ^^

#

if you want to name them like cells in a spreadsheet, I have some code that generates Column Designations

#
private void GenerateColumnDesignations()
{
    string[] alphabet = new string[]
    {
        "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
    };

    columnDesignation = new string[columns];

    int rounds = 0;
    int letter = 0;
    string prefix = "";
    string metaPrefix = "";
    int roundIterations = 0;

    for (int i = 0; i < columns; i++, letter++)
    {
        if (letter == alphabet.Length)
        {
            if (rounds == alphabet.Length)
            {
                metaPrefix = alphabet[roundIterations];
                roundIterations++;
                rounds = 0;
            }

            prefix = alphabet[rounds];

            rounds++;
            letter = 0;
        }

        columnDesignation[i] = metaPrefix + prefix + alphabet[letter];
    }
}
#

supports up to around 18.000 columns