[v3!] TopbarPlus v3.0.0 | Construct intuitive topbar icons; customise them with themes, dropdowns, captions, labels and much more

Well, it does not anymore. Or do I need to call it after I require the TopBar+ module?
Like, I use Services.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false) (Services is my custom variable containing StarterGui service) inside ReplicatedFirst, so it does hide the Gui before TopBar+ module could start.
But maybe when I think about it, it cannot hide them because the module isn’t required :joy:. I … I will try to require it first and then I will tell the result.

Edit: So yeah, now it does hide. This was absolutely ridiculous mistake. Sorry that I’m annoying!

For anyone else searching for this, if you use :SetCoreGuiEnabled(Enum.CoreGuiType.All, false) in ReplicatedFirst's scripts and your TopBar+ icons are still present, require the TopBar+ module first :smile:.

1 Like

I have read the API; how can I set the ImageRectOffset?

You can tap into the iconImage instance for this:

icon.instances.iconImage.ImageRectOffset = ""

I think this was missed from the documentation, so I can certainly look at adding it in for the future. Thanks for highlighting!

3 Likes

I have read the documentation, but how do I stop the blue overlay thing when you press the button?

image

local menu = Icon.new()

menu:setName("Menu")

menu:setImage(5855364984)

menu:setImageYScale(0.5)

menu:set("resizeInfo", TweenInfo.new(0.2, Enum.EasingStyle.Back))

menu:setLabel("Menu", "selected")

menu:disableStateOverlay(true)
1 Like

Either change the theme so that the selected and deselected configurations are the same, or call :deselect() as soon as the icon is selected.

menu.selected:Connect(function()
   menu:deselect()
end)
3 Likes

Is there any way to change the size of the dropdown scroll frame?

These settings here should help:

For example, to extend the dropdown down you can do:

icon:set("dropdownMaxIconsBeforeScroll", 5)
3 Likes

Doens’t seem to work at all for some reason:
err
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)

image
^ error 2 times

1 Like

: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)
1 Like

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.

@ParentProfanities 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)
2 Likes

Very useful!
But how would I make a working UTC clock as an icon?

even with that code, I get the following problem:
err2

Simply utilise the os library and then set the icons text using setLabel. e.g.:

icon:setLabel("17:56")
2 Likes

Can you share error details, code, etc, or even better a link to an uncopylocked place.

2 Likes

@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

:slight_smile:

2 Likes

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:

  1. Place the LocalScript which construct the icons within a GUI with ResetOnSpawn set to false.

  2. or Place the LocalScripts within StaterPlayerScripts.

  3. 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
3 Likes

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.

2 Likes