What I am trying to do is get the camera to show all of the UI elements being generated, even if that means they are resized or there is a black area to the left or right of main content. Basically just trying to generate a tilemap for testing purposes right now. And yes, the length and width in tiles of the map can change. How would I go about doing this without changing the UI elements’ position in relation to each other? When I have the Canvas Scaler Scale mode Set to Constant Pixel Size, I get the look I want from the elements, but they are not within the camera viewport. If I change the Scale mode to Scale with Screen Size I still don’t get all the elements in the viewport and now they are much smaller and more spread out in relation to each other. I’ll attach some images of my canvas settings. Thanks in advance!
Oh and here is the code I am using to instantiate the tiles:
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
GameObject.Instantiate(emptyTile, new Vector3(i * tileSize, j * tileSize), Quaternion.identity, alt textGameObject.FindObjectOfType<Canvas>().transform);
}
}