CPUParticles2D

package
v0.0.0-...-20ed0ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

CPU-based 2D particle node used to create a variety of particle systems and effects.

See also GPUParticles2D, which provides the same functionality with hardware acceleration, but may not run on older devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsCPUParticles2D() Instance
}

type DrawOrder

type DrawOrder int //gd:CPUParticles2D.DrawOrder
const (
	// Particles are drawn in the order emitted.
	DrawOrderIndex DrawOrder = 0
	// Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front.
	DrawOrderLifetime DrawOrder = 1
)

type EmissionShape

type EmissionShape int //gd:CPUParticles2D.EmissionShape
const (
	// All particles will be emitted from a single point.
	EmissionShapePoint EmissionShape = 0
	// Particles will be emitted in the volume of a sphere flattened to two dimensions.
	EmissionShapeSphere EmissionShape = 1
	// Particles will be emitted on the surface of a sphere flattened to two dimensions.
	EmissionShapeSphereSurface EmissionShape = 2
	// Particles will be emitted in the area of a rectangle.
	EmissionShapeRectangle EmissionShape = 3
	// Particles will be emitted at a position chosen randomly among [EmissionPoints]. Particle color will be modulated by [EmissionColors].
	//
	// [EmissionColors]: https://pkg.go.dev/graphics.gd/classdb/#Instance.EmissionColors
	// [EmissionPoints]: https://pkg.go.dev/graphics.gd/classdb/#Instance.EmissionPoints
	EmissionShapePoints EmissionShape = 4
	// Particles will be emitted at a position chosen randomly among [EmissionPoints]. Particle velocity and rotation will be set based on [EmissionNormals]. Particle color will be modulated by [EmissionColors].
	//
	// [EmissionColors]: https://pkg.go.dev/graphics.gd/classdb/#Instance.EmissionColors
	// [EmissionNormals]: https://pkg.go.dev/graphics.gd/classdb/#Instance.EmissionNormals
	// [EmissionPoints]: https://pkg.go.dev/graphics.gd/classdb/#Instance.EmissionPoints
	EmissionShapeDirectedPoints EmissionShape = 5
	// Represents the size of the [EmissionShape] enum.
	EmissionShapeMax EmissionShape = 6
)

type Expanded

type Expanded = MoreArgs

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsCPUParticles2D

func (self *Extension[T]) AsCPUParticles2D() Instance

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode2D

func (self *Extension[T]) AsNode2D() Node2D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.CPUParticles2D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) Amount

func (self Instance) Amount() int

Number of particles emitted in one emission cycle.

func (Instance) AngleCurve

func (self Instance) AngleCurve() Curve.Instance

Each particle's rotation will be animated along this Curve. Should be a unit Curve.

func (Instance) AngleMax

func (self Instance) AngleMax() Float.X

Maximum initial rotation applied to each particle, in degrees.

func (Instance) AngleMin

func (self Instance) AngleMin() Float.X

Minimum equivalent of AngleMax.

func (Instance) AngularVelocityCurve

func (self Instance) AngularVelocityCurve() Curve.Instance

Each particle's angular velocity will vary along this Curve. Should be a unit Curve.

func (Instance) AngularVelocityMax

func (self Instance) AngularVelocityMax() Float.X

Maximum initial angular velocity (rotation speed) applied to each particle in degrees per second.

func (Instance) AngularVelocityMin

func (self Instance) AngularVelocityMin() Float.X

Minimum equivalent of AngularVelocityMax.

func (Instance) AnimOffsetCurve

func (self Instance) AnimOffsetCurve() Curve.Instance

Each particle's animation offset will vary along this Curve. Should be a unit Curve.

func (Instance) AnimOffsetMax

func (self Instance) AnimOffsetMax() Float.X

Maximum animation offset that corresponds to frame index in the texture. 0 is the first frame, 1 is the last one. See CanvasItemMaterial.ParticlesAnimation.

