Particle Problem!

Hi, im trying to add particle system to my game. I am using the online editor at http://onebyonedesign.com/flash/particleeditor/ and have succesfully imported the .pex file. But the particles disappear when they move into a white surface.

How do i fix this?

Hi @joelsc.linder,

Can you post the basic code on how you’re outputting these particles? In your screenshot, what is the black bar and what is the white around it? Is the white the background or is it two objects in front of the black background and particles?

When posting code, please surround it with “lua” tags for clarity in the forums:

[lua] -- code [/lua]

Best regards,

Brent

The black line is a rect and under and over there are two white rects.

i have a global script to declare variables for the particle resources.

//particles.lua local this = {} this.part\_fire\_pex = "particle.pex" this.part\_fire\_tex = "texture.png" return this

Here`s my scene code. i have removed the other game code not related to the particle loading

--i import my particles.lua and the pex import library local particles = require("particles") local pex = require "com.ponywolf.pex" --create local objects local particle local emitter --load the particle and create a emitter particle = pex.load(particles.part\_fire\_pex,particles.part\_fire\_tex) emitter = display.newEmitter(particle) --put the emitter in the center emitter.x = display.contentCenterX emitter.y = display.contentCenterY sceneGroup:insert(emitter)

Hi @joelsc.linder,

Are the white rectangles in front (z-index/layering) of the particle emitter? Such that they would be obscuring the particles?

Best regards,

Brent

i don`t think so, i changed the color on the white blocks to black and then the particles were fully visible.

Hmmm, in that case, it’s probably a “blend mode” issue with the particle setup, such that when the particles overlay white (or very bright) pixels, the blend setting throws their RGB values all the way out to full white. But, when you have them overlaying black (or dark) pixels, you can see them.

All particle effects have various blend settings. Try experimenting with the different options and how the particle pixels appear over different background colors.

Brent

Hi @joelsc.linder,

Can you post the basic code on how you’re outputting these particles? In your screenshot, what is the black bar and what is the white around it? Is the white the background or is it two objects in front of the black background and particles?

When posting code, please surround it with “lua” tags for clarity in the forums:

[lua] -- code [/lua]

Best regards,

Brent

The black line is a rect and under and over there are two white rects.

i have a global script to declare variables for the particle resources.

//particles.lua local this = {} this.part\_fire\_pex = "particle.pex" this.part\_fire\_tex = "texture.png" return this

Here`s my scene code. i have removed the other game code not related to the particle loading

--i import my particles.lua and the pex import library local particles = require("particles") local pex = require "com.ponywolf.pex" --create local objects local particle local emitter --load the particle and create a emitter particle = pex.load(particles.part\_fire\_pex,particles.part\_fire\_tex) emitter = display.newEmitter(particle) --put the emitter in the center emitter.x = display.contentCenterX emitter.y = display.contentCenterY sceneGroup:insert(emitter)

Hi @joelsc.linder,

Are the white rectangles in front (z-index/layering) of the particle emitter? Such that they would be obscuring the particles?

Best regards,

Brent

i don`t think so, i changed the color on the white blocks to black and then the particles were fully visible.

Hmmm, in that case, it’s probably a “blend mode” issue with the particle setup, such that when the particles overlay white (or very bright) pixels, the blend setting throws their RGB values all the way out to full white. But, when you have them overlaying black (or dark) pixels, you can see them.

All particle effects have various blend settings. Try experimenting with the different options and how the particle pixels appear over different background colors.

Brent