EmitFlags

    GPUParticles2D.swift:42
    enum EmitFlags

    Cases

    • case position

      Particle starts at the specified position.

    • case rotationScale

      Particle starts with specified rotation and scale.

    • case velocity

      Particle starts with the specified velocity vector, which defines the emission direction and speed.

    • case color

      Particle starts with specified color.

    • case custom

      Particle starts with specified CUSTOM data.

    Other members in extension

    View members

    Hide members

    This section is hidden by default because it contains too many (31) members.

    Types

    Type members

    Instance members

    • var amount: Int32

      The number of particles to emit in one emission cycle. The effective emission rate is (amount * amount_ratio) / lifetime particles per second. Higher values will increase GPU requirements, even if not all particles are visible at a given time or if amountRatio is decreased.

    • var amountRatio: Double

      The ratio of particles that should actually be emitted. If set to a value lower than 1.0, this will set the amount of emitted particles throughout the lifetime to amount * amount_ratio. Unlike changing amount, changing amountRatio while emitting does not affect already-emitted particles and doesn’t cause the particle system to restart. amountRatio can be used to create effects that make the number of emitted particles vary over time.

    • var collisionBaseSize: Double

      Multiplier for particle’s collision radius. 1.0 corresponds to the size of the sprite. If particles appear to sink into the ground when colliding, increase this value. If particles appear to float when colliding, decrease this value. Only effective if collisionMode is ParticleProcessMaterial/CollisionMode/collisionRigid or ParticleProcessMaterial/CollisionMode/collisionHideOnContact.

    • var drawOrder: GPUParticles2D.DrawOrder

      Particle draw order. Uses DrawOrder values.

    • var emitting: Bool

      If true, particles are being emitted. emitting can be used to start and stop particles from emitting. However, if oneShot is true setting emitting to true will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing.

    • var explosiveness: Double

      How rapidly particles in an emission cycle are emitted. If greater than 0, there will be a gap in emissions before the next cycle begins.

    • var finished: SimpleSignal

      Emitted when all active particles have finished processing. When oneShot is disabled, particles will process continuously, so this is never emitted.

    • var fixedFps: Int32

      The particle system’s frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself.

    • var fractDelta: Bool

      If true, results in fractional delta calculation which has a smoother particles display effect.

    • var interpToEnd: Double

      Causes all the particles in this node to interpolate towards the end of their lifetime.

    • var interpolate: Bool

      Enables particle interpolation, which makes the particle movement smoother when their fixedFps is lower than the screen refresh rate.

    • var lifetime: Double

      The amount of time each particle will exist (in seconds). The effective emission rate is (amount * amount_ratio) / lifetime particles per second.

    • var localCoords: Bool

      If true, particles use the parent node’s coordinate space (known as local coordinates). This will cause particles to move and rotate along the GPUParticles2D node (and its parents) when it is moved or rotated. If false, particles use global coordinates; they will not move or rotate along the GPUParticles2D node (and its parents) when it is moved or rotated.

    • var oneShot: Bool

      If true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle’s end.

    • var preprocess: Double

      Particle system starts as if it had already run for this many seconds.

    • var processMaterial: Material?

      Material for processing particles. Can be a ParticleProcessMaterial or a ShaderMaterial.

    • var randomness: Double

      Emission lifetime randomness ratio.

    • var speedScale: Double

      Particle system’s running speed scaling ratio. A value of 0 can be used to pause the particles.

    • var subEmitter: NodePath

      Path to another GPUParticles2D node that will be used as a subemitter (see subEmitterMode). Subemitters can be used to achieve effects such as fireworks, sparks on collision, bubbles popping into water drops, and more.

    • var texture: Texture2D?

      Particle texture. If null, particles will be squares with a size of 1×1 pixels.

    • var trailEnabled: Bool

      If true, enables particle trails using a mesh skinning system.

    • var trailLifetime: Double

      The amount of time the particle’s trail should represent (in seconds). Only effective if trailEnabled is true.

    • var trailSectionSubdivisions: Int32

      The number of subdivisions to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also trailSections. Only effective if trailEnabled is true.

    • var trailSections: Int32

      The number of sections to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also trailSectionSubdivisions. Only effective if trailEnabled is true.

    • var visibilityRect: Rect2

      The Rect2 that determines the node’s region which needs to be visible on screen for the particle system to be active.

    • func captureRect() -> Rect2

      Returns a rectangle containing the positions of all existing particles.

    • func convertFromParticles(Node?)

      Sets this node’s properties to match a given CPUParticles2D node.

    • func emitParticle(xform: Transform2D, velocity: Vector2, color: Color, custom: Color, flags: UInt32)

      Emits a single particle. Whether xform, velocity, color and custom are applied depends on the value of flags. See EmitFlags.

    • func restart()

      Restarts all the existing particles.

    Citizens in SwiftGodot

    Conformances

    Type members

    Instance members

    Type features

    Instance features