func (Instance) AnimOffsetMin

func (self Instance) AnimOffsetMin() Float.X

Minimum equivalent of AnimOffsetMax.

func (Instance) AnimSpeedCurve

func (self Instance) AnimSpeedCurve() Curve.Instance

Each particle's animation speed will vary along this Curve. Should be a unit Curve.

func (Instance) AnimSpeedMax

func (self Instance) AnimSpeedMax() Float.X

Maximum particle animation speed. Animation speed of 1 means that the particles will make full 0 to 1 offset cycle during lifetime, 2 means 2 cycles etc.

With animation speed greater than 1, remember to enable CanvasItemMaterial.ParticlesAnimLoop property if you want the animation to repeat.

func (Instance) AnimSpeedMin

func (self Instance) AnimSpeedMin() Float.X

Minimum equivalent of AnimSpeedMax.

func (Instance) AsCPUParticles2D

func (self Instance) AsCPUParticles2D() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode2D

func (self Instance) AsNode2D() Node2D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) Color

func (self Instance) Color() Color.RGBA

Each particle's initial color. If Texture is defined, it will be multiplied by this color.

func (Instance) ColorInitialRamp

func (self Instance) ColorInitialRamp() Gradient.Instance

Each particle's initial color will vary along this Gradient (multiplied with Color).

func (Instance) ColorRamp

func (self Instance) ColorRamp() Gradient.Instance

Each particle's color will vary along this Gradient over its lifetime (multiplied with Color).

func (Instance) ConvertFromParticles

func (self Instance) ConvertFromParticles(particles Node.Instance)

Sets this node's properties to match a given GPUParticles2D node with an assigned ParticleProcessMaterial.

func (Instance) DampingCurve

func (self Instance) DampingCurve() Curve.Instance

Damping will vary along this Curve. Should be a unit Curve.

func (Instance) DampingMax

func (self Instance) DampingMax() Float.X

The maximum rate at which particles lose velocity. For example value of 100 means that the particle will go from 100 velocity to 0 in 1 second.

func (Instance) DampingMin

func (self Instance) DampingMin() Float.X

Minimum equivalent of DampingMax.

func (Instance) Direction

func (self Instance) Direction() Vector2.XY

Unit vector specifying the particles' emission direction.

func (Instance) DrawOrder

func (self Instance) DrawOrder() DrawOrder

Particle draw order.

func (Instance) EmissionColors

func (self Instance) EmissionColors() []Color.RGBA

Sets the Color.RGBAs to modulate particles by when using EmissionShapePoints or EmissionShapeDirectedPoints.

func (Instance) EmissionNormals

func (self Instance) EmissionNormals() []Vector2.XY

Sets the direction the particles will be emitted in when using EmissionShapeDirectedPoints.

func (Instance) EmissionPoints

func (self Instance) EmissionPoints() []Vector2.XY

Sets the initial positions to spawn particles when using EmissionShapePoints or EmissionShapeDirectedPoints.

func (Instance) EmissionRectExtents

func (self Instance) EmissionRectExtents() Vector2.XY

The rectangle's extents if EmissionShape is set to EmissionShapeRectangle.

func (Instance) EmissionShape

func (self Instance) EmissionShape() EmissionShape

Particles will be emitted inside this region.

func (Instance) EmissionSphereRadius

func (self Instance) EmissionSphereRadius() Float.X

The sphere's radius if EmissionShape is set to EmissionShapeSphere.

func (Instance) Emitting

func (self Instance) 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 OnFinished signal to be notified once all active particles finish processing.

func (Instance) Explosiveness

func (self Instance) Explosiveness() Float.X

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.

func (Instance) FixedFps

func (self Instance) FixedFps() int

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.

func (Instance) FractDelta

func (self Instance) FractDelta() bool

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

func (Instance) Gravity

func (self Instance) Gravity() Vector2.XY

