These settings here should help:
For example, to extend the dropdown down you can do:
icon:set("dropdownMaxIconsBeforeScroll", 5)
These settings here should help:
For example, to extend the dropdown down you can do:
icon:set("dropdownMaxIconsBeforeScroll", 5)
Doens’t seem to work at all for some reason:
Code:
local Icon = require(game:GetService("ReplicatedStorage").Icon)
local skip1 = Icon.new()
:setImage(id here)
:setTip("Use this if you're stuck on a level")
:setLabel("Skip 1 Level")
:bindToggleItem(function() print("click") end)
local skip5 = Icon.new()
:setImage(id here)
:setTip("Use this if you want to speed through the game")
:setLabel("Skip 5 Levels")
:bindToggleItem(function() print("click") end)
^ error 2 times
:bindToggleItem is for UIObjects.
What you want to use instead is .Selected and .Deselected
skip5.Selected:Connect(function()
print("selected")
end)
skip5.Deselected:Connect(function()
print("deselected")
end)
Expanding on what @Haydz6 said, you can find the documentation for bindToggleItem
here:
You’ve got the right events amigo, just make sure they’re in camelCase
instead of PascalCase
.
@CassioTDS You can alternatively use bindEvent
if you wish to continue the chain. e.g.:
local Icon = require(game:GetService("ReplicatedStorage").Icon)
local skip1 = Icon.new()
:setImage(id here)
:setTip("Use this if you're stuck on a level")
:setLabel("Skip 1 Level")
:bindEvent("toggled", function(icon, isSelected)
print("click")
end)
local skip5 = Icon.new()
:setImage(id here)
:setTip("Use this if you want to speed through the game")
:setLabel("Skip 5 Levels")
:bindEvent("toggled", function(icon, isSelected)
print("click")
end)
Very useful!
But how would I make a working UTC clock as an icon?
even with that code, I get the following problem:
Simply utilise the os library and then set the icons text using setLabel
. e.g.:
icon:setLabel("17:56")
Can you share error details, code, etc, or even better a link to an uncopylocked place.
@ForeverHD do you think it’s amazing how many developers are making so many amazing games with TopbarPlus,
and think it won’t be possible without you.
so i just wanna say thank you so much.
i think this is my favorite thing made with TopbarPlus
https://www.roblox.com/library/9227995784/Custom-Bar-Gui
How do you make it so it doesn’t duplicate the icons when you respawn?
How do you get rid of the “ControllerMode” button?
Do you have a way we can bind chat commands to it like is someone says ‘!notepad’ it would trigger the button to be pressed / ui to apear and button to light up or what ever normally happens.
Your icons are duplicating because your LocalScript which creates these icons is resetting every time your LocalPlayer respawns.
You can solve this three different ways:
Place the LocalScript which construct the icons within a GUI with ResetOnSpawn
set to false
.
or Place the LocalScripts within StaterPlayerScripts.
or Put the following code at the very bottom of your LocalScript:
local icons = IconController.getIcons()
for _, icon in pairs(icons) do
IconController.clearIconOnSpawn(icon)
end
This currently can’t be modified, although I’ve opened up a ticket for exactly that here:
For the time being you can disable it by changing controllerOptionIcon:setEnabled(true)
to controllerOptionIcon:setEnabled(false)
around line 1054 of the IconController.
We don’t provide direct support for this so you could either use the new TextChatService or listen to Player.Chatted
and parse the result to achieve this, then calling icon:select()
.
Not sure if this has been reported yet, but having more than 99 notifications makes the text leave the circle. It’s a very little bug, but still one nonetheless. The only solutions I have are:
Thanks I can look into this
Hi, there are no parameters, calling icon:destroy()
is all you have to do for everything within the icon to be cleaned-up.
Hey, how do I make it when I select one of the icons. It deselects.