mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Added new action "Jump emitter forward in time" (#4985)
* This is particularly useful to let emitters create lot of particles first then continue at a slower rate
This commit is contained in:
@@ -372,4 +372,15 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
_("Setup"),
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter", false);
|
||||
|
||||
obj.AddAction("JumpEmitterForwardInTime",
|
||||
_("Jump emitter forward in time"),
|
||||
_("Simulate the passage of time for an emitter, "
|
||||
"including creating and moving particles"),
|
||||
_("Jump _PARAM0_ forward in time by _PARAM1_ seconds"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.AddParameter("number", _("Seconds of time"));
|
||||
}
|
||||
|
@@ -178,6 +178,8 @@ class ParticleSystemJsExtension : public gd::PlatformExtension {
|
||||
.SetFunctionName("setTexture")
|
||||
.SetGetter("getTexture");
|
||||
conditions["ParticleSystem::Texture"].SetFunctionName("getTexture");
|
||||
actions["ParticleSystem::JumpEmitterForwardInTime"].SetFunctionName(
|
||||
"jumpEmitterForwardInTime");
|
||||
|
||||
strExpressions["Texture"].SetFunctionName("getTexture");
|
||||
expressions["CurrentParticleCount"].SetFunctionName("getParticleCount");
|
||||
|
@@ -849,6 +849,10 @@ namespace gdjs {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jumpEmitterForwardInTime(timeSkipped: number): void {
|
||||
this._renderer.update(timeSkipped);
|
||||
}
|
||||
}
|
||||
gdjs.registerObject(
|
||||
'ParticleSystem::ParticleEmitter',
|
||||
|
Reference in New Issue
Block a user