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

I’m not 100% sure of what you wish to achieve, could you explain further?

You can achieve this by modifying icon.deselectWhenOtherIconSelected.

This isn’t possible, you’d have to create and write your own fork of TopbarPlus to achieve this.

You can also achieve this by first looking at the properties table here…

… then doing icon:set(propertName, value)

This isn’t very obvious in the docs so I plan to add more examples.

You might be interested in icon:select() and icon:deselect()

2 Likes

So essentially, when you have a key binded to a button thats inside a menu the button will do its function, but the menu will not open to show said button, even though when you open the menu the button is selected.

Is it possible to select multiple items at the same time? For example, on the Playground, there’s a ‘mute ambience’ button. I would’ve expected that to have stayed selected if I pressed other objects such as ‘shop.’

https://gyazo.com/032a41b99c5c0b0a5e5d98e2bd25723e.gif

EDIT: reading the documentation helps… future readers:
Probably worth updating the playground with this, seems to make sense IMO.

icon.deselectWhenOtherIconSelected = true
3 Likes

First of all, I found two “bugs” at once … at least I think. It is cool your Icons supports Rich text, but the function you are getting text size takes the whole text. As a result, when you try to set icon label to this string <b><font color=\"#04afec\">DPM Accounts</font></b>, the result is very very long icon: image. The second thing is the aligment - when the button is longer than the last icon’s end (that holds the hidden icons cuz of small screen size), the icon is aligned by the end of the list of icons (for right alignent the most left icon’s end) and you cannot see the whole icon.

Then, I would like to suggest a few things. (Please edit me if the thing was suggested already, I gave up at 119)
I don’t think it would be big problem, but it can short the code a little bit more - multiple iconStates!
You can handle it by reading other arguments (second and third), or by reading a table.
Example:

Icon:setLabel("Account", "deselected", "hovering")
-- or
Icon:setLabel("Account", {"deselected", "hovering"})

Aaand I forgot the two more suggestions … so maybe next time =D

I don’t think @ForeverHD can fix this, it happens in all TextObjects that has automatic scaling. It’d probably an issue Roblox need to fix themselves

1 Like

I think developer(s) is using TextService:GetTextSize() method, which probably does not handle this problem … idk now. I also think if developer(s) find it worth, he (they … sorry, I really don’t know now) would do it. I don’t know about any other auto scaling for objects, and if the function really does not support rich text, I will try to find or report the problem as bug in another article.

When I’m thinking about it, if I would test that myself this bug report does not must be there … I will try it next day

Edit: Did some fast research and found out this might be problem from Roblox, same as I already found an article about it.
And, if there is no mistake in what I’ve read, term “developers” should be right.

1 Like

How can I make Topbar only visible to people who enter their name?

You can disable the top bar using the following code

task.wait()
pcall(function()
	local starterGui = game:GetService('StarterGui')
	starterGui:SetCore("TopbarEnabled", false) --// true to enable
end)

i keep getting these errors when im trying to use it

Module code did not return exactly one value - Studio
10:02:21.124 Requested module experienced an error while loading

:setImage() doesn’t work for me :frowning:

Man, this asset is one of most useful things on Roblox. Thank you for making this. I really needed it as a beginning developer :slight_smile:

@ForeverHD You’re awesome.

P.S. I can’t wait for Nanoblox to fully come out.

1 Like

How would I be able to add a uistroke to the topbar?

Is the ID Asset ID (aka Image ID) or Decal ID? Decals won’t work.
Also, you must define the icon befower setting image:

local Icon = require(game:GetService("ReplicatedStorage").Icon) -- in hope the module is located in ReplicatedStorage

local test = Icon.new() -- you don't need to define variable, you can use the code in example instead

test:setImage(6326373239)
-- or you can use
test:setLabel("Test")
:setImage(6326373239)

Hope it helped! Otherwise I don’t know where the issue can be.

2 Likes

How to do the icon action inside the bindEvent?

Icon.new()
:bindEvent("selected", function()
	Icon:lock() -- this line doesn't work

The Image ID works the best. That’s what I did. You can also post images/decals/assets for free by the way.

End of function is missing
after you define the event

:bindEvent("selected", function()

you also need to close the function:

end)

Your code then will looks like:

Icon.new()
:bindEvent("selected", function()
	Icon:lock() -- this line should work
end)

I was writing this code from head - there is possibility I made a mistake. If I will find a mistake, I will edit this message asap.

I don’t understand your reply man …

First, the reply is dedicated for someone else.
Secondly, that one was saying his function is not working, so I tried to help him in the way I can (in hope Ben won’t need to responde).

I also know I can upload my own decals / images or even assets (like Models, etc.); only Audio and some clothing are limited by Bobuxs.

I don’t you to feel bad for your response, absolutely not, just don’t understand what you wanted to say with it, sorry.

I understand that you were asking someone else.

I was just offering extra information that I thought would be help. You can take it or leave it. Its your choice. :man_shrugging:

Also, what I mean when I said the image ID works best in Set Image for the Icon because its more generic.

1 Like

I’ve already tried several ways to enable/disable a ScreenGui called “shopFrame”. The “Test me” button is visible but when I click on the know nothing happens.

I hope below script and image helps me solve the problem.

-- Within a LocalScript in StarterPlayerScripts and assuming TopbarPlus is placed in ReplicatedStorage

local Icon = require(game:GetService("ReplicatedStorage").Icon)

local icon = Icon.new()

icon:setImage(6399193086)

icon:setLabel("Test me")

:bindEvent("deselected", function()

game.StarterGui.shopFrame.Enabled = false

end)

:bindEvent("selected", function()

game.StarterGui.shopFrame.Enabled = true

end)

image

You can’t change UI under StarterGui inside of a live game.
You’d need to do this:

player.PlayerGui.shopFrame.Enabled = boolean