Giter VIP home page Giter VIP logo

Comments (6)

datpt91 avatar datpt91 commented on June 23, 2024

If you need me to provide Video and Log file, just me know!

from leonids.

plattysoft avatar plattysoft commented on June 23, 2024

This works as intended.

A particle system does create a pool of particles and attaches itself to the view hierarchy. It is meant to be used in one of the following ways:

  • As a continuous emitter for as long as the view is active
  • As a oneShot that is used once when the view is active
  • As a oneShot that is triggered several times

If you want to create multiple particle systems and make them auto-release once the oneShot is completed, you need to add a listener there and remove the particle system from the View hierarchy.

As I said, that is not the way it is intended to work, you should create a few particle systems and reuse them, but if you really want to go that way, the solution is what I stated before.

from leonids.

datpt91 avatar datpt91 commented on June 23, 2024

Dear Mr Raul,
Thank you very much for your detail explanation.
First of all, I tried to define ParticleSystem object in onCreate rather
than in onTouch in your example but it will lead to force close program.

Second thing is with oneShot it doesn't specify emit point position like
emit(). Which I do is using only one single view on screen and divide it to
many regions to identify touch areas with different effects. I use your lib
as kid mode. So maybe they can play with it for long time.

If you have any ideas for this problem, could you please let me know.

Thank you again for all your help.
On Feb 19, 2016 6:30 AM, "Raul Portales" [email protected] wrote:

Closed #38 #38.


Reply to this email directly or view it on GitHub
#38 (comment).

from leonids.

plattysoft avatar plattysoft commented on June 23, 2024

The position is calculated based on the parent view, setting the position was a later addition for special cases like the follow touch example.

It should be possible to create a particle system during onCreate, as long as it is done after setContentView.

You can change the position anytime using the same method and then call oneShot. If it does not, that is a bug that should be solved (I haven't tried that particular case myself).

In this case, each time the user clicks, the oneShot will move, so if it is clicked before the previous one finishes there could be a visual glitch.

I suggest you create a pool of ParticleSystems and dynamically change the position and call oneShot, adding a listener when the oneShot is completed to return the particle system to the pool.

Given that each ParticleSystem creates a View to draw with, a small number should be easy to manage (that is also the cause of the unresponsiveness on your case)

The other solution is to create a method that finalizes the oneShot by removing the particle system from the view hierarchy.

The first solution (pool) is probably easier.

from leonids.

datpt91 avatar datpt91 commented on June 23, 2024

Thank you very much for your help, it works well now. I already handled
memory issue.

2016-02-22 17:46 GMT+07:00 Raul Portales [email protected]:

The position is calculated based on the parent view, setting the position
was a later addition for special cases like the follow touch example.

It should be possible to create a particle system during onCreate, as long
as it is done after setContentView.

You can change the position anytime using the same method and then call
oneShot. If it does not, that is a bug that should be solved (I haven't
tried that particular case myself).

In this case, each time the user clicks, the oneShot will move, so if it
is clicked before the previous one finishes there could be a visual glitch.

I suggest you create a pool of ParticleSystems and dynamically change the
position and call oneShot, adding a listener when the oneShot is completed
to return the particle system to the pool.

Given that each ParticleSystem creates a View to draw with, a small number
should be easy to manage (that is also the cause of the unresponsiveness on
your case)

The other solution is to create a method that finalizes the oneShot by
removing the particle system from the view hierarchy.

The first solution (pool) is probably easier.


Reply to this email directly or view it on GitHub
#38 (comment).

from leonids.

plattysoft avatar plattysoft commented on June 23, 2024

Good to know, I hope this thread is useful for someone else in your situation.

from leonids.

Related Issues (20)

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.