A
A
Alecxandrys2017-02-27 12:16:47
JavaScript
Alecxandrys, 2017-02-27 12:16:47

How to nicely place two sprites on top of each other with different events?

Good afternoon,
How to correctly place two sprites (using add.sprite()) on top of each other in Phaser.io.
bringToTop allows you to draw them in the right order, but the problem is that both sprites have a click event attached to them, and in any case it handles the event on the bottom sprite, despite the fact that it is overlapped by the top one (it is not transparent and inputEnable is made for it =true) respectively, in fact the bottom one is not even visible.
The events themselves are attached by events.onInputDown.add().
Why is the event of the top sprite not working, and how to fix the situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GreatRash, 2017-02-27
@GreatRash

phaser.io/examples/v2/sprites/destroy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question