oddskill Posted July 21, 2014 Share Posted July 21, 2014 Hello. First of all im an absolute beginner in phaser and game related programming in general,so sry if that topic is already covered in some example, if so plz give me a link, tx. Lets say we have a background likehttp://picthost.net/v.php?id=dc26ca428c6589e7a396ed99ec9ccce8 Now i want some sprites to show sliding up from behind the diffrent"mountains". Is there an easy way to achive that in phaser?Do i have to make multiple layers with transparency and the diffrent mountains?How to make only the visible part of the appearing sprites clickable? Any suggestions / links ? best regards Chris Link to comment Share on other sites More sharing options...
Dumtard Posted July 21, 2014 Share Posted July 21, 2014 If you want things to be between different mountains I would make each one separately with transparency and add them in the order you see fit.As for clicking visible parts.http://examples.phaser.io/_site/view_full.html?d=input&f=pixel+perfect+click+detection.js&t=pixel%20perfect%20click%20detectionandhttp://examples.phaser.io/_site/view_full.html?d=input&f=pixelpick+-+atlas.js&t=pixelpick%20-%20atlas oddskill 1 Link to comment Share on other sites More sharing options...
oddskill Posted July 21, 2014 Author Share Posted July 21, 2014 Thank you Dumtard, both links link to the same url but i got the point of the pixelperfect click detection. So basically i have to calculate by myself if a sprite is visible or is there already a way to makesomething like a "hidden border polygon" that prevents the sprites from receiving the on click event ? best regards Chris Link to comment Share on other sites More sharing options...
Dumtard Posted July 21, 2014 Share Posted July 21, 2014 I edited the second link, not sure why it was pointing to the same thing.As for your question, I am not sure but I believe if a sprite is behind another the top sprite will receive the click event and the bottom one will not, which is what I believe you are asking. I am not at a computer I can make a quick test on so I am not sure. Link to comment Share on other sites More sharing options...
oddskill Posted July 21, 2014 Author Share Posted July 21, 2014 Thank you very much Dumtard.I can test that by myself.I consider my question answered, if i will encounter a problem i will open a new threadregarding the specific problem with code example. best regards Chris Link to comment Share on other sites More sharing options...
Recommended Posts