ParticlesMaterial defines particle properties and behavior. It is used in the process_material of godot.Particles and godot.Particles2D emitter nodes.

Some of this material's properties are applied to each particle when emitted, while others can have a godot.CurveTexture applied to vary values over the lifetime of the particle.

When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between 1.0 and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of 0.4 would scale the original property between 0.4-1.0 of its original value.

Constructor

@:native("new")new()

Variables

@:native("Angle")angle:Single

Initial rotation applied to each particle, in degrees.

Note: Only applied when godot.ParticlesMaterial.flagDisableZ or godot.ParticlesMaterial.flagRotateY are true or the godot.SpatialMaterial being used to draw the particle is using godot.SpatialMaterial_BillboardMode.particles.

@:native("AngleCurve")angleCurve:Texture

Each particle's rotation will be animated along this godot.CurveTexture.

@:native("AngleRandom")angleRandom:Single

Rotation randomness ratio.

@:native("AngularVelocity")angularVelocity:Single

Initial angular velocity applied to each particle in degrees per second. Sets the speed of rotation of the particle.

Note: Only applied when godot.ParticlesMaterial.flagDisableZ or godot.ParticlesMaterial.flagRotateY are true or the godot.SpatialMaterial being used to draw the particle is using godot.SpatialMaterial_BillboardMode.particles.

@:native("AngularVelocityCurve")angularVelocityCurve:Texture

Each particle's angular velocity will vary along this godot.CurveTexture.

@:native("AngularVelocityRandom")angularVelocityRandom:Single

Angular velocity randomness ratio.

@:native("AnimOffset")animOffset:Single

Particle animation offset.

@:native("AnimOffsetCurve")animOffsetCurve:Texture

Each particle's animation offset will vary along this godot.CurveTexture.

@:native("AnimOffsetRandom")animOffsetRandom:Single

Animation offset randomness ratio.

@:native("AnimSpeed")animSpeed:Single

Particle animation speed.

@:native("AnimSpeedCurve")animSpeedCurve:Texture

Each particle's animation speed will vary along this godot.CurveTexture.

@:native("AnimSpeedRandom")animSpeedRandom:Single

Animation speed randomness ratio.

@:native("Color")color:Color

Each particle's initial color. If the godot.Particles2D's texture is defined, it will be multiplied by this color. To have particle display color in a godot.SpatialMaterial make sure to set godot.SpatialMaterial.vertexColorUseAsAlbedo to true.

@:native("ColorRamp")colorRamp:Texture

Each particle's color will vary along this godot.GradientTexture over its lifetime (multiplied with godot.ParticlesMaterial.color).

@:native("Damping")damping:Single

The rate at which particles lose velocity.

@:native("DampingCurve")dampingCurve:Texture

Damping will vary along this godot.CurveTexture.

@:native("DampingRandom")dampingRandom:Single

Damping randomness ratio.

@:native("Direction")direction:Vector3

Unit vector specifying the particles' emission direction.

@:native("EmissionBoxExtents")emissionBoxExtents:Vector3

The box's extents if emission_shape is set to godot.ParticlesMaterial_EmissionShapeEnum.box.

@:native("EmissionColorTexture")emissionColorTexture:Texture

Particle color will be modulated by color determined by sampling this texture at the same point as the godot.ParticlesMaterial.emissionPointTexture.

@:native("EmissionNormalTexture")emissionNormalTexture:Texture

Particle velocity and rotation will be set by sampling this texture at the same point as the godot.ParticlesMaterial.emissionPointTexture. Used only in godot.ParticlesMaterial_EmissionShapeEnum.directedPoints. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.

@:native("EmissionPointCount")emissionPointCount:Int

@:native("EmissionPointTexture")emissionPointTexture:Texture

Particles will be emitted at positions determined by sampling this texture at a random position. Used with godot.ParticlesMaterial_EmissionShapeEnum.points and godot.ParticlesMaterial_EmissionShapeEnum.directedPoints. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.

@:native("EmissionRingAxis")emissionRingAxis:Vector3

The axis of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring.

@:native("EmissionRingHeight")emissionRingHeight:Single

The height of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring.

@:native("EmissionRingInnerRadius")emissionRingInnerRadius:Single

The inner radius of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring.

@:native("EmissionRingRadius")emissionRingRadius:Single

The radius of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring.

@:native("EmissionShape")emissionShape:ParticlesMaterial_EmissionShapeEnum

Particles will be emitted inside this region. Use godot.ParticlesMaterial_EmissionShapeEnum constants for values.

@:native("EmissionSphereRadius")emissionSphereRadius:Single

The sphere's radius if emission_shape is set to godot.ParticlesMaterial_EmissionShapeEnum.sphere.

@:native("FlagAlignY")flagAlignY:Bool

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

@:native("FlagDisableZ")flagDisableZ:Bool

If true, particles will not move on the z axis.

@:native("FlagRotateY")flagRotateY:Bool

If true, particles rotate around Y axis by godot.ParticlesMaterial.angle.

@:native("Flatness")flatness:Single

Amount of godot.ParticlesMaterial.spread along the Y axis.

@:native("Gravity")gravity:Vector3

Gravity applied to every particle.

@:native("HueVariation")hueVariation:Single

Initial hue variation applied to each particle.

@:native("HueVariationCurve")hueVariationCurve:Texture

Each particle's hue will vary along this godot.CurveTexture.

@:native("HueVariationRandom")hueVariationRandom:Single

Hue variation randomness ratio.

@:native("InitialVelocity")initialVelocity:Single

Initial velocity magnitude for each particle. Direction comes from godot.ParticlesMaterial.spread and the node's orientation.

@:native("InitialVelocityRandom")initialVelocityRandom:Single

Initial velocity randomness ratio.

@:native("LifetimeRandomness")lifetimeRandomness:Single

Particle lifetime randomness ratio.

@:native("LinearAccel")linearAccel:Single

Linear acceleration applied to each particle in the direction of motion.

@:native("LinearAccelCurve")linearAccelCurve:Texture

Each particle's linear acceleration will vary along this godot.CurveTexture.

@:native("LinearAccelRandom")linearAccelRandom:Single

Linear acceleration randomness ratio.

@:native("OrbitVelocity")orbitVelocity:Single

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

Note: Only available when godot.ParticlesMaterial.flagDisableZ is true.

@:native("OrbitVelocityCurve")orbitVelocityCurve:Texture

Each particle's orbital velocity will vary along this godot.CurveTexture.

@:native("OrbitVelocityRandom")orbitVelocityRandom:Single

Orbital velocity randomness ratio.

@:native("RadialAccel")radialAccel:Single

Radial acceleration applied to each particle. Makes particle accelerate away from origin.

@:native("RadialAccelCurve")radialAccelCurve:Texture

Each particle's radial acceleration will vary along this godot.CurveTexture.

@:native("RadialAccelRandom")radialAccelRandom:Single

Radial acceleration randomness ratio.

@:native("Scale")scale:Single

Initial scale applied to each particle.

@:native("ScaleCurve")scaleCurve:Texture

Each particle's scale will vary along this godot.CurveTexture.

@:native("ScaleRandom")scaleRandom:Single

Scale randomness ratio.

@:native("Spread")spread:Single

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

@:native("TangentialAccel")tangentialAccel:Single

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

@:native("TangentialAccelCurve")tangentialAccelCurve:Texture

Each particle's tangential acceleration will vary along this godot.CurveTexture.

@:native("TangentialAccelRandom")tangentialAccelRandom:Single

Tangential acceleration randomness ratio.

@:native("TrailColorModifier")trailColorModifier:GradientTexture

Trail particles' color will vary along this godot.GradientTexture.

@:native("TrailDivisor")trailDivisor:Int

Emitter will emit amount divided by trail_divisor particles. The remaining particles will be used as trail(s).

@:native("TrailSizeModifier")trailSizeModifier:CurveTexture

Trail particles' size will vary along this godot.CurveTexture.

Methods

@:native("GetColor")getColor():Color

@:native("GetColorRamp")getColorRamp():Texture

@:native("GetDirection")getDirection():Vector3

@:native("GetEmissionBoxExtents")getEmissionBoxExtents():Vector3

@:native("GetEmissionColorTexture")getEmissionColorTexture():Texture

@:native("GetEmissionNormalTexture")getEmissionNormalTexture():Texture

@:native("GetEmissionPointCount")getEmissionPointCount():Int

@:native("GetEmissionPointTexture")getEmissionPointTexture():Texture

@:native("GetEmissionRingAxis")getEmissionRingAxis():Vector3

@:native("GetEmissionRingHeight")getEmissionRingHeight():Single

@:native("GetEmissionRingInnerRadius")getEmissionRingInnerRadius():Single

@:native("GetEmissionRingRadius")getEmissionRingRadius():Single

@:native("GetEmissionSphereRadius")getEmissionSphereRadius():Single

@:native("GetFlag")getFlag(flag:ParticlesMaterial_Flags):Bool

Returns true if the specified flag is enabled.

@:native("GetFlatness")getFlatness():Single

@:native("GetGravity")getGravity():Vector3

@:native("GetLifetimeRandomness")getLifetimeRandomness():Single

@:native("GetParam")getParam(param:ParticlesMaterial_Parameter):Single

Returns the value of the specified parameter.

@:native("GetParamRandomness")getParamRandomness(param:ParticlesMaterial_Parameter):Single

Returns the randomness ratio associated with the specified parameter.

@:native("GetParamTexture")getParamTexture(param:ParticlesMaterial_Parameter):Texture

Returns the godot.Texture used by the specified parameter.

@:native("GetSpread")getSpread():Single

@:native("GetTrailColorModifier")getTrailColorModifier():GradientTexture

@:native("GetTrailDivisor")getTrailDivisor():Int

@:native("GetTrailSizeModifier")getTrailSizeModifier():CurveTexture

@:native("SetColor")setColor(color:Color):Void

@:native("SetColorRamp")setColorRamp(ramp:Texture):Void

@:native("SetDirection")setDirection(degrees:Vector3):Void

@:native("SetEmissionBoxExtents")setEmissionBoxExtents(extents:Vector3):Void

@:native("SetEmissionColorTexture")setEmissionColorTexture(texture:Texture):Void

@:native("SetEmissionNormalTexture")setEmissionNormalTexture(texture:Texture):Void

@:native("SetEmissionPointCount")setEmissionPointCount(pointCount:Int):Void

@:native("SetEmissionPointTexture")setEmissionPointTexture(texture:Texture):Void

@:native("SetEmissionRingAxis")setEmissionRingAxis(axis:Vector3):Void

@:native("SetEmissionRingHeight")setEmissionRingHeight(height:Single):Void

@:native("SetEmissionRingInnerRadius")setEmissionRingInnerRadius(offset:Single):Void

@:native("SetEmissionRingRadius")setEmissionRingRadius(radius:Single):Void

@:native("SetEmissionShape")setEmissionShape(shape:ParticlesMaterial_EmissionShapeEnum):Void

@:native("SetEmissionSphereRadius")setEmissionSphereRadius(radius:Single):Void

@:native("SetFlag")setFlag(flag:ParticlesMaterial_Flags, enable:Bool):Void

If true, enables the specified flag. See godot.ParticlesMaterial_Flags for options.

@:native("SetFlatness")setFlatness(amount:Single):Void

@:native("SetGravity")setGravity(accelVec:Vector3):Void

@:native("SetLifetimeRandomness")setLifetimeRandomness(randomness:Single):Void

@:native("SetParam")setParam(param:ParticlesMaterial_Parameter, value:Single):Void

@:native("SetParamRandomness")setParamRandomness(param:ParticlesMaterial_Parameter, randomness:Single):Void

Sets the randomness ratio for the specified godot.ParticlesMaterial_Parameter.

@:native("SetParamTexture")setParamTexture(param:ParticlesMaterial_Parameter, texture:Texture):Void

@:native("SetSpread")setSpread(degrees:Single):Void

@:native("SetTrailColorModifier")setTrailColorModifier(texture:GradientTexture):Void

@:native("SetTrailDivisor")setTrailDivisor(divisor:Int):Void

@:native("SetTrailSizeModifier")setTrailSizeModifier(texture:CurveTexture):Void

Inherited Variables

Defined by Material

@:native("NextPass")nextPass:Material

Sets the godot.Material to be used for the next pass. This renders the object again using a different material.

Note: This only applies to godot.SpatialMaterials and godot.ShaderMaterials with type "Spatial".

@:native("RenderPriority")renderPriority:Int

Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.

Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

Defined by Resource

read onlyonChanged:Signal<() ‑> Void>

changed signal.

@:native("ResourceLocalToScene")resourceLocalToScene:Bool

If true, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

@:native("ResourceName")resourceName:String

The name of the resource. This is an optional identifier. If godot.Resource.resourceName is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the godot.Resource.resourceName will be displayed as the tab name in the script editor.

@:native("ResourcePath")resourcePath:String

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

Defined by Object

@:native("DynamicObject")read onlydynamicObject:Dynamic

Gets a new godot.DynamicGodotObject associated with this instance.

@:native("NativeInstance")read onlynativeInstance:IntPtr

The pointer to the native instance of this godot.Object.

read onlyonScriptChanged:Signal<() ‑> Void>

script_changed signal.

Inherited Methods

Defined by Material

@:native("GetNextPass")getNextPass():Material

@:native("GetRenderPriority")getRenderPriority():Int

@:native("SetNextPass")setNextPass(nextPass:Material):Void

@:native("SetRenderPriority")setRenderPriority(priority:Int):Void

Defined by Resource

@:native("_SetupLocalToScene")_SetupLocalToScene():Void

Virtual function which can be overridden to customize the behavior value of godot.Resource.setupLocalToScene.

@:native("Duplicate")duplicate(?subresources:Bool):Resource

Duplicates the resource, returning a new resource with the exported members copied. Note: To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values.

By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing true to the subresources argument which will copy the subresources.

Note: If subresources is true, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.

Note: When duplicating a resource, only exported properties are copied. Other properties will be set to their default value in the new resource.

@:native("EmitChanged")emitChanged():Void

Emits the changed signal.

If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties).

The method is equivalent to:


emit_signal("changed")

Note: This method is called automatically for built-in resources.

@:native("GetLocalScene")getLocalScene():Node

If godot.Resource.resourceLocalToScene is enabled and the resource was loaded from a godot.PackedScene instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns null.

@:native("GetName")getName():String

@:native("GetPath")getPath():String

@:native("GetRid")getRid():RID

Returns the RID of the resource (or an empty RID). Many resources (such as godot.Texture, godot.Mesh, etc) are high-level abstractions of resources stored in a server, so this function will return the original RID.

@:native("IsLocalToScene")isLocalToScene():Bool

@:native("SetLocalToScene")setLocalToScene(enable:Bool):Void

@:native("SetName")setName(name:String):Void

@:native("SetPath")setPath(path:String):Void

@:native("SetupLocalToScene")setupLocalToScene():Void

This method is called when a resource with godot.Resource.resourceLocalToScene enabled is loaded from a godot.PackedScene instantiation. Its behavior can be customized by overriding godot.Resource._SetupLocalToScene from script.

For most resources, this method performs no base logic. godot.ViewportTexture performs custom logic to properly set the proxy texture and flags in the local viewport.

@:native("TakeOverPath")takeOverPath(path:String):Void

Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting godot.Resource.resourcePath, as the latter would error out if another resource was already cached for the given path.

Defined by Reference

@:native("InitRef")initRef():Bool

Initializes the internal reference counter. Use this only if you really know what you are doing.

Returns whether the initialization was successful.

@:native("Reference_")reference_():Bool

Increments the internal reference counter. Use this only if you really know what you are doing.

Returns true if the increment was successful, false otherwise.

@:native("Unreference")unreference():Bool

Decrements the internal reference counter. Use this only if you really know what you are doing.

Returns true if the decrement was successful, false otherwise.

Defined by Object

@:native("_Get")_Get(property:String):Dynamic

Virtual method which can be overridden to customize the return value of godot.Object.get.

Returns the given property. Returns null if the property does not exist.

@:native("_GetPropertyList")_GetPropertyList():Array

Virtual method which can be overridden to customize the return value of godot.Object.getPropertyList.

Returns the object's property list as an godot.Collections_Array of dictionaries.

Each property's godot.Collections_Dictionary must contain at least name: String and type: int (see godot.Variant_Type) entries. Optionally, it can also include hint: int (see godot.PropertyHint), hint_string: String, and usage: int (see godot.PropertyUsageFlags).

@:native("_Notification")_Notification(what:Int):Void

Called whenever the object receives a notification, which is identified in what by a constant. The base godot.Object has two constants godot.Object.notificationPostinitialize and godot.Object.notificationPredelete, but subclasses such as godot.Node define a lot more notifications which are also received by this method.

@:native("_Set")_Set(property:String, value:Dynamic):Bool

Virtual method which can be overridden to customize the return value of godot.Object.set.

Sets a property. Returns true if the property exists.

@:native("AddUserSignal")addUserSignal(signal:String, ?arguments:Array):Void

Adds a user-defined signal. Arguments are optional, but can be added as an godot.Collections_Array of dictionaries, each containing name: String and type: int (see godot.Variant_Type) entries.

Parameters:

arguments

If the parameter is null, then the default value is new Godot.Collections.Array { }

@:native("Call")call(method:String, args:HaxeArray<Dynamic>):Dynamic

Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


