I would like to change size of Particle Emitter from JavaScript before object is created in the scene - this is the property I’m talking about visible in GDevelop GUI:
In search of what I would have to change in the JavaScript code I adjusted the size value to something that will be easy to find in text files (32523523458), exported the project for Mobile and then recursively grepped exported files looking for 32523523458 value - it was found in www/data.js file and assigned to rendererParam1 as follows:
NOTE! The setParticleSize1 relates to Particle start size (in percents) in the GUI and when adjusted to above 100 it produces pixelated particle (more pixelated, larger the value is) - so adjusting setParticleSize1 is not a solution that I’m looking for!
I’m not at my PC. Have you looked at the documention?
I’m wondering if you need to recreate the particles or otherwise reset something after changing the size. recreateParticleSystem()
Just thinking out loud.
I indeed looked at the documentation and was able to figure out many other things - not this one though.
I actually spent two days not only reading documentation but also trying various permutations of multiple things I could find online and come up with myself - unfortunately I could not figure this out.
I love a good challenge. I finally got to my PC. The closest I found was renderParam1
Since setParticleSize1 is a scale value. A workaround would be to set the size in the behavior screen to a large number and then scale down instead of scaling up.
For the curious here’s comparison to upscaling when particle size value is set to 16 in Particle Emitter properties in GDevelop GUI - it does not look good at all:
The other option is to not do that part in JavaScript or maybe have multiple emitters preset to different sizes. Swap them as needed. IDK. I’m persistent but the more I dig into the subject, the more I learn. There should still be a JS way. We have access to all of the apps code.
@Keith_1357 - I already went with 10 emitters that use different size (but otherwise use exactly same configuration) and my code selects approximately most appropriately sized emitter when needed - not an ideal solution but works for time being.
If somebody who reads this at later time has some idea how to change size of Particle Emitter from JavaScript before object is created in the scene - the help would be still appreciated!