Entity.SetRenderBounds
From GMod Wiki
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: | |
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
Description | Update the rendering bounds so that any part of the render.DrawBeam will be rendered. |
---|---|
Used on | |
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 |
Output | none |