EFFECT.Render

From GMod Wiki

Revision as of 19:36, 4 September 2011 by mrflippy (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameRender
SyntaxEFFECT:Render( )
DescriptionDo all your rendering in here!
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=EFFECT.Render]EFFECT.Render [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionRenders a red beam from world location (0,0,0) to world location (100, 100, 100)
Used onNewerClient.png
Code
 
EFFECT.LaserMat = Material("effects/laser1")
 
function EFFECT:Think()
	return true
end
 
function EFFECT:Render()
	local startPos = Vector(0,0,0)
	local endPos = Vector(100, 100, 100)
	local width = 10
	local color = Color(255, 0, 0)
 
	render.SetMaterial(self.LaserMat)
 
	render.DrawBeam(startPos,
		endPos,
                width,
                0,
                0,
                color)
end
 
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox