ogrotten Posted October 11, 2018 Share Posted October 11, 2018 I'm building a card game. 6 columns (phaser groups) of 5 cards. The goal is to click the card on top and move it to the discard group. Currently, when i click the card, it is apparently removed from rendering. Console shows visible = true, it's new parent group shows visible = true, coords are valid, and the console shows that the new group has it and the old group has removed it. I can move the clicked card on xy, no problem. But as soon as I try to add it to a group, it disappears. Here's the entire source on JS Fiddle. The callback function for the interaction is function tap() and lives at the bottom, of the source. Link to comment Share on other sites More sharing options...
samme Posted October 11, 2018 Share Posted October 11, 2018 Use game.debug.spriteInfo(…) and check the world coordinates. Link to comment Share on other sites More sharing options...
ogrotten Posted October 12, 2018 Author Share Posted October 12, 2018 Thanks for responding. Here's the result That's the default 800x600 screen, and you can see which one I clicked. The shown coords where it says the sprite resides is just to the right of that lone card at the bottom. Would building a stage for it help contain things? Link to comment Share on other sites More sharing options...
ogrotten Posted October 12, 2018 Author Share Posted October 12, 2018 Based on the spriteinfo, the 'bounds' info is different whenever I click another card. When I click the faceup card on the 2nd stack, bounds changes to x:141.5 y:160 with W and H remaining unchanged. Is it possible that the rectangle that frames the card is moving around without the underlying spritesheet, or something like that? Link to comment Share on other sites More sharing options...
nazimboudeffa Posted October 12, 2018 Share Posted October 12, 2018 I can't understand your code can you make a video on youtube and post it or make a live to let me participate in the chatroom ? btw, there is an error Link to comment Share on other sites More sharing options...
ogrotten Posted October 13, 2018 Author Share Posted October 13, 2018 I figured out the problem. The destination group pivot point was set to px 400,500. Then the incoming sprite had was also placed at 400,500. that means that the card was put at worldcoords of 800,1000. once I figured that out, the sprite appears where it needs to. Thanks for the replies. Link to comment Share on other sites More sharing options...
Recommended Posts