scale_x
scale_y
scale_z
The scale factors, which determine the entities' size in quants per pixel (only valid for sprite and model entities). They can be changed during gameplay to grow or shrink the entity in real time. Their default value is 1.0.
Range:
0.01 .. 100 (default: 1)
Type:
var
Remarks:
- Changing an entities' size will also change it's boundaries, but doesn't change its collision hull. If scaled very small, it may be necessary to raise its center to prevent the entity from becoming stuck in the floor. Sprite entities are scaled by scale_x and scale_y only.
- The scale of chunked terrain can only be changed at the beginning of the entity action. Afterwards, the size of chunked terrain is fixed and scaling won't affect it anymore.
-
The standard shaders only support uniform scaling, i.e. scale_x, scale_y, and scale_z must have the same value. For non-uniform scaling, modify the shaders so that vertex normals are transformed with the inverse transpose of the world matrix.
Example:
action bouncer()
{
while(1)
{
my.scale_x = sin(my.skill1)+0.5
my.skill1 += time_step;
wait(1);
}
}
See also:
frame, next_frame ► latest version online