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 ¶
- type Advanced
- type Any
- type DrawOrder
- type EmissionShape
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) Amount() int
- func (self Instance) AngleCurve() Curve.Instance
- func (self Instance) AngleMax() Float.X
- func (self Instance) AngleMin() Float.X
- func (self Instance) AngularVelocityCurve() Curve.Instance
- func (self Instance) AngularVelocityMax() Float.X
- func (self Instance) AngularVelocityMin() Float.X
- func (self Instance) AnimOffsetCurve() Curve.Instance
- func (self Instance) AnimOffsetMax() Float.X
- func (self Instance) AnimOffsetMin() Float.X
- func (self Instance) AnimSpeedCurve() Curve.Instance
- func (self Instance) AnimSpeedMax() Float.X
- func (self Instance) AnimSpeedMin() Float.X
- func (self Instance) AsCPUParticles2D() Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Color() Color.RGBA
- func (self Instance) ColorInitialRamp() Gradient.Instance
- func (self Instance) ColorRamp() Gradient.Instance
- func (self Instance) ConvertFromParticles(particles Node.Instance)
- func (self Instance) DampingCurve() Curve.Instance
- func (self Instance) DampingMax() Float.X
- func (self Instance) DampingMin() Float.X
- func (self Instance) Direction() Vector2.XY
- func (self Instance) DrawOrder() DrawOrder
- func (self Instance) EmissionColors() []Color.RGBA
- func (self Instance) EmissionNormals() []Vector2.XY
- func (self Instance) EmissionPoints() []Vector2.XY
- func (self Instance) EmissionRectExtents() Vector2.XY
- func (self Instance) EmissionShape() EmissionShape
- func (self Instance) EmissionSphereRadius() Float.X
- func (self Instance) Emitting() bool
- func (self Instance) Explosiveness() Float.X
- func (self Instance) FixedFps() int
- func (self Instance) FractDelta() bool
- func (self Instance) Gravity() Vector2.XY
- func (self Instance) HueVariationCurve() Curve.Instance
- func (self Instance) HueVariationMax() Float.X
- func (self Instance) HueVariationMin() Float.X
- func (self Instance) ID() ID
- func (self Instance) InitialVelocityMax() Float.X
- func (self Instance) InitialVelocityMin() Float.X
- func (self Instance) Lifetime() Float.X
- func (self Instance) LifetimeRandomness() Float.X
- func (self Instance) LinearAccelCurve() Curve.Instance
- func (self Instance) LinearAccelMax() Float.X
- func (self Instance) LinearAccelMin() Float.X
- func (self Instance) LocalCoords() bool
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) OnFinished(cb func(), flags ...Signal.Flags)
- func (self Instance) OneShot() bool
- func (self Instance) OrbitVelocityCurve() Curve.Instance
- func (self Instance) OrbitVelocityMax() Float.X
- func (self Instance) OrbitVelocityMin() Float.X
- func (self Instance) ParticleFlagAlignY() bool
- func (self Instance) Preprocess() Float.X
- func (self Instance) RadialAccelCurve() Curve.Instance
- func (self Instance) RadialAccelMax() Float.X
- func (self Instance) RadialAccelMin() Float.X
- func (self Instance) Randomness() Float.X
- func (self Instance) RequestParticlesProcess(process_time Float.X)
- func (self Instance) Restart()
- func (self Instance) ScaleAmountCurve() Curve.Instance
- func (self Instance) ScaleAmountMax() Float.X
- func (self Instance) ScaleAmountMin() Float.X
- func (self Instance) ScaleCurveX() Curve.Instance
- func (self Instance) ScaleCurveY() Curve.Instance
- func (self Instance) Seed() int
- func (self Instance) SetAmount(value int)
- func (self Instance) SetAngleCurve(value Curve.Instance)
- func (self Instance) SetAngleMax(value Float.X)
- func (self Instance) SetAngleMin(value Float.X)
- func (self Instance) SetAngularVelocityCurve(value Curve.Instance)
- func (self Instance) SetAngularVelocityMax(value Float.X)
- func (self Instance) SetAngularVelocityMin(value Float.X)
- func (self Instance) SetAnimOffsetCurve(value Curve.Instance)
- func (self Instance) SetAnimOffsetMax(value Float.X)
- func (self Instance) SetAnimOffsetMin(value Float.X)
- func (self Instance) SetAnimSpeedCurve(value Curve.Instance)
- func (self Instance) SetAnimSpeedMax(value Float.X)
- func (self Instance) SetAnimSpeedMin(value Float.X)
- func (self Instance) SetColor(value Color.RGBA)
- func (self Instance) SetColorInitialRamp(value Gradient.Instance)
- func (self Instance) SetColorRamp(value Gradient.Instance)
- func (self Instance) SetDampingCurve(value Curve.Instance)
- func (self Instance) SetDampingMax(value Float.X)
- func (self Instance) SetDampingMin(value Float.X)
- func (self Instance) SetDirection(value Vector2.XY)
- func (self Instance) SetDrawOrder(value DrawOrder)
- func (self Instance) SetEmissionColors(value []Color.RGBA)
- func (self Instance) SetEmissionNormals(value []Vector2.XY)
- func (self Instance) SetEmissionPoints(value []Vector2.XY)
- func (self Instance) SetEmissionRectExtents(value Vector2.XY)
- func (self Instance) SetEmissionShape(value EmissionShape)
- func (self Instance) SetEmissionSphereRadius(value Float.X)
- func (self Instance) SetEmitting(value bool)
- func (self Instance) SetExplosiveness(value Float.X)
- func (self Instance) SetFixedFps(value int)
- func (self Instance) SetFractDelta(value bool)
- func (self Instance) SetGravity(value Vector2.XY)
- func (self Instance) SetHueVariationCurve(value Curve.Instance)
- func (self Instance) SetHueVariationMax(value Float.X)
- func (self Instance) SetHueVariationMin(value Float.X)
- func (self Instance) SetInitialVelocityMax(value Float.X)
- func (self Instance) SetInitialVelocityMin(value Float.X)
- func (self Instance) SetLifetime(value Float.X)
- func (self Instance) SetLifetimeRandomness(value Float.X)
- func (self Instance) SetLinearAccelCurve(value Curve.Instance)
- func (self Instance) SetLinearAccelMax(value Float.X)
- func (self Instance) SetLinearAccelMin(value Float.X)
- func (self Instance) SetLocalCoords(value bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOneShot(value bool)
- func (self Instance) SetOrbitVelocityCurve(value Curve.Instance)
- func (self Instance) SetOrbitVelocityMax(value Float.X)
- func (self Instance) SetOrbitVelocityMin(value Float.X)
- func (self Instance) SetParticleFlagAlignY(value bool)
- func (self Instance) SetPreprocess(value Float.X)
- func (self Instance) SetRadialAccelCurve(value Curve.Instance)
- func (self Instance) SetRadialAccelMax(value Float.X)
- func (self Instance) SetRadialAccelMin(value Float.X)
- func (self Instance) SetRandomness(value Float.X)
- func (self Instance) SetScaleAmountCurve(value Curve.Instance)
- func (self Instance) SetScaleAmountMax(value Float.X)
- func (self Instance) SetScaleAmountMin(value Float.X)
- func (self Instance) SetScaleCurveX(value Curve.Instance)
- func (self Instance) SetScaleCurveY(value Curve.Instance)
- func (self Instance) SetSeed(value int)
- func (self Instance) SetSpeedScale(value Float.X)
- func (self Instance) SetSplitScale(value bool)
- func (self Instance) SetSpread(value Float.X)
- func (self Instance) SetTangentialAccelCurve(value Curve.Instance)
- func (self Instance) SetTangentialAccelMax(value Float.X)
- func (self Instance) SetTangentialAccelMin(value Float.X)
- func (self Instance) SetTexture(value Texture2D.Instance)
- func (self Instance) SetUseFixedSeed(value bool)
- func (self Instance) SpeedScale() Float.X
- func (self Instance) SplitScale() bool
- func (self Instance) Spread() Float.X
- func (self Instance) TangentialAccelCurve() Curve.Instance
- func (self Instance) TangentialAccelMax() Float.X
- func (self Instance) TangentialAccelMin() Float.X
- func (self Instance) Texture() Texture2D.Instance
- func (self Instance) UseFixedSeed() bool
- func (self Instance) Virtual(name string) reflect.Value
- type MoreArgs
- type Parameter
- type ParticleFlags
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 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 Extension ¶
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 (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
type 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.
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 (Instance) AngleCurve ¶
func (Instance) AngularVelocityCurve ¶
func (Instance) AngularVelocityMax ¶
func (Instance) AngularVelocityMin ¶
func (Instance) AnimOffsetCurve ¶
func (Instance) AnimOffsetMax ¶
func (Instance) AnimOffsetMin ¶
func (Instance) AnimSpeedCurve ¶
func (Instance) AnimSpeedMax ¶
func (Instance) AnimSpeedMin ¶
func (Instance) AsCPUParticles2D ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) ColorInitialRamp ¶
func (Instance) ConvertFromParticles ¶
Sets this node's properties to match a given GPUParticles2D node with an assigned ParticleProcessMaterial.
func (Instance) DampingCurve ¶
func (Instance) DampingMax ¶
func (Instance) DampingMin ¶
func (Instance) EmissionColors ¶
func (Instance) EmissionNormals ¶
func (Instance) EmissionPoints ¶
func (Instance) EmissionRectExtents ¶
func (Instance) EmissionShape ¶
func (self Instance) EmissionShape() EmissionShape
func (Instance) EmissionSphereRadius ¶
func (Instance) Explosiveness ¶
func (Instance) FractDelta ¶
func (Instance) HueVariationCurve ¶
func (Instance) HueVariationMax ¶
func (Instance) HueVariationMin ¶
func (Instance) InitialVelocityMax ¶
func (Instance) InitialVelocityMin ¶
func (Instance) LifetimeRandomness ¶
func (Instance) LinearAccelCurve ¶
func (Instance) LinearAccelMax ¶
func (Instance) LinearAccelMin ¶
func (Instance) LocalCoords ¶
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) OnFinished ¶
func (Instance) OrbitVelocityCurve ¶
func (Instance) OrbitVelocityMax ¶
func (Instance) OrbitVelocityMin ¶
func (Instance) ParticleFlagAlignY ¶
func (Instance) Preprocess ¶
func (Instance) RadialAccelCurve ¶
func (Instance) RadialAccelMax ¶
func (Instance) RadialAccelMin ¶
func (Instance) Randomness ¶
func (Instance) RequestParticlesProcess ¶
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 (Instance) ScaleAmountMax ¶
func (Instance) ScaleAmountMin ¶
func (Instance) ScaleCurveX ¶
func (Instance) ScaleCurveY ¶
func (Instance) SetAngleCurve ¶
func (Instance) SetAngleMax ¶
func (Instance) SetAngleMin ¶
func (Instance) SetAngularVelocityCurve ¶
func (Instance) SetAngularVelocityMax ¶
func (Instance) SetAngularVelocityMin ¶
func (Instance) SetAnimOffsetCurve ¶
func (Instance) SetAnimOffsetMax ¶
func (Instance) SetAnimOffsetMin ¶
func (Instance) SetAnimSpeedCurve ¶
func (Instance) SetAnimSpeedMax ¶
func (Instance) SetAnimSpeedMin ¶
func (Instance) SetColorInitialRamp ¶
func (Instance) SetColorRamp ¶
func (Instance) SetDampingCurve ¶
func (Instance) SetDampingMax ¶
func (Instance) SetDampingMin ¶
func (Instance) SetDirection ¶
func (Instance) SetDrawOrder ¶
func (Instance) SetEmissionColors ¶
func (Instance) SetEmissionNormals ¶
func (Instance) SetEmissionPoints ¶
func (Instance) SetEmissionRectExtents ¶
func (Instance) SetEmissionShape ¶
func (self Instance) SetEmissionShape(value EmissionShape)
func (Instance) SetEmissionSphereRadius ¶
func (Instance) SetEmitting ¶
func (Instance) SetExplosiveness ¶
func (Instance) SetFixedFps ¶
func (Instance) SetFractDelta ¶
func (Instance) SetGravity ¶
func (Instance) SetHueVariationCurve ¶
func (Instance) SetHueVariationMax ¶
func (Instance) SetHueVariationMin ¶
func (Instance) SetInitialVelocityMax ¶
func (Instance) SetInitialVelocityMin ¶
func (Instance) SetLifetime ¶
func (Instance) SetLifetimeRandomness ¶
func (Instance) SetLinearAccelCurve ¶
func (Instance) SetLinearAccelMax ¶
func (Instance) SetLinearAccelMin ¶
func (Instance) SetLocalCoords ¶
func (Instance) SetOneShot ¶
func (Instance) SetOrbitVelocityCurve ¶
func (Instance) SetOrbitVelocityMax ¶
func (Instance) SetOrbitVelocityMin ¶
func (Instance) SetParticleFlagAlignY ¶
func (Instance) SetPreprocess ¶
func (Instance) SetRadialAccelCurve ¶
func (Instance) SetRadialAccelMax ¶
func (Instance) SetRadialAccelMin ¶
func (Instance) SetRandomness ¶
func (Instance) SetScaleAmountCurve ¶
func (Instance) SetScaleAmountMax ¶
func (Instance) SetScaleAmountMin ¶
func (Instance) SetScaleCurveX ¶
func (Instance) SetScaleCurveY ¶
func (Instance) SetSpeedScale ¶
func (Instance) SetSplitScale ¶
func (Instance) SetTangentialAccelCurve ¶
func (Instance) SetTangentialAccelMax ¶
func (Instance) SetTangentialAccelMin ¶
func (Instance) SetTexture ¶
func (Instance) SetUseFixedSeed ¶
func (Instance) SpeedScale ¶
func (Instance) SplitScale ¶
func (Instance) TangentialAccelCurve ¶
func (Instance) TangentialAccelMax ¶
func (Instance) TangentialAccelMin ¶
func (Instance) UseFixedSeed ¶
type MoreArgs ¶
type MoreArgs [1]gdclass.CPUParticles2D
MoreArgs is a container for Instance functions with additional 'optional' arguments.
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 )