cocos2d-1 particle emitter problem

Problems with Canvas, OpenGL, etc...

cocos2d-1 particle emitter problem

Postby sourcecode » Sat Apr 09, 2011 12:18 am

Hello folks,

i'm new to this board , so hello erstmal :)
i have a small problem with the cocos2d particle emitter.

cocos2d is a real nice framework and everything i tried worked fine till now.
for a small game i wanted to add a particle emitter
i tried different ways but none of them seemed to work
here is a snippet of the currently used test setup:
(invoked in onEnter method of the layer)
Code: Select all
CCParticleFlower particle  = CCParticleFlower.node();
             particle.setTexture(CCTextureCache.sharedTextureCache().addImage("zap.png"));
             particle.setPosition(200,200);
             particle.setLife(10.0f);
             particle.setDuration(1.5f);
             particle.setSpeed(100);
             particle.setAutoRemoveOnFinish(true);
   
   
             addChild(particle,0);

nothing appears.
i also tried to set it up with a schedule("createParticles",xx) method.
then the logcat throws this exception:
04-09 00:59:55.452: WARN/System.err(16403): java.lang.NullPointerException
04-09 00:59:55.452: WARN/System.err(16403): at org.cocos2d.actions.CCTimer.update(CCTimer.java:61)
04-09 00:59:55.460: WARN/System.err(16403): at java.lang.reflect.Method.invokeNative(Native Method)
04-09 00:59:55.460: WARN/System.err(16403): at java.lang.reflect.Method.invoke(Method.java:521)
04-09 00:59:55.468: WARN/System.err(16403): at org.cocos2d.actions.CCScheduler.tick(CCScheduler.java:196)

i used the cocos2d.jar lib from github.
has anyone noticed the same problem or got a quick fix?
would appreciate your help
sc
sourcecode
Freshman
Freshman
 
Posts: 2
Joined: Sat Apr 09, 2011 12:04 am

Top

Re: cocos2d-1 particle emitter problem

Postby sourcecode » Sat Apr 09, 2011 10:07 pm

hm i got a workaround,
i just imported the source and created a png file in the assets folder with the name: fps_images.png
don't ask me why this works, in a later try with the sourcecode i realised it was missing a fps_images.png in the log.
if someone has an explanation for this, please enlighten me :)

greetings earthlings
sourcecode
Freshman
Freshman
 
Posts: 2
Joined: Sat Apr 09, 2011 12:04 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests