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

good job Ben
i’m proud of you :+1:

2 Likes

image

sorry but how to get rid of the wasd Pad icon on the Dance Animation Icon? its automatically there

here is my code

Icon.new()
		:align("Left")
		:setImage(99340692500709)
		:bindToggleKey(Enum.KeyCode.Backquote)
		:setLabel("", "Deselected")
		:setLabel("", "Selected")
		:setLabel("Backpack", "Viewing")
		:setCornerRadius(1, 0)
		:setCaption("Backpack")
		:bindEvent("selected", function()
			Toggle_Inventory(true)
		end)
		:bindEvent("deselected", function()
			Toggle_Inventory(false)
		end)

		Icon.new()
			:align("Left")
			:setImage(6995969596)
			:bindToggleKey(Enum.KeyCode.M)
			:setCornerRadius(1, 0)
			:setLabel("", "Deselected")
			:setLabel("", "Selected")
			:setLabel("Dance Animations", "Viewing")
			:setCaption("Dance Animations")
			:bindEvent("selected", function()
				Frame:TweenPosition(UDim2.new(0.05,0,0.5,0))
			end)
			:bindEvent("deselected", function()
				Frame:TweenPosition(UDim2.new(0.05,0,1.5,0))
			end)

also i wish you a merry christmas Ben!!!

hi ben, i want to report that when you reseting, menu that you already create, creating again.

How can i add scrolling bars into categories?

I’m not sure about this, but when testing topbarplus on my game, I’ve run into an increase in threads and LuauHeap memory usage of the script running all the topbarplus icons. In this test place, I tried spamming buttons and creating snapshots periodically, and I noticed a huge increase in threads + the “EXAMPLES” script increasing in size (and not going down).


In the graph section of Luauheap, the “array” part of the registry increases.

Over each snapshot, the size of EXAMPLES and the size of each thread keep increasing and not coming back down. I’m a little worried that this would cause/contribute to a memory leak in my game, so I’m just wondering is there a memory leak in topbarplus or is this just how it’s supposed to be?

Does anyone know how to make a right click detection for buttons. Like a button you can left click to do one thing and right click to do another thing, I really need this. Thanks.

The Dpad will show up in studio but not in game

When I reset it bugs out and I can’t get frames to open but it shows that the button is working and I am getting an error with the ones I have a TweenPosition set up with after reset


image

image

Is there some temporary thing I can do, like make fake invisible health bar?

1 Like

You would have to make one manually

Hiya! Is there a way to make a button Pc/Mobile only? Im making a system where i have a button that will allow mobile users to open the command bar for basic admin essentials but i dont know how to make it mobile only.

Try using:

local UIS = game:GetService("UserInputService")

if UIS.TouchEnabled then
   --code for mobile
   else
   --code for pc
end

There are laptops with touchscreen though, so I wouldn’t only do that.


@gompiegoofy
Try using this instead:

local TopbarPlus = require(game:GetService("ReplicatedStorage").TopbarPlus)
local UserInputService = game:GetService("UserInputService")
local icon = TopbarPlus.new()

if not UserInputService.TouchEnabled then
	icon:setEnabled(false)
end

UserInputService.LastInputTypeChanged:Connect(function(lastInputType)
	icon:setEnabled(lastInputType == Enum.UserInputType.Touch)
end)

Corrected these mistakes

Old Script
local TopbarPlus = require(game:GetService("ReplicatedStorage").TopbarPlus)
local UserInputService = game:GetService("UserInputService")
local icon = TopbarPlus.new()

if not UserInputService.TouchEnded then
	icon:setEnabled(false)
end

UserInputService.LastInputTypeChanged:Connect(function(lastInputType)
	icon:setEnabled(lastInputType == Enum.UserInputType.Touch and true or false)
end)
if not UserInputService.TouchEnded then
	icon:setEnabled(false)
end

It will always return true, as it is always available if you don’t have a touch device since it is an event. This is to prevent errors from occurring if you connect that event regardless of whether you have a touch device or not.
image
A better way to handle the start of that is to use

if UserInputService:GetLastInputType() ~= Enum.UserInputType.Touch then
	icon:setEnabled(false)
end

On top of that, icon:setEnabled(lastInputType == Enum.UserInputType.Touch and true or false) is a weird way of formatting that. Why not just have icon:setEnabled(lastInputType == Enum.UserInputType.Touch)? It is way better for readability.

1 Like

I’m trying to make a small settings menu and it keeps on throwing this error when i try to use setMenu() or setDropdown()

	Icon.new()
	:setLabel("Settings")
	:setDropdown({
	Icon.new()
		:setLabel("Overhead Names")
		.toggled:Connect(function()
			--code here
		end) ,
	
	Icon.new()
		:setLabel("Toggle Music")
		.toggled:Connect(function()
			--code here
		end) ,
})

scripts based off of how the readme is formatted + the documentation

update: fixed using bind events

trying out the menu bit of topbar+

is there a way to get an icon within an icon?
image

I meant TouchEnabled. Used tab to autofill without noticing it was something else.


Don’t know what I was thinking there :sweat_smile:


Works perfectly after fixing those accidental mistakes!

1 Like

does anyone know how to / wether its possible to change the buttons TextSize inside a dropdown menu

1 Like

One problem though.
Screenshot 2025-01-16 at 22.53.44
I used the newest version of topbarplus which is at v3.0.0, but it’s still like this. Does anyone know how to fix this?