Gravity applied to every particle.

func (Instance) HueVariationCurve

func (self Instance) HueVariationCurve() Curve.Instance

Each particle's hue will vary along this Curve. Should be a unit Curve.

func (Instance) HueVariationMax

func (self Instance) HueVariationMax() Float.X

Maximum initial hue variation applied to each particle. It will shift the particle color's hue.

func (Instance) HueVariationMin

func (self Instance) HueVariationMin() Float.X

Minimum equivalent of HueVariationMax.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InitialVelocityMax

func (self Instance) InitialVelocityMax() Float.X

Maximum initial velocity magnitude for each particle. Direction comes from Direction and Spread.

func (Instance) InitialVelocityMin

func (self Instance) InitialVelocityMin() Float.X

Minimum equivalent of InitialVelocityMax.

func (Instance) Lifetime

func (self Instance) Lifetime() Float.X

Amount of time each particle will exist.

func (Instance) LifetimeRandomness

func (self Instance) LifetimeRandomness() Float.X

Particle lifetime randomness ratio.

func (Instance) LinearAccelCurve

func (self Instance) LinearAccelCurve() Curve.Instance

Each particle's linear acceleration will vary along this Curve. Should be a unit Curve.

func (Instance) LinearAccelMax

func (self Instance) LinearAccelMax() Float.X

Maximum linear acceleration applied to each particle in the direction of motion.

func (Instance) LinearAccelMin

func (self Instance) LinearAccelMin() Float.X

Minimum equivalent of LinearAccelMax.

func (Instance) LocalCoords

func (self Instance) 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 CPUParticles2D node (and its parents) when it is moved or rotated. If false, particles use global coordinates; they will not move or rotate along the CPUParticles2D node (and its parents) when it is moved or rotated.

func (Instance) MoreArgs

func (self Instance) MoreArgs() MoreArgs

MoreArgs enables certain functions to be called with additional 'optional' arguments.

func (Instance) OnFinished

func (self Instance) OnFinished(cb func(), flags ...Signal.Flags)

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

func (Instance) OneShot

func (self Instance) OneShot() bool

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

func (Instance) OrbitVelocityCurve

func (self Instance) OrbitVelocityCurve() Curve.Instance

Each particle's orbital velocity will vary along this Curve. Should be a unit Curve.

func (Instance) OrbitVelocityMax

func (self Instance) OrbitVelocityMax() Float.X

Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.

func (Instance) OrbitVelocityMin

func (self Instance) OrbitVelocityMin() Float.X

Minimum equivalent of OrbitVelocityMax.

func (Instance) ParticleFlagAlignY

func (self Instance) ParticleFlagAlignY() bool

Align Y axis of particle with the direction of its velocity.

func (Instance) Preprocess

func (self Instance) Preprocess() Float.X

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

func (Instance) RadialAccelCurve

func (self Instance) RadialAccelCurve() Curve.Instance

Each particle's radial acceleration will vary along this Curve. Should be a unit Curve.

func (Instance) RadialAccelMax

func (self Instance) RadialAccelMax() Float.X

Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative.

func (Instance) RadialAccelMin

func (self Instance) RadialAccelMin() Float.X

Minimum equivalent of RadialAccelMax.

func (Instance) Randomness

func (self Instance) Randomness() Float.X

Emission lifetime randomness ratio.

func (Instance) RequestParticlesProcess

func (self Instance) RequestParticlesProcess(process_time Float.X)

Requests the particles to process for extra process time during a single frame.

Useful for particle playback, if used in combination with UseFixedSeed or by calling Restart with parameter keep_seed set to true.

func (Instance) Restart

func (self Instance) Restart()

Restarts the particle emitter.

If 'keep_seed' is true, the current random seed will be preserved. Useful for seeking and playback.

func (Instance) ScaleAmountCurve

func (self Instance) ScaleAmountCurve() Curve.Instance

