To whom it may concern,
I have a 2d lantern hanging from a chain. The lantern has three particles2d effects on it: Sparks, fire, and smoke. When I set the Local Coords to false for all three particle effects the behavior is expected and when I bump into lantern, the lantern swings and the particles are "left" in global coordinates, as expected.
My intention was to disable emitting of the "fire" particles if the "capture-rect" result is not within the rectangle of the sprite. The result of the "capture-rect" (when the Local Coords is disabled) is in a certain global transform that I cannot "determine"? I have tried the following:
var _rootGlobalTransform = get_tree().root.get_child(0).get_global_transform()
var _tempParticlesRectangle = _rootGlobalTransform.xform(get_node("Lantern_Basic_Particle_Smoke").capture_rect())
print(_tempParticlesRectangle)
_tempParticlesRectangle = get_node("Lantern_Basic_Particle_Smoke").capture_rect()
print(_tempParticlesRectangle)
var _tempParticlesTransform = get_node("Lantern_Basic_Particle_Smoke").get_global_transform()
_tempParticlesRectangle = _tempParticlesTransform.xform(get_node("Lantern_Basic_Particle_Smoke").capture_rect())
print(_tempParticlesRectangle)
The first two print instructions provides the same result, hence my assumption is that the coordinates are based upon the global transform, however, the information does not make sense. The third one starts of by saying the rectangle starts at 0,0. If I just enable the Local Coords for the particle system, then (apart from the obvious that the particles move with the lantern), then the result of "capture-rect" makes sense and is as the particles is (if I do the last "print" section as mentioned).
Either the "capture-rect" is computed incorrectly when the Local Coords are set to false or my transforms are totally "whacky" or I may just totally not understand ... can someone please assist?
Best regards,
Dawie