A_SetScale

From ZDoom Wiki
Jump to: navigation, search

A_SetScale (float scaleX[, float scaleY])

Changes the calling 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.

  • scaleX: the actor's new horizontal scale. Using negative values will result in mirroring the sprite on the axis. (development version e7225bc only)
  • scaleY: the actor's new vertical scale. If this parameter is not given, or is set to 0, scaleX is used as well.

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
 }
}