Prop detail sprite: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{base point|prop_detail_sprite|internal=1}} It allows manual insertion of [[Detail props|detail sprites]] into a level.
{{base point|prop_detail_sprite|internal=1}} It allows manual insertion of [[Detail props|detail sprites]] into a level.


See [[Detail props#sprites]] for detailed information about setting up detail props through .VBSP files.
{{tip|Only use this entity if you are desperate. It is much better to assign a material a [[Detail props#Usage|%detailtype]] and let VBSP generate detail sprites itself.}}
{{tip|Only use this entity if you are desperate. It is much better to assign a material a [[Detail props#Usage|%detailtype]] and let VBSP generate detail sprites itself.}}


{{intent}}
{{intent}}


==Keyvalues==
==Keyvalues==
''This entity is not in Valve's FGDs. Its properties must be set with [[SmartEdit]] disabled.''
''This entity is not in Valve's FGDs. Its properties must be set with [[SmartEdit]] disabled.''
 
{{KV|[[Origin]] (X Y Z)|intn=origin|coordinates|The position of this entity's center in the world. Rotating entities typically rotate around their origin.}}
; <code>origin <[[Vector]]></code>
{{KV|[[Pitch Yaw Roll]] (X Y Z)|intn=angles|angle|This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.}}
; <code>angles <[[QAngle]]></code>
: Standard position information.
; <code>detailOrientation <[[int]]></code>
; <code>detailOrientation <[[int]]></code>
: See [[Detail props#sprites]].
: See [[Detail props#sprites]].
; <code>position_ul <[[Vector2D]]></code>
; <code>position_ul <[[Vector2D]]></code>  
: The location of the sprite's upper left corner, relative to its origin.
; <code>position_lr <Vector2D></code>
; <code>position_lr <Vector2D></code>
: {{confirm|The location of the sprite's upper left and lower right corners, relative to its origin.}}
: The location of the sprite's lower right corner, relative to its origin.
; <code>tex_ul <Vector2D></code>
; <code>tex_ul <Vector2D></code>
: The X Y position of the sprite's upper left corner on the detail texture.
; <code>tex_size <Vector2D></code>
; <code>tex_size <Vector2D></code>
; <code>tex_total_size <[[float]]> </code>
: The area of the detail texture that should constitute this sprite (dimensions of the sprite in [[texel]]s). See [[Detail props#sprites]].
: The area of the detail texture that should constitute this sprite. See [[Detail props#sprites]].
; <code>tex_total_size <Vector2D> </code>
: The width (X-axis resolution) of the detail texture.
 
==Example==
Here is an example of a sprite from a custom .VBSP file.
<div style="max-height:30em;overflow:auto;"><source lang=ini>
RoseFlower
{
sprite "0 0 83 128 512"
spritesize "0.5 0.05 7 13"
spriterandomscale .3
amount 0.02
detailorientation 2
sway 0.2
upright 1
maxangle 70
}
</source>
 
To place this sprite manually, the entity would be set up in this way:
 
; <code>detailOrientation <2></code>
; <code>position_ul <0 13></code>
; <code>position_lr <7 0></code>
; <code>tex_ul <0 0></code>
; <code>tex_size <83 128></code>
; <code>tex_total_size <512> </code>

Revision as of 00:32, 28 February 2021

Template:Base point It allows manual insertion of detail sprites into a level.


See Detail props#sprites for detailed information about setting up detail props through .VBSP files.

Tip.pngTip:Only use this entity if you are desperate. It is much better to assign a material a %detailtype and let VBSP generate detail sprites itself.


Template:Intent

Keyvalues

This entity is not in Valve's FGDs. Its properties must be set with SmartEdit disabled.

Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
detailOrientation <int>
See Detail props#sprites.
position_ul <Vector2D>
The location of the sprite's upper left corner, relative to its origin.
position_lr <Vector2D>
The location of the sprite's lower right corner, relative to its origin.
tex_ul <Vector2D>
The X Y position of the sprite's upper left corner on the detail texture.
tex_size <Vector2D>
The area of the detail texture that should constitute this sprite (dimensions of the sprite in texels). See Detail props#sprites.
tex_total_size <Vector2D>
The width (X-axis resolution) of the detail texture.

Example

Here is an example of a sprite from a custom .VBSP file.

			RoseFlower
			{
				sprite "0 0 83 128 512"
				spritesize "0.5 0.05 7 13"
				spriterandomscale .3
				amount 0.02
				detailorientation 2
				sway 0.2
				upright 1
				maxangle 70
			}

To place this sprite manually, the entity would be set up in this way:

detailOrientation <2>
position_ul <0 13>
position_lr <7 0>
tex_ul <0 0>
tex_size <83 128>
tex_total_size <512>