Each particle's scale will vary along this Curve. Should be a unit Curve.

func (Instance) ScaleAmountMax

func (self Instance) ScaleAmountMax() Float.X

Maximum initial scale applied to each particle.

func (Instance) ScaleAmountMin

func (self Instance) ScaleAmountMin() Float.X

Minimum equivalent of ScaleAmountMax.

func (Instance) ScaleCurveX

func (self Instance) ScaleCurveX() Curve.Instance

Each particle's horizontal scale will vary along this Curve. Should be a unit Curve.

SplitScale must be enabled.

func (Instance) ScaleCurveY

func (self Instance) ScaleCurveY() Curve.Instance

Each particle's vertical scale will vary along this Curve. Should be a unit Curve.

SplitScale must be enabled.

func (Instance) Seed

func (self Instance) Seed() int

Sets the random seed used by the particle system. Only effective if UseFixedSeed is true.

func (Instance) SetAmount

func (self Instance) SetAmount(value int)

SetAmount sets the property returned by [GetAmount].

func (Instance) SetAngleCurve

func (self Instance) SetAngleCurve(value Curve.Instance)

SetAngleCurve sets the property returned by [GetParamCurve].

func (Instance) SetAngleMax

func (self Instance) SetAngleMax(value Float.X)

SetAngleMax sets the property returned by [GetParamMax].

func (Instance) SetAngleMin

func (self Instance) SetAngleMin(value Float.X)

SetAngleMin sets the property returned by [GetParamMin].

func (Instance) SetAngularVelocityCurve

func (self Instance) SetAngularVelocityCurve(value Curve.Instance)

SetAngularVelocityCurve sets the property returned by [GetParamCurve].

func (Instance) SetAngularVelocityMax

func (self Instance) SetAngularVelocityMax(value Float.X)

SetAngularVelocityMax sets the property returned by [GetParamMax].

func (Instance) SetAngularVelocityMin

func (self Instance) SetAngularVelocityMin(value Float.X)

SetAngularVelocityMin sets the property returned by [GetParamMin].

func (Instance) SetAnimOffsetCurve

func (self Instance) SetAnimOffsetCurve(value Curve.Instance)

SetAnimOffsetCurve sets the property returned by [GetParamCurve].

func (Instance) SetAnimOffsetMax

func (self Instance) SetAnimOffsetMax(value Float.X)

SetAnimOffsetMax sets the property returned by [GetParamMax].

func (Instance) SetAnimOffsetMin

func (self Instance) SetAnimOffsetMin(value Float.X)

SetAnimOffsetMin sets the property returned by [GetParamMin].

func (Instance) SetAnimSpeedCurve

func (self Instance) SetAnimSpeedCurve(value Curve.Instance)

SetAnimSpeedCurve sets the property returned by [GetParamCurve].

func (Instance) SetAnimSpeedMax

func (self Instance) SetAnimSpeedMax(value Float.X)

SetAnimSpeedMax sets the property returned by [GetParamMax].

func (Instance) SetAnimSpeedMin

func (self Instance) SetAnimSpeedMin(value Float.X)

SetAnimSpeedMin sets the property returned by [GetParamMin].

func (Instance) SetColor

func (self Instance) SetColor(value Color.RGBA)

SetColor sets the property returned by [GetColor].

func (Instance) SetColorInitialRamp

func (self Instance) SetColorInitialRamp(value Gradient.Instance)

SetColorInitialRamp sets the property returned by [GetColorInitialRamp].

func (Instance) SetColorRamp

func (self Instance) SetColorRamp(value Gradient.Instance)

SetColorRamp sets the property returned by [GetColorRamp].

func (Instance) SetDampingCurve

func (self Instance) SetDampingCurve(value Curve.Instance)

SetDampingCurve sets the property returned by [GetParamCurve].

func (Instance) SetDampingMax

func (self Instance) SetDampingMax(value Float.X)

