Garry's Mod Wiki

DTooltip

Description

This is used internally - although you're able to use it you probably shouldn't.

The panel used internally for tool tips. See Panel:SetTooltip.

Parent

Derives from DLabel.

Methods

DTooltip:Close()
Forces the tooltip to close. This will remove the panel.
DTooltip:DrawArrow( number x, number y )
Used to draw a triangle beneath the DTooltip Requires DTooltip:SetContents, without this it will error
DTooltip:OpenForPanel( Panel pnl )
Sets up the tooltip for display for given panel and starts the timer.
DTooltip:PositionTooltip()
This is used internally - although you're able to use it you probably shouldn't. Positions the DTooltip so it doesn't stay in the same draw position.
DTooltip:SetContents( Panel panel, boolean bDelete = false )
What Panel you want put inside of the DTooltip You can only have one Panel at a time; use Parenting to add more

Example

Drawing a Tool Tip manually, then painting over it.

local DFrame = vgui.Create( "DFrame" ) DFrame:SetPos( 100, 100 ) DFrame:SetSize( 100, 100 ) local DTooltip = vgui.Create( "DTooltip" ) DTooltip:SetPos( 0, 0 ) DTooltip:SetSize( 250, 50 ) DTooltip:SetText( "Manual Tooltip" ) DTooltip:OpenForPanel( DFrame ) DTooltip:PositionTooltip() DTooltip.Paint = function() draw.RoundedBox( 5, 0, 0, 250, 50, Color( 255, 255, 255, 255 ) ) end

Page Links


Special Pages


Wikis

?

Render Time: 81ms

DB GetPage 44
Generate Html 4
SaveChanges (1) 14
Render Body 0
Render Sidebar 16