P.Button

From GMod Wiki

Revision as of 22:38, 9 August 2011 by Wizard (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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