SetDampingMax sets the property returned by [GetParamMax].

func (Instance) SetDampingMin

func (self Instance) SetDampingMin(value Float.X)

SetDampingMin sets the property returned by [GetParamMin].

func (Instance) SetDirection

func (self Instance) SetDirection(value Vector2.XY)

SetDirection sets the property returned by [GetDirection].

func (Instance) SetDrawOrder

func (self Instance) SetDrawOrder(value DrawOrder)

SetDrawOrder sets the property returned by [GetDrawOrder].

func (Instance) SetEmissionColors

func (self Instance) SetEmissionColors(value []Color.RGBA)

SetEmissionColors sets the property returned by [GetEmissionColors].

func (Instance) SetEmissionNormals

func (self Instance) SetEmissionNormals(value []Vector2.XY)

SetEmissionNormals sets the property returned by [GetEmissionNormals].

func (Instance) SetEmissionPoints

func (self Instance) SetEmissionPoints(value []Vector2.XY)

SetEmissionPoints sets the property returned by [GetEmissionPoints].

func (Instance) SetEmissionRectExtents

func (self Instance) SetEmissionRectExtents(value Vector2.XY)

SetEmissionRectExtents sets the property returned by [GetEmissionRectExtents].

func (Instance) SetEmissionShape

func (self Instance) SetEmissionShape(value EmissionShape)

SetEmissionShape sets the property returned by [GetEmissionShape].

func (Instance) SetEmissionSphereRadius

func (self Instance) SetEmissionSphereRadius(value Float.X)

SetEmissionSphereRadius sets the property returned by [GetEmissionSphereRadius].

func (Instance) SetEmitting

func (self Instance) SetEmitting(value bool)

SetEmitting sets the property returned by [IsEmitting].

func (Instance) SetExplosiveness

func (self Instance) SetExplosiveness(value Float.X)

SetExplosiveness sets the property returned by [GetExplosivenessRatio].

func (Instance) SetFixedFps

func (self Instance) SetFixedFps(value int)

SetFixedFps sets the property returned by [GetFixedFps].

func (Instance) SetFractDelta

func (self Instance) SetFractDelta(value bool)

SetFractDelta sets the property returned by [GetFractionalDelta].

func (Instance) SetGravity

func (self Instance) SetGravity(value Vector2.XY)

SetGravity sets the property returned by [GetGravity].

func (Instance) SetHueVariationCurve

func (self Instance) SetHueVariationCurve(value Curve.Instance)

SetHueVariationCurve sets the property returned by [GetParamCurve].

func (Instance) SetHueVariationMax

func (self Instance) SetHueVariationMax(value Float.X)

SetHueVariationMax sets the property returned by [GetParamMax].

func (Instance) SetHueVariationMin

func (self Instance) SetHueVariationMin(value Float.X)

SetHueVariationMin sets the property returned by [GetParamMin].

func (Instance) SetInitialVelocityMax

func (self Instance) SetInitialVelocityMax(value Float.X)

SetInitialVelocityMax sets the property returned by [GetParamMax].

func (Instance) SetInitialVelocityMin

func (self Instance) SetInitialVelocityMin(value Float.X)

SetInitialVelocityMin sets the property returned by [GetParamMin].

func (Instance) SetLifetime

func (self Instance) SetLifetime(value Float.X)

SetLifetime sets the property returned by [GetLifetime].

func (Instance) SetLifetimeRandomness

func (self Instance) SetLifetimeRandomness(value Float.X)

SetLifetimeRandomness sets the property returned by [GetLifetimeRandomness].

func (Instance) SetLinearAccelCurve

func (self Instance) SetLinearAccelCurve(value Curve.Instance)

SetLinearAccelCurve sets the property returned by [GetParamCurve].

func (Instance) SetLinearAccelMax

func (self Instance) SetLinearAccelMax(value Float.X)

SetLinearAccelMax sets the property returned by [GetParamMax].

