Revision Difference
halo.Add#511656
<function name="Add" parent="halo" type="libraryfunc">⤶
<description>⤶
Applies a "halo" glow effect to one or multiple entities.⤶
<warning>Using this function outside of the PreDrawHalos hook can cause instability or crashes.</warning>⤶
</description>⤶
<realm>Client</realm>⤶
<args>⤶
<arg name="entities" type="table">A table of entities to add the halo effect to</arg>⤶
<arg name="color" type="table">The desired color of the halo. See <page>Color</page></arg>⤶
<arg name="blurX" type="number" default="2">The strength of the halo's blur on the x axis.</arg>⤶
<arg name="blurY" type="number" default="2">The strength of the halo's blur on the y axis.</arg>⤶
<arg name="passes" type="number" default="1">The number of times the halo should be drawn per frame. Increasing this may hinder player FPS.</arg>⤶
<arg name="additive" type="boolean" default="true">Sets the render mode of the halo to additive.</arg>⤶
<arg name="ignoreZ" type="boolean" default="false">Renders the halo through anything when set to true.</arg>⤶
</args>⤶
</function>⤶
⤶
<example>⤶
<description>Adds a halo around all props in the map using an O(n) operation and iterating through unseen objects which can be extremely expensive to process.</description>⤶
<code>⤶
hook.Add( "PreDrawHalos", "AddPropHalos", function()⤶
halo.Add( ents.FindByClass( "prop_physics*" ), Color( 255, 0, 0 ), 5, 5, 2 )⤶
end )⤶
</code>⤶
<output>⤶
&lt;br&gt;⤶
&lt;br&gt;All the props on the map will be rendered with a red halo, a blur amount of 5, and two passes.⤶
</output>⤶
⤶
</example>⤶
⤶
⤶
<example>⤶
<description>Adds a green halo around all admins.</description>⤶
<code>⤶
hook.Add( "PreDrawHalos", "AddStaffHalos", function()⤶
local staff = {}⤶
local i = 0⤶
⤶
for _, ply in ipairs( player.GetAll() ) do⤶
if ( ply:IsAdmin() ) then⤶
i = i + 1⤶
staff[i] = ply⤶
end⤶
end⤶
⤶
halo.Add( staff, Color( 0, 255, 0 ), 0, 0, 2, true, true )⤶
end )⤶
</code>⤶
⤶
</example>