Garry's Mod Wiki

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

Page Links


Special Pages


Wikis

?

Render Time: 34ms

DB GetPage 2
Generate Html 8
SaveChanges (1) 10
Render Body 0
Render Sidebar 12