kollehel Posted May 3, 2018 Share Posted May 3, 2018 Hi! I am about to start creating a new RPG card game, which will have a lot of visual effects, for which the particle emitter of the Phaser 3 will be perfect. But since I need to rotate the cards in perspective, as you can see on the following video, and since the perspective is not (yet) implemented in Phaser 3, I thought to combine Phaser 3's canvas with regular HTML DOM elements. More specific what I thought to do is to create most of the game using HTML DOM elements and JavaScript, and to place the Phaser 3-s div and canvas somewhere inbetween them with transparent background, which will hold all the particle emitters needed. Eventually might use 2 Phaser instances and canvases on 2 different layers. What do you think about this combination? Can it work smoothly on mobile devices? Would it have any drawbacks? https://drive.google.com/file/d/1clkc0OW2OdHUS6iPVZdzS60pklAEPkcf/view?usp=sharing Thank you! Lehel Kolumban 9F473020-5F52-42D1-96ED-8D26419DBDDA.MP4 Link to comment Share on other sites More sharing options...
samme Posted May 3, 2018 Share Posted May 3, 2018 There's probably a way to apply the perspective transformation in Phaser, if you know the formula. Might be simpler that way. Link to comment Share on other sites More sharing options...
kollehel Posted May 4, 2018 Author Share Posted May 4, 2018 I have tried really hard to find it, but without any success. I would be very grateful if somebody could show me how to do it. I also would very gladly take any advice and any pro/cons regarding the above mentioned combination. Thanks! Link to comment Share on other sites More sharing options...
samme Posted May 4, 2018 Share Posted May 4, 2018 15 hours ago, samme said: There's probably a way to apply the perspective transformation in Phaser, if you know the formula. Might be simpler that way. Hm, there was transformCallback for this in Phaser 2 but I don't see anything like that for 3. Maybe something with Containers. Link to comment Share on other sites More sharing options...
Antriel Posted May 4, 2018 Share Posted May 4, 2018 You could use Quads, but keep in mind it's WebGL only. Link to comment Share on other sites More sharing options...
kollehel Posted May 4, 2018 Author Share Posted May 4, 2018 @Antriel yeah, I saw that Quads sample, but it's not exactly a perspective solution, and making a 3D-like card flip animation with it would be very hard to do. Link to comment Share on other sites More sharing options...
Antriel Posted May 5, 2018 Share Posted May 5, 2018 Well there is perspective camera in phaser 3, but I'm not sure how usable it is for now. For a simple card flip I would look into using a quad anyway, it should be just a bit of matrix math. Link to comment Share on other sites More sharing options...
Recommended Posts