P.Button

From GMod Wiki

Jump to: navigation, search

Description

Creates a button that players can click on.

Usage

DescriptionButton that prints "Hello World!" in the console when it's clicked
Used onNewerClient.png
Code
local button = vgui.Create("Button")
button:SetSize( 150,30 )
button:Center()
button:SetText( "Click me" )
button:SetVisible( true )
function button:OnMousePressed()
	print("Hello World!")
end
Output"Hello World!"
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox