1.0.0.9 FXFields events

I am testing this cool new feature. 2 things :

1. a strange behaviour :
Admitting :

1
2
3
4
5
6
7
8
9
10
11
12
function MyFXField1Listener(event)
        local Particle = event.Particle
        local FXField  = event.FXField
        if event.phase == "enter" then print("PARTICLE ENTERED FIELD '"..FXField.name.."'") end
        if event.phase == "leave" then print("PARTICLE LEFT FIELD '"..FXField.name.."'")    end
end
Particles.AddFXListener("MyField1", MyFXField1Listener)
 
function MyFXField2Listener(event)
        -- nothing here
end
Particles.AddFXListener("MyField2", MyFXField2Listener)

1.) You are right, in the current version, each fx event is broadcasted to ALL fx listeners you define. We will address this in the next release.

Until then, you can either assign ID numbers to both, particles and FX Fields. The FX Field will ignore particles with another ID then.

As another workaround, you can also check the particle's type within the fx event listener:

1
2
3
4
5
function MyFXListener(event)
   if event.Particle.PType.name == "MyParticleType1" then
   ...
   end
end

Unfortunately, the ID does not solve my case. It's not a problem, I can wait for the next release, I have so many things to do ...

Concerning assign ID, I remember this case :
- 2 particles, 2 fields
-> I did not managed to this : field 1 acts on both field, field 2 acts on one particle only. (setting multiple fxID to a particle could help) ... don't know

You can assign one ID per field (as well as one ID per particle type). Having multiple IDs would further increase the processing power which would probably not be suitable for most other users unless there is a broad demand for it. This is always something we have to ponder about...

The issue you described above has already been fixed and will be included in the next update. If you need it asap, please email us, we'll send you the latest version then.

It's ok, I think I can wait the update. Thx for your top notch support :)

views:1673 update:2011/10/14 9:11:21
corona forums © 2003-2011