Entity.SetRenderBounds

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity.SetRenderBounds( Vector StartPos, Vector EndPos )
Description:
Updates the visual bounds for this entity to be draw on the screen, with the specified local vectors
Returns: nil
In Object: Entity
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetRenderBounds]Entity.SetRenderBounds [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

From gamemodes\sandbox\entities\effects\LaserTracer\init.lua

DescriptionUpdate the rendering bounds so that any part of the render.DrawBeam will be rendered.
Used onNewerClient.png
Code
 
 
function EFFECT:Init( Data )
 
	self.StartPos 	= Data:GetStart()	
	self.EndPos 	= Data:GetOrigin()
	self.Dir 		= self.EndPos - self.StartPos
 
	self:SetRenderBoundsWS( self.StartPos, self.EndPos )
 
	self.TracerTime = math.Rand( 0.2, 0.3 )
	self.Length = math.Rand( 0.1, 0.15 )
 
	// Die when it reaches its target
	self.DieTime = CurTime() + self.TracerTime
 
end
 
 
Outputnone


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox