Giter Site home page Giter Site logo

starling-extension-particle-system's People

Contributors

alamboley avatar ericsoco avatar j3k0 avatar kutu avatar primaryfeather avatar rokannon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starling-extension-particle-system's Issues

Problem with emitterType = 1 (EMITTER_TYPE_RADIAL) blank screen

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);

Good workflow to detect then all particles are out.

Hi,

I am using this workflow a lot:

  • add particle system.
  • animate it.. (move for example.. or hold for 1 second(explosion))
  • stop possibility to emit new particles. (emissionRate = 0)
  • check for remaining particle count every enterFrame or timer tick.
  • if numParticles == 0 - stop, remove it from stage and juggler.

It would be nice to have ability to :

  • add a function to ASK particleSystem send event then all particles are removed.
  • dispatch custom event then all particles are out.

it would allow better workflow of detecting empty particle systems and removing them.

Compatibility with Starling 0.9.1

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...

Bug in particle editor

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!

Sprite container flatten

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

ps.batchable = true; drops FPS on Starling 2

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.

Starling 1.5 support

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

Particle Emit Angle ?

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.

Cannot make Sun to work, neither Jellyfish

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):
bug-jellyfish

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:
sun

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?

ParticleSystem class looks for starling.utils.MatrixUtil which is 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?

Starling.current.addEventListener Does Not Exist

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);

Starling scaleFactor on particle system

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)

"BlendMode.isRegistered" and "BlendMode.getAll" do not exist in Starling Latest

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?

missing duration parameter?

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.

Bug of Starling Extension - Particle System, it may not dispatch COMPLETE event

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.

minRadius() should affect particle.emitRadiusDelta

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.