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

Alright. I’ll get on my VR Headset to see if this works.

how to Press topbar doesn’t toggle

Here’s a code sample for you:

Put this in a local script in StarterPlayerScripts

local iconModule = game:GetService("ReplicatedStorage").Icon
local icon = Icon.new()

icon.selected:Connect(function()
    print("The icon was selected")
end)

icon.deselected:Connect(function()
    print("The icon was deselected")
end)

--

How do I make a icon that cannot be selected?

1 Like

You would use

icon:lock()
1 Like

First, let me say that I’ve been very satisfied with TopBarPlus. Thank you for such a great resource.

My question is whether or not there is a way to change the font used in the text label icons?

Appreciate that!

You sure can, either create and apply a theme or apply individual settings by doing: icon:set(settingName, value).

To change the text font for example:

icon:set("iconFont", Enum.Font.GothamSemibold)
3 Likes

um why icon not working?it look like this (i get icon from Interface Tool Pro - Kenney Icons
截圖 2022-03-13 下午8.27.32

interface tools is using a spritesheet of icons, so if you tried to set a topbar button icon as an “icon” it would show the entire spritesheet

you should probably download the icons from the Kenney website (Board Game Icons, Onscreen controls, Game Icons (and Game Icons Expansion))

3 Likes

You can’t use RBXScriptConnections with modules.

Incorrect. The TopbarPlus API Documentation says you can. Please research before posting

2 Likes

Is there a way to force a icon not closing other icons? This is an issue because I have an Icon that toggles a custom player list, and another Icon that opens a separate GUI. When I toggle the separate GUI using the Icon, it force closes the other custom player list Icon, and vice versa.

EDIT: If you’d like I can provide a video

I’ve went over the entire documentation, and seems as though there’s no option to do this at the moment. I’m not sure if it’ll work but, for example you have Icon1 and Icon2. Whenever you click any one of these, check if the other one is enabled. If it is, then force enable the icon you clicked and the other icon’s visibility to true using icon:setEnabled(true).

This should help @cegberry @AridFights1 :

5 Likes

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?