cw.outline classclient
Defines the client-side cw.outline library, which draws glowing outlines around entities with halo.Add.
It is registered as the Outline plugin module and runs the AddEntityOutlines hook from PreDrawHalos, which is
where cw.outline:Add and the distance-fading cw.outline:Fader are meant to be called.
Summary
Methods
AddEntityOutlines hook with cw.outline.Methods
cw.outline:Add(entity, glowColor, glowSize, bIgnoreZ)
client gamemodes/catwork/gamemode/core/libraries/cl_outline.lua:28Draws a glowing outline around one or more entities this frame.
Wraps halo.Add, so call it every frame from the AddEntityOutlines hook.
function PLUGIN:AddEntityOutlines(outlines)
outlines:Add(self.target, Color(255, 200, 0), 2)
end
Parameters
- entity Entity The entity, or a
Listof entities - glowColor Color Color of the outline
- glowSize Number optional, defaults to
2Blur size of the outline - bIgnoreZ Boolean optional, defaults to
nilWhether the outline is drawn through walls
See also
cw.outline:Fader(entity, glowColor, iDrawDist, bShowAnyway, tIgnoreEnts, glowSize, bIgnoreZ)
client gamemodes/catwork/gamemode/core/libraries/cl_outline.lua:53Draws an outline around an entity that fades with distance and when it is out of sight.
The alpha moves smoothly towards its target and is stored on the entity as
cwLastOutlineAlpha. Call it every frame from the AddEntityOutlines hook.
Parameters
- entity Entity The entity to outline
- glowColor Color Color of the outline; its alpha is the strongest alpha used
- iDrawDist Number optional, defaults to
nilDistance at which the outline has faded out; whennilit does not fade with distance - bShowAnyway Boolean optional, defaults to
nilWhether to keep the outline when the local player cannot see the entity - tIgnoreEnts List<Entity> optional, defaults to
nilEntities ignored by the line of sight check - glowSize Number optional, defaults to
2Blur size of the outline - bIgnoreZ Boolean optional, defaults to
nilWhether the outline is drawn through walls
See also
Called when GMod halos should be added; runs the AddEntityOutlines hook with cw.outline.
The library is registered as the Outline plugin module so this runs before other hooks.