Garry's Mod Wiki

Panel:SetTooltipPanel

Panel:SetTooltipPanel( Panel tooltipPanel = nil )

Description

Sets the panel to be displayed as a tooltip when a player hovers over the panel object with their cursor. Note that it will not override the default DTooltip panel.

Panel:SetTooltip will override this functionality.
Calling this from PANEL:OnCursorEntered is too late! The tooltip will not be displayed or be updated.
Given panel or the previously set one will NOT be automatically removed.

Arguments

1 Panel tooltipPanel = nil
The panel to use as the tooltip.

Example

Example usage of this function

local pnl = vgui.Create( "DFrame" ) pnl:SetSize( 500, 500 ) pnl:Center() pnl:MakePopup() local p = vgui.Create( "Panel" ) p:SetSize( 100, 100 ) p:SetVisible( false ) p.Paint = function( s, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 0, 0 ) ) end local c = vgui.Create( "DButton", p ) c:SetText( "test" ) c:SetSize( 50, 50 ) c:SetPos( 5, 5 ) local b = pnl:Add( "DButton" ) b:Dock( TOP ) --b:SetTooltip( "test" ) -- This will stop SetTooltipPanel from working. b:SetTooltipPanel( p )

Page Links


Special Pages


Wikis

?

Render Time: 30ms

Session 0
DB GetPage 3
Generate Html 5
SaveChanges 8
Render Body 0
Render Sidebar 11