Garry's Mod Wiki

Button

Button

Description

We advise against using this. It may be changed or removed in a future update. Only exists for backwards compatibility with Panel:SetActionFunction. Use DButton instead.

Creates a button that players can click on.

Parent

Derives from DLabel.

Example

Creates a button with the text "Click Me" that when pressed prints "Hello World!" in the console.

local button = vgui.Create( "Button" ) button:SetSize( 150, 30 ) button:Center() button:SetVisible( true ) button:SetText( "Click Me" ) function button:OnMousePressed() print( "Hello World!" ) end

Special Pages


Wikis

?

Render Time: 49ms

DB GetPage 28
Generate Html 4
SaveChanges (1) 9
Render Body 0
Render Sidebar 5