Robske Posted September 16, 2014 Share Posted September 16, 2014 I have an issue with scaling an selecting scaled items. Please accept my apologies if this has been answered before. I am a n00b with Phaser, but trying my best. I want to scale layers and be able to select items on the scaled layer. Without scaling this works fine. With scaling, it doen't. A sample says more than 1000 words, so please check this: http://dev.webfeud.com/phaser/ When you try to select the second yellow tile, the 3rd or 4th tile is actually selected. How can I avoid this? Thanks in advance! Link to comment Share on other sites More sharing options...
lewster32 Posted September 16, 2014 Share Posted September 16, 2014 I think using game.input.getLocalPosition(board, game.input.activePointer) should return the correct position of the pointer relative to the display object you've scaled, so you can then determine which tile it's over. See Input#getLocalPosition for more info. Robske 1 Link to comment Share on other sites More sharing options...
Robske Posted September 16, 2014 Author Share Posted September 16, 2014 lewster32, you made my day! Your answer was not entirely accurate, but it put me in the right direction. Updated the link to relfect the changes. lewster32 1 Link to comment Share on other sites More sharing options...
lewster32 Posted September 16, 2014 Share Posted September 16, 2014 Sorry, I may not have gotten the variable right for the board - didn't really take more than a cursory glance at the code - but glad it helped Robske 1 Link to comment Share on other sites More sharing options...
Recommended Posts