gamua / starling-extension-particle-system Goto Github PK
View Code? Open in Web Editor NEWA particle system for the Starling framework, compatible with the "Particle Designer" from 71squared.com
License: Other
A particle system for the Starling framework, compatible with the "Particle Designer" from 71squared.com
License: Other
Hello,
I exported my particle system config form http://onebyonedesign.com/flash/particleeditor/
But the Radial emitter type doesn't work anymore. I got a blank screen. The gravity emitter type works great.
I also tryed with random configurations
Here my code :
var config:XML = XML(new OrbParticle_Config());
var texture:Texture = Texture.fromBitmap(new OrbParticle_Texture());
_particleSystem = new PDParticleSystem(config, texture);
_particleSystem.emitterType = 1;
_particleSystem.emitterX = 160;
_particleSystem.emitterY = 240;
_particleSystem.start();
addChild(_particleSystem);
Starling.juggler.add(_particleSystem);
Hi,
I am using this workflow a lot:
It would be nice to have ability to :
it would allow better workflow of detecting empty particle systems and removing them.
Hi,
I just updated Starling to 0.9.1 and now the ParticleSystem class is reporting errors.
Can you confirm that the recent changes to the framework broke this extension ?
I got to fix most problems, but the instruction :
Image.getProgramName(mTexture.mipMapping)
in the render() method is giving me some trouble...
Started using the "real" Particle Desginer by 71squared recently, instead of the online one at http://onebyonedesign.com/flash/particleeditor/.
It looks like there's a bug in the online particle editor where what should be finishParticleSizeVariance
is exported as FinishParticleSizeVariance
. This bug doesn't exist in Particle Designer by 71squared.
Looks like PDParticleSystem expects the bug to be there, i.e. it looks for the incorrect FinishParticleSizeVariance
in the config XML. The NaN's that resulted cost me almost a full day's work today trying to figure out why particles from the online tool displayed fine, but particles from Particle Designer didn't display at all. I assume this was done in order to not break particles exported by the online tool.
It would seem we need to have some way of accounting for the bug, or at least return 0 for any unknown variables in parseConfig
instead of NaNs.
If I can figure out how to do a pull request, I will do so!
Hi,
When you add PDParticleSystem object to the Sprite container and then use flatten() to this container Starling will throw error:
Error: Unsupported display object: starling.extensions::PDParticleSystem
Testing with 27 PDParticleSystem (fire fx), I got 40fps with 27 draw calls. Adding the line ps.batchable = true;
, fps dropped to 30 and still got 27 draw calls. After adding the line ps.parent.blendMode = ps.blendMode;
, fps was around 31 and I got 1 draw call.
Is this the expected results using batchable?
I am using Starling 2.3 January release version and this extension latest version.
particleSys.emitAngleVariance = angle;
range between 1-150 not working, only works when i change it to 0
My bad i've noticed is using radians
Hi,
When trying to use this extension with Starling Release 1.5 produces error in ParticleSystem.as line 178 Cannot convert Vector. to ByteArray
Best,
Andrei
I can´t find a way to change the Particle Emit Angle on a ParticleDesignerPS at runtime. Anyone know if this property exist somewhere?. Greetings.
Hi Daniel,
I've tried to see all the Demo examples, but Sun doesn't work at all and Jellyfish works with squares (see the image below):
I got sun to work only when changed the .pex file blendFunc:
//FROM
<blendFuncSource value="772"/>
<blendFuncDestination value="771"/>
//TO
<blendFuncSource value="770"/>
<blendFuncDestination value="772"/>
Image of sun "working" with the changes in blendFunction:
I am using FD to compile the project with Flex + AIR 4.6.0 + 23.0.0, compiled the project with -swf-version=34
, using FP sa debugger (latest version: 28) and Starling v2.1 that says [Starling] Context ready. Display Driver: DirectX11 (Baseline Extended)
. Any ideas of what I'm missing?
I'm new to starling, so I'm not sure if this is a new problem, or more likely, I'm doing something wrong.
When I try to instantiate a new PDParticleSystem, I get an error that starling.utils.MatrixUtil doesn't exist.
Line 32 of ParticleSystem.as: import starling.utils.MatrixUtil;
I navigate to starling.util, and this class is missing. I redownloaded starling just in case, but its not there either. Am I missing something?
While using ATF as texture , none of the particles can be displayed.
ParticleSystem.as has a call to Starling.current.addEventListener and Starling.current.removeEventListener -- Starling.current returns the current Starling, which does not contain event listeners.
This is with the latest version of Starling.
Line 88 for the add and line 96 for the remove.
Starling.current.addEventListener(Event.CONTEXT3D_CREATE, onContextCreated);
Seems scaleFactor is not being taken in account on particle system. It can be tricky because it'll affect to x/y translations too, but should be be revised.
Perhaps adding some kind of boleean property (or constructor variable) to specify if we want to use or ignore scaleFactor can be a good decision (since if we use scaleFacto with this will affect performance).
Edit: To be more specific: The particle size is being doubled (on screen) when scaleFactor is 2 (I'm using the same .png and .pex for both scaleFactors)
Edit 2: To be even more specific: I'm using a particle system inside an Sprite. I'm scaling that Sprite to 0.6:
- On iPad (scaleFactor 1 since I use same stage size and viewport size) the particle has normal size.
- On iPhone 3GS (scaleFactor 1) the particle has the same size as iPad.
- On iPhone 4 (scalefactor 2) the particle has double size respect iPad and iPhone 3GS
Edit 3: Sorry for all the edits. The only issue is that particle size is not being scaled with scaleFactor. x/y translations/rotations shouldn't be a problem (or can be a problem, since speed will be doubled on scaleFactor 2, but that speed problem is inherited from Starling itself since scaleFactor scales width and height but doesn't modify at all x/y on realtime)
I found the PDParticleSystem doesn't support the "duration", that makes the particles can't emmit in the same time.
or, is there any way to create the fireworks just like http://www.flash-core.com/examples/g2d/fireworks/ ?
I am trying to get the Starling-Particle-Editor to compile with the latest commit of "Starling-Extension-Particle-System" and get the following compiler errors:
[Starling-Particle-Editor - Main]: Call to a possibly undefined method isRegistered through a reference with static type BlendMode.
[Starling-Particle-Editor - Main]: Call to a possibly undefined method getAll through a reference with static type BlendMode.
I made sure that BlendMode is properly pointing to "starling.display.BlendMode".
I am using latest Starling.swc.
The latest documentation of BlendMode does not list these two methods (https://doc.starling-framework.org/current/starling/display/BlendMode.html).
Am I missing something?
In Particle Designer, you can assign a duration. You might use 0.1 for something like an explosion or firework, and -1 (unlimited) for something like smoke or fire that should run constantly.
This extension doesn't seem to parse/remember/respect that duration.
I would like to be able to write something like this:
particle.start(particle.duration);
As it is, it appears I have to parse the XML myself to find the desired duration that I set in Particle Designer, or hard-code it into my code.
The starling extension, particle system, it may not dispatch COMPLETE event on some circumstance.
Due to the code downhere in ParticleSystem.advanceTime :
if (mNumParticles == 0 && mEmissionTime == 0)
dispatchEvent(new Event(Event.COMPLETE));
if the mEmissionTime member is not zero, the the event COMPLETE will be not disptached. but the mEmissionTime is minused after that code
So it may add code after the mEmissionTime change, like below,
if (mEmissionTime != Number.MAX_VALUE)
mEmissionTime = Math.max(0.0, mEmissionTime - passedTime);
if (mNumParticles == 0 && mEmissionTime == 0)
dispatchEvent(new Event(Event.COMPLETE));
I've tested the code, it works.
Thanks. Hope it help.
At the moment, the particle emitRadiusDelta is calculated without the minRadius():
particle.emitRadiusDelta = mMaxRadius / lifespan;
But it should be ...
particle.emitRadiusDelta = ( mMaxRadius - mMinRadius ) / lifespan;
... to emulate the behavior of Particle Designer 2.0, I think.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.