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

Draws a glowing outline around one or more entities this frame.
Draws an outline around an entity that fades with distance and when it is out of sight.
Called when GMod halos should be added; runs the AddEntityOutlines hook with cw.outline.

Methods

cw.outline:Add(entity, glowColor, glowSize, bIgnoreZ)

client gamemodes/catwork/gamemode/core/libraries/cl_outline.lua:28

Draws 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 List of entities
  • glowColor Color Color of the outline
  • glowSize Number optional, defaults to 2 Blur size of the outline
  • bIgnoreZ Boolean optional, defaults to nil Whether 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:53

Draws 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 nil Distance at which the outline has faded out; when nil it does not fade with distance
  • bShowAnyway Boolean optional, defaults to nil Whether to keep the outline when the local player cannot see the entity
  • tIgnoreEnts List<Entity> optional, defaults to nil Entities ignored by the line of sight check
  • glowSize Number optional, defaults to 2 Blur size of the outline
  • bIgnoreZ Boolean optional, defaults to nil Whether 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.

Defined in