How do I cover a screen with a tiled texture?

For Roblox’s previous loading screen, there was a square texture that was scaled and duplicated across columns (filled down; started new column after screen was covered). How do I figure out what size I require so I can do the duplication (for i = 1, ResultForRowsNeeded do for j = 1, i do)?

I know that the calculation required the AbsoluteSize field of the PlayerGui, that’s about it.

A seamless texture may do that work, otherwise a bunch of scripting with math.

Set the ScaleType property of the ImageLabel to Tile

2 Likes

You can use this property of ImageLabels to make an image tile repeatedly over the area of the ImageLabel.

image

rip Ninja’d

3 Likes

My mistake, I didn’t clear up that I’m already aware of the ScaleType property for ImageLabels. I specifically need to be able to perform the function I stated in the OP, which is resizing and tiling based on the AbsoluteSize property of a ScreenGui. This is because

A. I’m using Frames, not ImageLabels.
B. I need to be able to interact with each tile.

It’d be most helpful if someone had the script for the previous loading screen.

^ What a tile would look like, taken from rbxasset.

This code is not completely functional, but it may give you the right idea.

screenGui:GetPropertyChangedSignal("AbsoluteSize"):Connect(function(newAbsoluteSize)
    -- Do something to delete all but the first frame
    local numCols = math.ceil(newAbsoluteSize.X / frame.AbsoluteSize.X)
    local numRows = math.ceil(newAbsoluteSize.Y / frame.AbsoluteSize.Y)

    for i = 1, #numCols do
        for j = 1, #numRows do
            local newFrame = frame:Clone()
            newFrame.Position = UDim2.new(0, frame.AbsoluteSize.X * (i - i), 0, frame.AbsoluteSize.Y * (j - 1))
            -- Any other stuff for interaction and things
        end
    end
end)
2 Likes

And would you know it. When I was looking for it, I couldn’t find it but when I wasn’t, I suddenly found it. The answer to my question, along with other helpful responses above, is in a private model I own that is literally and so conveniently titled “roblox loadscreen tiling repro”. Wow.