Insert decal directly into texture when selected

As a Roblox developer, it is currently annoying to change the image of imagelabels and textures, Because when you insert an image from the toolbox, it often tries to place it on a part in the form of a decal. Then you have to copy and paste the content from that decal and put it in the desired texture/imagelabel and then delete the decal

Now a relatively easy and simple feature would be that if you have a texture or imagelabel selected, it applies the ID of the image onto the texture/imagelabel, instead of trying to place it as a decal on a part.

10 Likes

Actually, wouldn’t it be easier to have a way to right-click a decal in your toolbox and click Copy Asset ID or something like that?

7 Likes

I completely agree. Working with Images is difficult because all of the old tools expect them to be used as decals. It would be great if we could copy the image id from the insert menu and if inserting a “decal” into a Image gui or a Texture would apply the image to the gui/texture.


In the meantime, I made a super-simple plugin that will make Image guis and Texture objects get the image when you insert a decal with one selected.

If you want to see the super-short source of the plugin before taking it, here it is!
local Selection = game:GetService("Selection")
local decalConn
local enable, disable

local on = false

function enable()
	disable()
	on = true
	decalConn = game.DescendantAdded:Connect(function(d)
		if tostring(d) == "Decal" and d:IsA("Decal") then
			if d.Parent:IsA("GuiBase") and d.Parent.ClassName:match("^Image") then
				local s = Selection:Get()
				d.Parent.Image = "rbxassetid://"..d.Texture:match("%d+")
				wait()
				d:Destroy()
				Selection:Set(s)
			elseif d.Parent:IsA("Texture") then
				local s = Selection:Get()
				d.Parent.Texture = "rbxassetid://"..d.Texture:match("%d+")
				wait()
				d:Destroy()
				Selection:Set(s)
			end
		end
	end)
end

function disable()
	on = false
	if decalConn then
		decalConn:disconnect()
		decalConn = nil
	end
end

---

local toolbar = plugin:CreateToolbar("Gui Decal")

local button = toolbar:CreateButton("Toggle","Toggle Gui Decal on/off", "rbxassetid://1056701164")

local wasOn = plugin:GetSetting("WasOn")

if wasOn or wasOn == nil then
	enable()
	button:SetActive(true)
end

button.Click:Connect(function()
	if on then
		disable()
		button:SetActive(false)
	else
		enable()
		button:SetActive(true)
	end
	plugin:SetSetting("WasOn", on)
end)

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.