From ZDoom Wiki
Jump to navigation Jump to search

void A_SpawnParticle (color color1 [, int flags [, int lifetime [, double size [, double angle [, double xoff [, double yoff [, double zoff [, double velx [, double vely [, double velz [, double accelx [, double accely [, double accelz [, double startalphaf [, double fadestepf [, double sizestep]]]]]]]]]]]]]]]])


Spawns a single particle.


  • color1: The color of the particle. Can be used with a hexadecimal value or a predefined value such as "Black". Set this to FFFFFF to spawn
  • flags: Customizes the behavior of the function. Multiple flags can be combined by using the bitwise OR operator (|) between the constant names:
    • SPF_FULLBRIGHT — Makes the particle full bright.
    • SPF_RELPOS — Position is relative to angle.
    • SPF_RELVEL — Velocity is relative to angle.
    • SPF_RELACCEL — Acceleration is relative to angle.
    • SPF_RELANG — Adds the calling actor's angle to angle for relativity.
    • SPF_NOTIMEFREEZE — The spawned particle is not affected by the time freeze powerup or cheat.
    • SPF_REPLACE — If the the particle limit is reached, the oldest particles will be removed to make room for particles with SPF_REPLACE. (New from 4.10.0)
    • SPF_NO_XY_BILLBOARD - The particle does not have any sort of billboarding, causing it to render similarly to normal actor sprites, instead of facing the players' view at all times. (New from 4.10.0)
Default is 0.
  • lifetime: The lifetime of the particle in tics. Default is 35.
  • size: The size of the particle. Default is 1.
  • angle: The angle to offset the particle by. Default is 0.
  • x/yoff: The distance from the actor to spawn the particle along the X axis. Note that this is not relative. Default is 0.
  • zoff: How high up to spawn the particle from the actor's Z position. Default is 0.
  • velx/y/z: The velocity along the X/Y/Z axis to apply to the particle. This is in absolute direction, not relative. Default is 0.
  • accelx/y/z: Defines how much to accelerate the particle by over its lifespan. Default is 0.
  • startalphaf: Specifies the particle's alpha upon spawning. Default is 1.0.
  • fadestepf: The amount by which the particle fades each tic. The particle is automatically removed early if it fades completely before lifetime expires. -1 indicates automatic (a complete fade-out over the length of lifetime). Default is -1.
  • sizestep: The particle grows or shrinks in size by this amount per tic.


Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.

See also