A_SetScale

From ZDoom Wiki
Jump to navigation Jump to search

A_SetScale (float scaleX [, float scaleY [, int pointer [, bool usezero]]])

Usage

Changes the calling actor's or the pointed to actor's visual scale. This does not affect the actual collision box and is mainly intended for special effects actors, such as a puff of smoke gradually dissipating by expansion (in combination with A_FadeOut) or a mote of light shrinking and disappearing.

Parameters

  • scaleX: the actor's new horizontal scale. Using negative values will result in mirroring the sprite on the axis.
  • scaleY: the actor's new vertical scale. If this parameter is not given, or is set to 0, scaleX is used as well. Default is 0.
  • pointer: The actor to change its scale. This is an actor pointer. Default is AAPTR_DEFAULT, which corresponds to the calling actor.
  • usezero: If this is false and scaleY is 0, scaleY uses the same value passed to scaleX, otherwise if it is true, the value of scaleY is used, instead. Default is false.

Examples

This simple actor when spawned will gradually become smaller and more translucent, until it is completely invisible and is removed. It could be used as a trail for some energy-like weapons.

ACTOR PulseRifleSmoke
{
 States
 {
  Spawn:
    PMIS B 0 Bright A_SetScale(0.6)
    PMIS B 1 bright A_FadeOut(0.1)
    PMIS B 0 Bright A_SetScale(0.5)
    PMIS B 1 bright A_FadeOut(0.1)
    PMIS B 0 Bright A_SetScale(0.4)
    PMIS B 1 bright A_FadeOut(0.1)
    PMIS B 0 Bright A_SetScale(0.3)
    PMIS B 1 bright A_FadeOut(0.1)
    PMIS B 0 Bright A_SetScale(0.2)
    PMIS B 1 bright A_FadeOut(0.1)
    PMIS B 0 Bright A_SetScale(0.1)
    PMIS B 1 bright A_FadeOut(0.1)
    PMIS BBBBB 0 Bright A_FadeOut(0.1)
    Stop
 }
}