env_sprite
Class hierarchy |
---|
CSprite |
Sprite.cpp
|
env_sprite
is a point entity available in all Source games. It creates a sprite in the world. Sprites always face the player.
Important:This is a preserved entity in .
- On a new round entities with this classname will intentionally not reset. You can use
logic_auto
to emulate resetting it. - Killing it removes it forever, as it is not respawned on a new round.
- It cannot be spawned with a
point_template
. - Parenting this with non preserved entities may have undesirable effects.
Note:The only render modes that render sprite transparency are Glow, Additive, Additive Fractional Frame, World Space Glow and Alpha Add !FGD.
Bug:Although the sprite preview in Hammer can find the sprite with any or no file extension, the actual extension of the used material must be used for the engine to be able to find the sprite in-game. In engine versions before Source 2009, when choosing a sprite from the sprite browser, the name it provides does not contain the required
.spr
/.vmt
file extension, so it must be adjusted by hand. [todo tested in?]AltNames: This entity is also tied to
env_glow
. Contents
Flags
- Start on : [
1
] - Play Once : [
2
]
Used for animated sprites; texture will animate once, then the sprite will turn off.
Keyvalues
- Name
(targetname)
<string> - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Sprite Name
(model)
<string> - The material to draw.
- Scale
(scale)
<float> - Scale multiplier of the sprite.
- Note:Hammer's default sprite scale
0.25
, but the engine's is1.0
. To synchronise the values, set this keyvalue to something. - Warning:The precision of this value is limited in multiplayer. The maximum scale is 64 and the value will be rounded to an upper power of 2 (64, 32, 16, 8, 4, 2, 1, 0.5, 0.25, 0.125...). Garry's Mod fixes this and uses full precision. This may lead to desynced scaling, for example, if a map made for another game uses a value of 40, it will get rounded up to 64 in that game but will remain at 40 in .
- Framerate
(framerate)
<string> - Rate at which the sprite should animate, if at all.
- Starting Frame
(frame)
<float> !FGD - If the sprite is animated, the frame it should start animating on.
- Size of Glow Proxy Geometry
(GlowProxySize)
<float> - Size of the glow to be rendered for visibility testing. Any time a sphere of this radius would be visible (poking through any nearby geometry), the glow will be rendered.
- HDR color scale
(HDRColorScale)
<float> - Color multiplier for players using HDR.
RenderFields:
- Render Mode
(rendermode)
<choices> - Set a non-standard rendering mode on this entity.
- Render FX
(renderfx)
<choices> - Various somewhat legacy alpha effects. See render effects
- Render Amount / Transparency
(renderamt)
<integer 0–255> - Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
- Render Color (R G B)
(rendercolor)
<color255> - Color tint.
- Disable Receiving Shadows
(disablereceiveshadows)
<boolean> - Prevent the entity from receiving shadows on itself.
- Minimum / Maximum DX Level
(mindxlevel / maxdxlevel)
<integer choices> (removed since ) - The entity will not exist if the engine is running outside the given range of DirectX Versions.
Warning:
|
- Minimum / Maximum Effect Details Level
(mincpulevel / maxcpulevel)
<integer choices> (in all games since ) - Don't render for players with Effect Details levels that exceed the minimum or maximum.
|
- Minimum / Maximum Shader Details Level
(mingpulevel / maxgpulevel)
<integer choices> (in all games since ) - Don't render for players with Shader Details levels that exceed the minimum or maximum.
|
See also: cpu_level / gpu_level convars
Inputs
SetScale
<float>- Sets Scale.
HideSprite
- Makes the sprite invisible.
ShowSprite
- Makes sprite visible.
ToggleSprite
- Make sprite invisible or visible depending on the current state.
ColorRedValue
<float>- Change the intensity of the red channel (0-255).
ColorGreenValue
<float>- Change the intensity of the green channel (0-255).
ColorBlueValue
<float>- Change the intensity of the blue channel (0-255).
RenderFields:
Alpha
<integer 0–255>- Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its
rendermode
set to a number other than0
.
Color
<color255>- Sets an RGB color for the entity.