ParticlesMaterial Class |
ParticlesMaterial defines particle properties and behavior. It is used in the process_material of Particles and Particles2D emitter nodes.
Some of this material's properties are applied to each particle when emitted, while others can have a 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.
Namespace: Godot
public class ParticlesMaterial : Material
The ParticlesMaterial type exposes the following members.
Name | Description | |
---|---|---|
ParticlesMaterial | Initializes a new instance of the ParticlesMaterial class |
Name | Description | |
---|---|---|
Angle | Initial rotation applied to each particle, in degrees. Only applied when FlagDisableZ or FlagRotateY are true or the SpatialMaterial being used to draw the particle is using . | |
AngleCurve | Each particle's rotation will be animated along this CurveTexture. | |
AngleRandom | Rotation randomness ratio. | |
AngularVelocity | Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. Only applied when FlagDisableZ or FlagRotateY are true or the SpatialMaterial being used to draw the particle is using . | |
AngularVelocityCurve | Each particle's angular velocity will vary along this CurveTexture. | |
AngularVelocityRandom | Angular velocity randomness ratio. | |
AnimOffset | Particle animation offset. | |
AnimOffsetCurve | Each particle's animation offset will vary along this CurveTexture. | |
AnimOffsetRandom | Animation offset randomness ratio. | |
AnimSpeed | Particle animation speed. | |
AnimSpeedCurve | Each particle's animation speed will vary along this CurveTexture. | |
AnimSpeedRandom | Animation speed randomness ratio. | |
Color | Each particle's initial color. If the Particles2D's texture is defined, it will be multiplied by this color. To have particle display color in a SpatialMaterial make sure to set VertexColorUseAsAlbedo to true. | |
ColorRamp | Each particle's color will vary along this GradientTexture. | |
Damping | The rate at which particles lose velocity. | |
DampingCurve | Damping will vary along this CurveTexture. | |
DampingRandom | Damping randomness ratio. | |
Direction | Unit vector specifying the particles' emission direction. | |
DynamicObject |
Gets a new DynamicGodotObject associated with this instance.
(Inherited from Object.) | |
EmissionBoxExtents | The box's extents if emission_shape is set to . | |
EmissionColorTexture | Particle color will be modulated by color determined by sampling this texture at the same point as the EmissionPointTexture. | |
EmissionNormalTexture | Particle velocity and rotation will be set by sampling this texture at the same point as the EmissionPointTexture. Used only in . Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. | |
EmissionPointCount | The number of emission points if emission_shape is set to or . | |
EmissionPointTexture | Particles will be emitted at positions determined by sampling this texture at a random position. Used with and . Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. | |
EmissionShape | Particles will be emitted inside this region. Use ParticlesMaterialEmissionShapeEnum constants for values. | |
EmissionSphereRadius | The sphere's radius if emission_shape is set to . | |
FlagAlignY | Align Y axis of particle with the direction of its velocity. | |
FlagDisableZ | If true, particles will not move on the z axis. | |
FlagRotateY | If true, particles rotate around Y axis by Angle. | |
Flatness | Amount of Spread in Y/Z plane. A value of 1 restricts particles to X/Z plane. | |
Gravity | Gravity applied to every particle. | |
HueVariation | Initial hue variation applied to each particle. | |
HueVariationCurve | Each particle's hue will vary along this CurveTexture. | |
HueVariationRandom | Hue variation randomness ratio. | |
InitialVelocity | Initial velocity magnitude for each particle. Direction comes from Spread and the node's orientation. | |
InitialVelocityRandom | Initial velocity randomness ratio. | |
LifetimeRandomness | Particle lifetime randomness ratio. | |
LinearAccel | Linear acceleration applied to each particle in the direction of motion. | |
LinearAccelCurve | Each particle's linear acceleration will vary along this CurveTexture. | |
LinearAccelRandom | Linear acceleration randomness ratio. | |
NativeInstance | (Inherited from Object.) | |
NextPass | Sets the Material to be used for the next pass. This renders the object again using a different material. Note: only applies to SpatialMaterials and ShaderMaterials with type "Spatial". | |
OrbitVelocity | Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. Only available when FlagDisableZ is true. | |
OrbitVelocityCurve | Each particle's orbital velocity will vary along this CurveTexture. | |
OrbitVelocityRandom | Orbital velocity randomness ratio. | |
RadialAccel | Radial acceleration applied to each particle. Makes particle accelerate away from origin. | |
RadialAccelCurve | Each particle's radial acceleration will vary along this CurveTexture. | |
RadialAccelRandom | Radial acceleration randomness ratio. | |
RenderPriority | 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). | |
ResourceLocalToScene | 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. | |
ResourceName | The name of the resource. This is an optional identifier. If ResourceName is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the ResourceName will be displayed as the tab name in the script editor. | |
ResourcePath | 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. | |
Scale | Initial scale applied to each particle. | |
ScaleCurve | Each particle's scale will vary along this CurveTexture. | |
ScaleRandom | Scale randomness ratio. | |
Spread | Each particle's initial direction range from +spread to -spread degrees. Applied to X/Z plane and Y/Z planes. | |
TangentialAccel | Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. | |
TangentialAccelCurve | Each particle's tangential acceleration will vary along this CurveTexture. | |
TangentialAccelRandom | Tangential acceleration randomness ratio. | |
TrailColorModifier | Trail particles' color will vary along this GradientTexture. | |
TrailDivisor | Emitter will emit amount divided by trail_divisor particles. The remaining particles will be used as trail(s). | |
TrailSizeModifier | Trail particles' size will vary along this CurveTexture. |
Name | Description | |
---|---|---|
_Get | Virtual method which can be overridden to customize the return value of Get(String). Returns the given property. Returns null if the property does not exist. | |
_GetPropertyList | Virtual method which can be overridden to customize the return value of GetPropertyList. Returns the object's property list as an Array of dictionaries. Each property's Dictionary must contain at least name: String and type: int (see VariantType) entries. Optionally, it can also include hint: int (see PropertyHint), hint_string: String, and usage: int (see PropertyUsageFlags). | |
_Notification | Called whenever the object receives a notification, which is identified in what by a constant. The base Object has two constants and , but subclasses such as Node define a lot more notifications which are also received by this method. | |
_Set | Virtual method which can be overridden to customize the return value of Set(String, Object). Sets a property. Returns true if the property exists. | |
_SetupLocalToScene | Virtual function which can be overridden to customize the behavior value of SetupLocalToScene. | |
AddUserSignal | Adds a user-defined signal. Arguments are optional, but can be added as an Array of dictionaries, each containing name: String and type: int (see VariantType) entries. | |
Call | 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). | |
CallDeferred | 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). | |
Callv | Calls the method on the object and returns the result. Contrarily to Call(String, Object), this method does not support a variable number of arguments but expects all parameters to be via a single Array. callv("set", [ "position", Vector2(42.0, 0.0) ]) | |
CanTranslateMessages | Returns true if the object can translate strings. See SetMessageTranslation(Boolean) and Tr(String). | |
Connect | Connects a signal to a method on a target object. Pass optional binds to the call as an Array of parameters. These parameters will be passed to the method after any parameter used in the call to EmitSignal(String, Object). Use flags to set deferred or one-shot connections. See ObjectConnectFlags constants. A signal can only be connected once to a method. It will throw an error if already connected, unless the signal was connected with . To avoid this, first, use IsConnected(String, Object, String) 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 Connect(String, Object, String, Array, UInt32) and parameters used when calling EmitSignal(String, Object): 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]) | |
Disconnect | Disconnects a signal from a method on the given target. If you try to disconnect a connection that does not exist, the method will throw an error. Use IsConnected(String, Object, String) to ensure that the connection exists. | |
Dispose | (Inherited from Object.) | |
Dispose(Boolean) | (Inherited from Object.) | |
Duplicate | Duplicates the resource, returning a new resource. 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. | |
EmitChanged | 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. | |
EmitSignal | 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") | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
Free | Deletes the object from memory immediately. For Nodes, you may want to use 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. | |
Get | 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). | |
GetClass | Returns the object's class as a String. | |
GetColor | Obsolete. | |
GetColorRamp | Obsolete. | |
GetDirection | Obsolete. | |
GetEmissionBoxExtents | Obsolete. | |
GetEmissionColorTexture | Obsolete. | |
GetEmissionNormalTexture | Obsolete. | |
GetEmissionPointCount | Obsolete. | |
GetEmissionPointTexture | Obsolete. | |
GetEmissionShape | Obsolete. | |
GetEmissionSphereRadius | Obsolete. | |
GetFlag | Obsolete. Returns true if the specified flag is enabled. | |
GetFlatness | Obsolete. | |
GetGravity | Obsolete. | |
GetHashCode | (Inherited from Object.) | |
GetIncomingConnections | Returns an Array of dictionaries with information about signals that are connected to the object. Each 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. | |
GetIndexed | Gets the object's property indexed by the given 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". | |
GetInstanceId | Returns the object's unique instance ID. This ID can be saved in EncodedObjectAsID, and can be used to retrieve the object instance with @GDScript.instance_from_id. | |
GetLifetimeRandomness | Obsolete. | |
GetLocalScene | If ResourceLocalToScene is enabled and the resource was loaded from a PackedScene instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns null. | |
GetMeta | Returns the object's metadata entry for the given name. | |
GetMetaList | Returns the object's metadata as a String. | |
GetMethodList | Returns the object's methods and their signatures as an Array. | |
GetName | Obsolete. (Inherited from Resource.) | |
GetNextPass | Obsolete. (Inherited from Material.) | |
GetParam | Obsolete. Returns the value of the specified parameter. | |
GetParamRandomness | Obsolete. Returns the randomness ratio associated with the specified parameter. | |
GetParamTexture | Obsolete. Returns the Texture used by the specified parameter. | |
GetPath | Obsolete. (Inherited from Resource.) | |
GetPropertyList | Returns the object's property list as an Array of dictionaries. Each property's Dictionary contain at least name: String and type: int (see VariantType) entries. Optionally, it can also include hint: int (see PropertyHint), hint_string: String, and usage: int (see PropertyUsageFlags). | |
GetRenderPriority | Obsolete. (Inherited from Material.) | |
GetRid | Returns the RID of the resource (or an empty RID). Many resources (such as Texture, Mesh, etc) are high-level abstractions of resources stored in a server, so this function will return the original RID. | |
GetScript | Returns the object's Script instance, or null if none is assigned. | |
GetSignalConnectionList | Returns an Array of connections for the given signal. | |
GetSignalList | Returns the list of signals as an Array of dictionaries. | |
GetSpread | Obsolete. | |
GetTrailColorModifier | Obsolete. | |
GetTrailDivisor | Obsolete. | |
GetTrailSizeModifier | Obsolete. | |
GetType | (Inherited from Object.) | |
HasMeta | Returns true if a metadata entry is found with the given name. | |
HasMethod | Returns true if the object contains the given method. | |
HasSignal | Returns true if the given signal exists. | |
HasUserSignal | Returns true if the given user-defined signal exists. Only signals added using AddUserSignal(String, Array) are taken into account. | |
InitRef | Initializes the internal reference counter. Use this only if you really know what you are doing. Returns whether the initialization was successful. | |
IsBlockingSignals | Returns true if signal emission blocking is enabled. | |
IsClass | Returns true if the object inherits from the given class. | |
IsConnected | Returns true if a connection exists for a given signal, target, and method. | |
IsLocalToScene | Obsolete. (Inherited from Resource.) | |
IsQueuedForDeletion | Returns true if the QueueFree method was called for the object. | |
MemberwiseClone | (Inherited from Object.) | |
Notification | Send a given notification to the object, which will also trigger a call to the _Notification(Int32) method of all classes that the object inherits from. If reversed is true, _Notification(Int32) is called first on the object's own class, and then up to its successive parent classes. If reversed is false, _Notification(Int32) is called first on the highest ancestor (Object itself), and then down to its successive inheriting classes. | |
PropertyListChangedNotify | 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. | |
Reference_ | 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. | |
RemoveMeta | Removes a given entry from the object's metadata. See also SetMeta(String, Object). | |
Set | Assigns a new value to the given property. If the property does not exist, 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). | |
SetBlockSignals | If set to true, signal emission is blocked. | |
SetColor | Obsolete. | |
SetColorRamp | Obsolete. | |
SetDeferred | Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling Set(String, Object) via CallDeferred(String, Object), 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). | |
SetDirection | Obsolete. | |
SetEmissionBoxExtents | Obsolete. | |
SetEmissionColorTexture | Obsolete. | |
SetEmissionNormalTexture | Obsolete. | |
SetEmissionPointCount | Obsolete. | |
SetEmissionPointTexture | Obsolete. | |
SetEmissionShape | Obsolete. | |
SetEmissionSphereRadius | Obsolete. | |
SetFlag | Obsolete. If true, enables the specified flag. See ParticlesMaterialFlags for options. | |
SetFlatness | Obsolete. | |
SetGravity | Obsolete. | |
SetIndexed | Assigns a new value to the property identified by the 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) | |
SetLifetimeRandomness | Obsolete. | |
SetLocalToScene | Obsolete. (Inherited from Resource.) | |
SetMessageTranslation | Defines whether the object can translate strings (with calls to Tr(String)). Enabled by default. | |
SetMeta | 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 RemoveMeta(String). 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". | |
SetName | Obsolete. (Inherited from Resource.) | |
SetNextPass | Obsolete. (Inherited from Material.) | |
SetParam | Obsolete. Sets the specified ParticlesMaterialParameter. | |
SetParamRandomness | Obsolete. Sets the randomness ratio for the specified ParticlesMaterialParameter. | |
SetParamTexture | Obsolete. Sets the Texture for the specified ParticlesMaterialParameter. | |
SetPath | Obsolete. (Inherited from Resource.) | |
SetRenderPriority | Obsolete. (Inherited from Material.) | |
SetScript | 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. | |
SetSpread | Obsolete. | |
SetTrailColorModifier | Obsolete. | |
SetTrailDivisor | Obsolete. | |
SetTrailSizeModifier | Obsolete. | |
SetupLocalToScene | This method is called when a resource with ResourceLocalToScene enabled is loaded from a PackedScene instantiation. Its behavior can be customized by overriding _SetupLocalToScene from script. For most resources, this method performs no base logic. ViewportTexture performs custom logic to properly set the proxy texture and flags in the local viewport. | |
TakeOverPath | Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting ResourcePath, as the latter would error out if another resource was already cached for the given path. | |
ToSignal |
Returns a new SignalAwaiter awaiter configured to complete when the instance
source emits the signal specified by the signal parameter.
(Inherited from Object.) | |
ToString | (Inherited from Object.) | |
Tr | 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 SetMessageTranslation(Boolean). | |
Unreference | 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. |