call("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

@:native("CallDeferred")callDeferred(method:String, args:HaxeArray<Dynamic>):Void

Calls the method on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


call_deferred("set", "position", Vector2(42.0, 0.0))

Note: In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase).

@:native("Callv")callv(method:String, argArray:Array):Dynamic

Calls the method on the object and returns the result. Contrarily to godot.Object.call, this method does not support a variable number of arguments but expects all parameters to be via a single godot.Collections_Array.


callv("set", [ "position", Vector2(42.0, 0.0) ])

@:native("CanTranslateMessages")canTranslateMessages():Bool

Returns true if the object can translate strings. See godot.Object.setMessageTranslation and godot.Object.tr.

@:native("Connect")connect(signal:String, target:Object, method:String, ?binds:Array, ?flags:UInt):Error

Connects a signal to a method on a target object. Pass optional binds to the call as an godot.Collections_Array of parameters. These parameters will be passed to the method after any parameter used in the call to godot.Object.emitSignal. Use flags to set deferred or one-shot connections. See godot.Object_ConnectFlags constants.

A signal can only be connected once to a method. It will print an error if already connected, unless the signal was connected with godot.Object_ConnectFlags.referenceCounted. To avoid this, first, use godot.Object.isConnected to check for existing connections.

If the target is destroyed in the game's lifecycle, the connection will be lost.

Examples:


connect("pressed", self, "_on_Button_pressed") # BaseButton signal
connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal
connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal

An example of the relationship between binds passed to godot.Object.connect and parameters used when calling godot.Object.emitSignal:


connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last
emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first
func _on_Player_hit(hit_by, level, weapon_type, damage):
print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage])

Parameters:

binds

If the parameter is null, then the default value is new Godot.Collections.Array { }

@:native("Disconnect")disconnect(signal:String, target:Object, method:String):Void

Disconnects a signal from a method on the given target.

If you try to disconnect a connection that does not exist, the method will print an error. Use godot.Object.isConnected to ensure that the connection exists.

@:native("Dispose")dispose():Void

@:native("Dispose")@:protectedDispose(disposing:Bool):Void

Disposes of this godot.Object.

@:native("EmitSignal")emitSignal(signal:String, args:HaxeArray<Dynamic>):Void

Emits the given signal. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:


emit_signal("hit", weapon_type, damage)
emit_signal("game_over")

@:native("Free")free():Void

Deletes the object from memory immediately. For godot.Nodes, you may want to use godot.Node.queueFree to queue the node for safe deletion at the end of the current frame.

Important: If you have a variable pointing to an object, it will not be assigned to null once the object is freed. Instead, it will point to a previously freed instance and you should validate it with @GDScript.is_instance_valid before attempting to call its methods or access its properties.

@:native("Get")get(property:String):Dynamic

Returns the Variant value of the given property. If the property doesn't exist, this will return null.

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("GetClass")getClass():String

Returns the object's class as a String. See also godot.Object.isClass.

Note: godot.Object.getClass does not take class_name declarations into account. If the object has a class_name defined, the base class name will be returned instead.

@:native("GetIncomingConnections")getIncomingConnections():Array

Returns an godot.Collections_Array of dictionaries with information about signals that are connected to the object.

Each godot.Collections_Dictionary contains three String entries:

  • source is a reference to the signal emitter.

  • signal_name is the name of the connected signal.

  • method_name is the name of the method to which the signal is connected.

@:native("GetIndexed")getIndexed(property:NodePath):Dynamic

Gets the object's property indexed by the given godot.NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Examples: "position:x" or "material:next_pass:blend_mode".

Note: Even though the method takes godot.NodePath argument, it doesn't support actual paths to godot.Nodes in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use godot.Node.getNodeAndResource instead.

@:native("GetInstanceId")getInstanceId():UInt64

Returns the object's unique instance ID.

This ID can be saved in godot.EncodedObjectAsID, and can be used to retrieve the object instance with @GDScript.instance_from_id.

@:native("GetMeta")getMeta(name:String):Dynamic

Returns the object's metadata entry for the given name.

inlinegetMetaList():Array<String>

Returns the object's metadata as a String.

@:native("GetMethodList")getMethodList():Array

Returns the object's methods and their signatures as an godot.Collections_Array.

@:native("GetPropertyList")getPropertyList():Array

Returns the object's property list as an godot.Collections_Array of dictionaries.

Each property's godot.Collections_Dictionary contain at least name: String and type: int (see godot.Variant_Type) entries. Optionally, it can also include hint: int (see godot.PropertyHint), hint_string: String, and usage: int (see godot.PropertyUsageFlags).

@:native("GetScript")getScript():Reference

Returns the object's godot.Script instance, or null if none is assigned.

@:native("GetSignalConnectionList")getSignalConnectionList(signal:String):Array

Returns an godot.Collections_Array of connections for the given signal.

@:native("GetSignalList")getSignalList():Array

Returns the list of signals as an godot.Collections_Array of dictionaries.

@:native("HasMeta")hasMeta(name:String):Bool

Returns true if a metadata entry is found with the given name.

@:native("HasMethod")hasMethod(method:String):Bool

Returns true if the object contains the given method.

@:native("HasSignal")hasSignal(signal:String):Bool

Returns true if the given signal exists.

@:native("HasUserSignal")hasUserSignal(signal:String):Bool

Returns true if the given user-defined signal exists. Only signals added using godot.Object.addUserSignal are taken into account.

@:native("IsBlockingSignals")isBlockingSignals():Bool

Returns true if signal emission blocking is enabled.

@:native("IsClass")isClass(class_:String):Bool

Returns true if the object inherits from the given class. See also godot.Object.getClass.

Note: godot.Object.isClass does not take class_name declarations into account. If the object has a class_name defined, godot.Object.isClass will return false for that name.

@:native("IsConnected")isConnected(signal:String, target:Object, method:String):Bool

Returns true if a connection exists for a given signal, target, and method.

@:native("IsQueuedForDeletion")isQueuedForDeletion():Bool

Returns true if the godot.Node.queueFree method was called for the object.

@:native("Notification")notification(what:Int, ?reversed:Bool):Void

Send a given notification to the object, which will also trigger a call to the godot.Object._Notification method of all classes that the object inherits from.

If reversed is true, godot.Object._Notification is called first on the object's own class, and then up to its successive parent classes. If reversed is false, godot.Object._Notification is called first on the highest ancestor (godot.Object itself), and then down to its successive inheriting classes.

@:native("PropertyListChangedNotify")propertyListChangedNotify():Void

Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds.

@:native("RemoveMeta")removeMeta(name:String):Void

Removes a given entry from the object's metadata. See also godot.Object.setMeta.

@:native("Set")set(property:String, value:Dynamic):Void

Assigns a new value to the given property. If the property does not exist or the given value's type doesn't match, nothing will happen.

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("SetBlockSignals")setBlockSignals(enable:Bool):Void

If set to true, signal emission is blocked.

@:native("SetDeferred")setDeferred(property:String, value:Dynamic):Void

Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling godot.Object.set via godot.Object.callDeferred, i.e. call_deferred("set", property, value).

Note: In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase).

@:native("SetIndexed")setIndexed(property:NodePath, value:Dynamic):Void

Assigns a new value to the property identified by the godot.NodePath. The node path should be relative to the current object and can use the colon character (:) to access nested properties. Example:


set_indexed("position", Vector2(42, 0))
set_indexed("position:y", -10)
print(position) # (42, -10)

@:native("SetMessageTranslation")setMessageTranslation(enable:Bool):Void

Defines whether the object can translate strings (with calls to godot.Object.tr). Enabled by default.

@:native("SetMeta")setMeta(name:String, value:Dynamic):Void

Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any Variant value.

To remove a given entry from the object's metadata, use godot.Object.removeMeta. Metadata is also removed if its value is set to null. This means you can also use set_meta("name", null) to remove metadata for "name".

@:native("SetScript")setScript(script:Reference):Void

Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality.

If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's method will be called.

@:native("ToSignal")toSignal(source:Object, signal:String):SignalAwaiter

Returns a new godot.SignalAwaiter awaiter configured to complete when the instance source emits the signal specified by the signal parameter.

Parameters:

source

The instance the awaiter will be listening to.

signal

The signal the awaiter will be waiting for. This sample prints a message once every frame up to 100 times.

public override void _Ready()
{
for (int i = 0; i &lt; 100; i++)
{
await ToSignal(GetTree(), "idle_frame");
GD.Print($"Frame {i}");
}
}

Returns:

A godot.SignalAwaiter that completes when source emits the signal.

@:native("ToString")toString():String

Converts this godot.Object to a string.

Returns:

A string representation of this object.

@:native("Tr")tr(message:String):String

Translates a message using translation catalogs configured in the Project Settings.

Only works if message translation is enabled (which it is by default), otherwise it returns the message unchanged. See godot.Object.setMessageTranslation.