Enum.ScaleType.Tile

TL;DR: Add tiled scaling to imagelabels with the new ScaleType Property and Enum. Add a TileSize property to customize how big the tiled image is.

The new ScaleType Property and Enum allow for GUI creators to stretch or slice their GUIs such that they work for any size. Another useful scaling type would be tiling, which is useful for backgrounds of GUIs or images that should be repeated across the whole screen while still looking good regardless of size. If a Tile ScaleType is implemented, it’d also be nice to have a TileSize property to control the size of a ‘tile’ since GUI size cannot.

8 Likes

I hope this happens, tiling should really be built in.

This would be really useful for creating GUI backgrounds for loading screens or menus.

Yes please

Like, I have to put this same individual local script into anything I want tiled:

local tile = Instance.new("ImageLabel")
tile.Image = "rbxassetid://319441740"
tile.Size = UDim2.new(0,300,0,300)
tile.BackgroundTransparency = 1


function redrawBackground()
	for _,child in next,script.Parent:GetChildren() do
		if child ~= script then
			child:Destroy()
		end
	end
	
	for x=1,math.ceil(script.Parent.AbsoluteSize.X/300) do
		for y=1,math.ceil(script.Parent.AbsoluteSize.Y/300) do
			local tile = tile:clone()
			tile.Position = UDim2.new(0,300*(x-1),0,300*(y-1))
			tile.Parent = script.Parent
		end
	end
end


script.Parent.Changed:connect(function(property)
	if property == "AbsoluteSize" then
		redrawBackground()
	end
end)
redrawBackground()

And it doesn’t even run in Edit mode.

1 Like