Panel.Think

From GMod Wiki

(Redirected from DCheckBox.Think)
Jump to: navigation, search
Event Hook
Hook NameThink
SyntaxPANEL:Think( )
DescriptionThis event is called each frame.
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Panel.Think]Panel.Think [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionA label on a DFrame counts up every Think.
Used onNewerClient.png
Code
local WikiCount = 0
 
local WikiFrame = vgui.Create("DFrame")
WikiFrame:SetPos(ScrW() / 3, ScrH() / 3)
WikiFrame:SetSize(23,20)
WikiFrame:SetVisible(true)
WikiFrame:MakePopup()
 
local WikiLabel = vgui.Create("DLabel", WikiFrame)
WikiLabel:SetPos(5, 5)
WikiLabel:SetText("Time: 0")
WikiLabel:SizeToContents()
 
function WikiFrame:Think()
	WikiCount = WikiCount + 1
 
	WikiLabel:SetText("Time: "..WikiCount)
	WikiLabel:SizeToContents()	
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox