GPUParticles2D

package
v0.0.0-...-a7442fb Latest Latest
Warning

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

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

Documentation

Overview

Package GPUParticles2D provides methods for working with GPUParticles2D object instances.

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
	AsGPUParticles2D() Instance
}

type DrawOrder

type DrawOrder int //gd:GPUParticles2D.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
	/*Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front.*/
	DrawOrderReverseLifetime DrawOrder = 2
)

type EmitFlags

type EmitFlags int //gd:GPUParticles2D.EmitFlags
const (
	/*Particle starts at the specified position.*/
	EmitFlagPosition EmitFlags = 1
	/*Particle starts with specified rotation and scale.*/
	EmitFlagRotationScale EmitFlags = 2
	/*Particle starts with the specified velocity vector, which defines the emission direction and speed.*/
	EmitFlagVelocity EmitFlags = 4
	/*Particle starts with specified color.*/
	EmitFlagColor EmitFlags = 8
	/*Particle starts with specified [code]CUSTOM[/code] data.*/
	EmitFlagCustom EmitFlags = 16
)

type Expanded

type Expanded [1]gdclass.GPUParticles2D

func (Expanded) Restart

func (self Expanded) Restart(keep_seed bool)

Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. [b]Note:[/b] The [signal finished] signal is only emitted by [member one_shot] emitters. If [param keep_seed] is [code]true[/code], the current random seed will be preserved. Useful for seeking and playback.

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]) AsCanvasItem

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

func (*Extension[T]) AsGPUParticles2D

func (self *Extension[T]) AsGPUParticles2D() 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.GPUParticles2D

2D particle node used to create a variety of particle systems and effects. [GPUParticles2D] features an emitter that generates some number of particles at a given rate. Use the [member process_material] property to add a [ParticleProcessMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. 2D particles can optionally collide with [LightOccluder2D], but they don't collide with [PhysicsBody2D] nodes.

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

func (Instance) AmountRatio

func (self Instance) AmountRatio() Float.X

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsGPUParticles2D

func (self Instance) AsGPUParticles2D() 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) CaptureRect

func (self Instance) CaptureRect() Rect2.PositionSize

Returns a rectangle containing the positions of all existing particles. [b]Note:[/b] When using threaded rendering this method synchronizes the rendering thread. Calling it often may have a negative impact on performance.

func (Instance) CollisionBaseSize

func (self Instance) CollisionBaseSize() Float.X

func (Instance) ConvertFromParticles

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

Sets this node's properties to match a given [CPUParticles2D] node.

func (Instance) DrawOrder

func (self Instance) DrawOrder() DrawOrder

func (Instance) EmitParticle

func (self Instance) EmitParticle(xform Transform2D.OriginXY, velocity Vector2.XY, color Color.RGBA, custom Color.RGBA, flags int)

Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as [code](rotation, age, animation, lifetime)[/code]. [b]Note:[/b] [method emit_particle] is only supported on the Forward+ and Mobile rendering methods, not Compatibility.

func (Instance) Emitting

func (self Instance) Emitting() bool

func (Instance) Explosiveness

func (self Instance) Explosiveness() Float.X

func (Instance) FixedFps

func (self Instance) FixedFps() int

func (Instance) FractDelta

func (self Instance) FractDelta() bool

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InterpToEnd

func (self Instance) InterpToEnd() Float.X

func (Instance) Interpolate

func (self Instance) Interpolate() bool

func (Instance) Lifetime

func (self Instance) Lifetime() Float.X

func (Instance) LocalCoords

func (self Instance) LocalCoords() bool

func (Instance) OnFinished

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

func (Instance) OneShot

func (self Instance) OneShot() bool

func (Instance) Preprocess

func (self Instance) Preprocess() Float.X

func (Instance) ProcessMaterial

func (self Instance) ProcessMaterial() Material.Instance

func (Instance) Randomness

func (self Instance) Randomness() Float.X

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 [member use_fixed_seed] or by calling [method restart] with parameter [code]keep_seed[/code] set to [code]true[/code].

func (Instance) Restart

func (self Instance) Restart()

Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. [b]Note:[/b] The [signal finished] signal is only emitted by [member one_shot] emitters. If [param keep_seed] is [code]true[/code], the current random seed will be preserved. Useful for seeking and playback.

func (Instance) Seed

func (self Instance) Seed() int

func (Instance) SetAmount

func (self Instance) SetAmount(value int)

func (Instance) SetAmountRatio

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

func (Instance) SetCollisionBaseSize

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

func (Instance) SetDrawOrder

func (self Instance) SetDrawOrder(value DrawOrder)

func (Instance) SetEmitting

func (self Instance) SetEmitting(value bool)

func (Instance) SetExplosiveness

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

func (Instance) SetFixedFps

func (self Instance) SetFixedFps(value int)

func (Instance) SetFractDelta

func (self Instance) SetFractDelta(value bool)

func (Instance) SetInterpToEnd

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

func (Instance) SetInterpolate

func (self Instance) SetInterpolate(value bool)

func (Instance) SetLifetime

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

func (Instance) SetLocalCoords

func (self Instance) SetLocalCoords(value bool)

func (*Instance) SetObject

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

func (Instance) SetOneShot

func (self Instance) SetOneShot(value bool)

func (Instance) SetPreprocess

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

func (Instance) SetProcessMaterial

func (self Instance) SetProcessMaterial(value Material.Instance)

func (Instance) SetRandomness

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

func (Instance) SetSeed

func (self Instance) SetSeed(value int)

func (Instance) SetSpeedScale

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

func (Instance) SetSubEmitter

func (self Instance) SetSubEmitter(value string)

func (Instance) SetTexture

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

func (Instance) SetTrailEnabled

func (self Instance) SetTrailEnabled(value bool)

func (Instance) SetTrailLifetime

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

func (Instance) SetTrailSectionSubdivisions

func (self Instance) SetTrailSectionSubdivisions(value int)

func (Instance) SetTrailSections

func (self Instance) SetTrailSections(value int)

func (Instance) SetUseFixedSeed

func (self Instance) SetUseFixedSeed(value bool)

func (Instance) SetVisibilityRect

func (self Instance) SetVisibilityRect(value Rect2.PositionSize)

func (Instance) SpeedScale

func (self Instance) SpeedScale() Float.X

func (Instance) SubEmitter

func (self Instance) SubEmitter() string

func (Instance) Texture

func (self Instance) Texture() Texture2D.Instance

func (Instance) TrailEnabled

func (self Instance) TrailEnabled() bool

func (Instance) TrailLifetime

func (self Instance) TrailLifetime() Float.X

func (Instance) TrailSectionSubdivisions

func (self Instance) TrailSectionSubdivisions() int

func (Instance) TrailSections

func (self Instance) TrailSections() int

func (Instance) UseFixedSeed

func (self Instance) UseFixedSeed() bool

func (Instance) Virtual

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

func (Instance) VisibilityRect

func (self Instance) VisibilityRect() Rect2.PositionSize

Jump to

Keyboard shortcuts

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