Hello, how would I use both an image and a NumberSpinner in an Icon?
Nevermind, I got it to work. For anyone questioning my genius, this is what I basically did:
local Icon = require(ReplicatedStorage.Modules.Icon)
local IconController = require(ReplicatedStorage.Modules.Icon.IconController)
local NumberSpinner = require(ReplicatedStorage.Modules.NumberSpinner)
local CoinsIcon = Icon.new()
CoinsIcon:setTip("Coins")
CoinsIcon:setName("Coins")
CoinsIcon:setSize(32 * 4, 32)
CoinsIcon:setImage(8356006239)
CoinsIcon:setLabel("LOADING")
CoinsIcon:setRight()
CoinsIcon:lock()
local CoinsUI_Label = PlayerGui:WaitForChild("TopbarPlus"):WaitForChild("TopbarContainer"):WaitForChild("Coins"):WaitForChild("IconButton"):WaitForChild("IconLabel")
local CoinsCounter = NumberSpinner.fromGuiObject(CoinsUI_Label)
CoinsCounter.Decimals = 0
CoinsCounter.Prefix = ""
CoinsUI_Label.TextTransparency = 1
IconController.clearIconOnSpawn(CoinsIcon)
--// Whenever changing the number:
CoinsCounter.Value = 10000
CoinsIcon:setLabel(10000)
My issue is when I do, it doesn’t work or it either destroys the dropdown completely.
May you show what your script currently looks like so I can try and help you fix this issue?
Yoo small question, but how do I make it so it removes the old icons in case of cloning? Due to the position of my localscript (inside a folder inside the players backpack) it clones/duplicates everytime the player dies, might sound weird but dying is one of the key functions in my experience.
how would I allow players to toggle multiple buttons? Like if I add a mute music button, if they press a different button it’s no longer toggled.
Just came across this myself.
A quick look at the documentation shows that icons have a setting called
deselectWhenOtherIconSelected
, so a simple
Icon.deselectWhenOtherIconSelected = false
(or with :setProperty()
as described here)
achieves what you’re trying to achieve.
I just wanted to ask, is there a built in function that allows you to change a text-label’s property?
For some reason i can’t use more than 1 icon at the same time, could you fix it please? because it’s really annoying, if possible
Did that exact same thing and when tried to open one the other one would just simply close
set deselectWhenOtherIconSelected to false
local MyIcon = Icon.new()
MyIcon.deselectWhenOtherIconSelected = false
How would I make it so the button is clickable instead of a toggle, Im trying to create a friend invite system but i just want it to be a button, I’ve looked through the API multiple times but could not find anything.
Ohh alright never heard of this function gonna try it out thank you very much!
we need this at all costs very good
Thanks, Me and my team figured it out I’m also leaving this here for other people who have had the same issue, Hopefully this helps others figure out how to disable the toggle
local stuff = Icon.new()
:setName("Button")
:setLabel("Button")
stuff:bindEvent("selected", function()
--functionhere
stuff:deselect() -- Deselects the button so its only clickable
end)
sorry for not reply you , so it work but it just have a little bit error and i don’t care about that sometime it so annoying XD " Can only tween objects in the workspace" but don’t worry the UI still work like normal