loover Posted November 29, 2017 Share Posted November 29, 2017 Hi. How to add the mask (graphic) to group?. If the mask is added to the group, it no longer masks the sprite inside. Link to comment Share on other sites More sharing options...
samme Posted November 29, 2017 Share Posted November 29, 2017 It should, if the sprite is a member of the group: examples/v2/sprites/sprite-group-mask Link to comment Share on other sites More sharing options...
loover Posted November 29, 2017 Author Share Posted November 29, 2017 In this example, the mask added to the game is used. Not inside a group (e.g. group.add(mask)) that contains boxes. This not works: var group = ...; var box =...; var mask = ...; box.mask = mask; group.add(box); group.add(mask); Link to comment Share on other sites More sharing options...
samme Posted November 30, 2017 Share Posted November 30, 2017 Just remove group.add(mask); Link to comment Share on other sites More sharing options...
loover Posted November 30, 2017 Author Share Posted November 30, 2017 But what if needed to have mask in group? For easy positioning on the screen, for example? Or when there are many masks for many sprites inside a group? What are the technical limitations? Nested groups? Because if we call "game.add.graphics()" game adds this graphics into group called "world". Or not? Link to comment Share on other sites More sharing options...
Recommended Posts