func (Instance) SetLinearAccelMin

func (self Instance) SetLinearAccelMin(value Float.X)

SetLinearAccelMin sets the property returned by [GetParamMin].

func (Instance) SetLocalCoords

func (self Instance) SetLocalCoords(value bool)

SetLocalCoords sets the property returned by [GetUseLocalCoordinates].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOneShot

func (self Instance) SetOneShot(value bool)

SetOneShot sets the property returned by [GetOneShot].

func (Instance) SetOrbitVelocityCurve

func (self Instance) SetOrbitVelocityCurve(value Curve.Instance)

SetOrbitVelocityCurve sets the property returned by [GetParamCurve].

func (Instance) SetOrbitVelocityMax

func (self Instance) SetOrbitVelocityMax(value Float.X)

SetOrbitVelocityMax sets the property returned by [GetParamMax].

func (Instance) SetOrbitVelocityMin

func (self Instance) SetOrbitVelocityMin(value Float.X)

SetOrbitVelocityMin sets the property returned by [GetParamMin].

func (Instance) SetParticleFlagAlignY

func (self Instance) SetParticleFlagAlignY(value bool)

SetParticleFlagAlignY sets the property returned by [GetParticleFlag].

func (Instance) SetPreprocess

func (self Instance) SetPreprocess(value Float.X)

SetPreprocess sets the property returned by [GetPreProcessTime].

func (Instance) SetRadialAccelCurve

func (self Instance) SetRadialAccelCurve(value Curve.Instance)

SetRadialAccelCurve sets the property returned by [GetParamCurve].

func (Instance) SetRadialAccelMax

func (self Instance) SetRadialAccelMax(value Float.X)

SetRadialAccelMax sets the property returned by [GetParamMax].

func (Instance) SetRadialAccelMin

func (self Instance) SetRadialAccelMin(value Float.X)

SetRadialAccelMin sets the property returned by [GetParamMin].

func (Instance) SetRandomness

func (self Instance) SetRandomness(value Float.X)

SetRandomness sets the property returned by [GetRandomnessRatio].

func (Instance) SetScaleAmountCurve

func (self Instance) SetScaleAmountCurve(value Curve.Instance)

SetScaleAmountCurve sets the property returned by [GetParamCurve].

func (Instance) SetScaleAmountMax

func (self Instance) SetScaleAmountMax(value Float.X)

SetScaleAmountMax sets the property returned by [GetParamMax].

func (Instance) SetScaleAmountMin

func (self Instance) SetScaleAmountMin(value Float.X)

SetScaleAmountMin sets the property returned by [GetParamMin].

func (Instance) SetScaleCurveX

func (self Instance) SetScaleCurveX(value Curve.Instance)

SetScaleCurveX sets the property returned by [GetScaleCurveX].

func (Instance) SetScaleCurveY

func (self Instance) SetScaleCurveY(value Curve.Instance)

SetScaleCurveY sets the property returned by [GetScaleCurveY].

func (Instance) SetSeed

func (self Instance) SetSeed(value int)

SetSeed sets the property returned by [GetSeed].

func (Instance) SetSpeedScale

func (self Instance) SetSpeedScale(value Float.X)

SetSpeedScale sets the property returned by [GetSpeedScale].

func (Instance) SetSplitScale

func (self Instance) SetSplitScale(value bool)

SetSplitScale sets the property returned by [GetSplitScale].

func (Instance) SetSpread

func (self Instance) SetSpread(value Float.X)

SetSpread sets the property returned by [GetSpread].

func (Instance) SetTangentialAccelCurve

func (self Instance) SetTangentialAccelCurve(value Curve.Instance)

SetTangentialAccelCurve sets the property returned by [GetParamCurve].

func (Instance) SetTangentialAccelMax

func (self Instance) SetTangentialAccelMax(value Float.X)

SetTangentialAccelMax sets the property returned by [GetParamMax].

func (Instance) SetTangentialAccelMin

func (self Instance) SetTangentialAccelMin(value Float.X)

SetTangentialAccelMin sets the property returned by [GetParamMin].

func (Instance) SetTexture

func (self Instance) SetTexture(value Texture2D.Instance)

SetTexture sets the property returned by [GetTexture].

func (Instance) SetUseFixedSeed

func (self Instance) SetUseFixedSeed(value bool)

SetUseFixedSeed sets the property returned by [GetUseFixedSeed].

func (Instance) SpeedScale

func (self Instance) SpeedScale() Float.X

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

func (Instance) SplitScale

func (self Instance) SplitScale() bool

If true, the scale curve will be split into x and y components. See ScaleCurveX and ScaleCurveY.

func (Instance) Spread

func (self Instance) Spread() Float.X

Each particle's initial direction range from +spread to -spread degrees.

func (Instance) TangentialAccelCurve

func (self Instance) TangentialAccelCurve() Curve.Instance

Each particle's tangential acceleration will vary along this Curve. Should be a unit Curve.

func (Instance) TangentialAccelMax

func (self Instance) TangentialAccelMax() Float.X

Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.

func (Instance) TangentialAccelMin

func (self Instance) TangentialAccelMin() Float.X

Minimum equivalent of TangentialAccelMax.

func (Instance) Texture

func (self Instance) Texture() Texture2D.Instance

Particle texture. If null, particles will be squares.

func (Instance) UseFixedSeed

func (self Instance) UseFixedSeed() bool

If true, particles will use the same seed for every simulation using the seed defined in Seed. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type MoreArgs

type MoreArgs [1]gdclass.CPUParticles2D

MoreArgs is a container for Instance functions with additional 'optional' arguments.

func (MoreArgs) Restart

func (self MoreArgs) Restart(keep_seed bool)

Restarts the particle emitter.

If 'keep_seed' is true, the current random seed will be preserved. Useful for seeking and playback.

type Parameter

type Parameter int //gd:CPUParticles2D.Parameter
const (
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set initial velocity properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamInitialLinearVelocity Parameter = 0
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set angular velocity properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamAngularVelocity Parameter = 1
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set orbital velocity properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamOrbitVelocity Parameter = 2
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set linear acceleration properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamLinearAccel Parameter = 3
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set radial acceleration properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamRadialAccel Parameter = 4
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set tangential acceleration properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamTangentialAccel Parameter = 5
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set damping properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamDamping Parameter = 6
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set angle properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamAngle Parameter = 7
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set scale properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamScale Parameter = 8
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set hue variation properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamHueVariation Parameter = 9
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set animation speed properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamAnimSpeed Parameter = 10
	// Use with [SetParamMin], [SetParamMax], and [SetParamCurve] to set animation offset properties.
	//
	// [SetParamCurve]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamCurve
	// [SetParamMax]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMax
	// [SetParamMin]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParamMin
	ParamAnimOffset Parameter = 11
	// Represents the size of the [Parameter] enum.
	ParamMax Parameter = 12
)

type ParticleFlags

type ParticleFlags int //gd:CPUParticles2D.ParticleFlags
const (
	// Use with [SetParticleFlag] to set [ParticleFlagAlignY].
	//
	// [ParticleFlagAlignY]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ParticleFlagAlignY
	// [SetParticleFlag]: https://pkg.go.dev/graphics.gd/classdb/#Instance.SetParticleFlag
	ParticleFlagAlignYToVelocity ParticleFlags = 0
	// Present for consistency with 3D particle nodes, not used in 2D.
	ParticleFlagRotateY ParticleFlags = 1
	// Present for consistency with 3D particle nodes, not used in 2D.
	ParticleFlagDisableZ ParticleFlags = 2
	// Represents the size of the [ParticleFlags] enum.
	ParticleFlagMax ParticleFlags = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL