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

Hi how can i make it a gamepass for one of the topbar like when i click it the buy button will come down?

Hey there, you can achieve that with the icon ‘selected’ event and PromptGamePassPurchase:

local marketplaceService = game:GetService("MarketplaceService")
local localPlayer = game:GetService("Players").LocalPlayer

Icon.new()
    :bindEvent("selected", function(icon)
        local GAMEPASS_ID = 0
        marketplaceService:PromptGamePassPurchase(localPlayer, GAMEPASS_ID)
        icon:deselect()
    end)
1 Like

Hello, is there any way to access One Topbar button through two localscripts?

Or i could make an modulescript which will create the topbar button, then in the 2 localscripts.
Require it?

Yep you’ll want to construct and return the icon within a module, then reference that in both scripts.

Module:

local Icon = require(pathway.to.Icon.module)

return Icon.new()
    :setLabel("Hello this is an Icon")

Script 1:

local icon = require(pathway.to.moduleScript)

Script 2:

local icon = require(pathway.to.moduleScript)
2 Likes

Thank you, i didn’t know it was possible in the first place!
:grinning: :grinning:

Topbar suffers a spammy-overextension in the example place. Appears to be a confoundance between the tween and overflow behavior.
topBarConflict

I assume this is to say mouse detection is directly dictated by actual UI dimensions?
For instance, if you put your mouse right below a button that raises on mouseover, it would spam up and down, like a certain rust website I visited.

I thus make a feature request for underlying static boxes; have the flashy transition be only aesthetic in feed. (perhaps an argument, as I do understand a menu opening in size may want said growth of mouse interest while growing for cases like nested ribbon option lists)

1 Like

Good spot, that’s just missing a basic overflow hovering check, I’ll have that fixed now.

I’m not sure what you mean by this, could you provide some examples and explain it further? Thanks.

This has been fixed in the latest release:

4 Likes

Hi
I have an icon with a dropdown list. I noticed the state of icons in the dropdown gets removed when a new icon (outside the list) is clicked.
In other words: the icon under the dropdown that was selected is suddenly deselected.

Is there a way to disable this behavior?

Hi this should help:

1 Like

Hi, i found an bug recently. When i disable and enable the local script which makes icon it duplicates
Here’s the footage

That doesn’t work however, since I want to have that enabled for other icons…

To explain my use-case better:
I want to make an icon that displays what song is currently playing, and have a button to mute the music:
image
When clicked, the “Mute music” icon must remain enabled. It should only disable when clicked again. I don’t want this icon to be influenced by other icons, while still having only one “open” at a time.

Also one bug I noticed with resizeInfo's tween (on label add/remove) is that the tween jumps back and forth when using it on an icon that has :setRight().

1 Like

This doesn’t seem to be a bug. Whenever you disable and re-enabled the script, it will run like it hasn’t started and will recreate the icons. If disabling and re-enabling the script is necessary, you can use IconController.getIcon(IconName) and see if the icon exists before creating a new one.

Expanding upon what Haydz6 said, this isn’t a bug, icons are only designed to be constructed once per client. We do however provide support for icons which reset on spawn, you can find the solution here:

This is amazing, but is it compatible/usable with mobile games or do I have to create my own UI for mobile players?

TopbarPlus fully supports PC, Mobile, Tablet and Console, and comes with internal features such as ‘overflows’ to ensure icons remain within suitable bounds. More info here:

1 Like

image
Hi how can I do this ?? to the admin

The reason this is happening is because your ‘resizeInfo’ is out of sync with your ‘repositionInfo’. You have to ensure those tween time values are the same if you want the icon to remain in its relative space, especially if using a hovering effect.

0.2 (repositionInfo) vs 0.15 (resizeInfo) for your case.

Also as a tip, you don’t have to call :set("resizeInfo", openTween) for every single icon, you can modify it within the BlueGradient themes module (or whatever theme you require) instead.

1 Like

You can customise that here:

Please note this isn’t the official help thread for that, we’ll have one setup once Nanoblox is released (feel free to DM or https://twitter.com/hdteamroblox for the time being)

1 Like

Some things for example if I can’t get out, can I ask you again?