captainHook Posted December 1, 2018 Share Posted December 1, 2018 Hi guys, I am working on a rpg game with tilemap. Everything is ok concerning tilemap integration, but I have a problem that I can't elucidate concerning a kind of UI I would like to create for this game. Concretely, I need static panels on my game on each side of the tilemap part. But (logically) when I try to implement this, I have a problem with panels coordinates because camera follow the players (whose coordinates reflect tilemap coordinate). The only trick I found to implement those panels is to adjust panels coordinates on the player one's, but that seems a really poor solution... I wonder if there could be an other solution that would imply other layer/canvas element but dont know how to implement it. Does someone know to achieve this with phaser3 or give me hints ? Link to comment Share on other sites More sharing options...
Olf Posted December 3, 2018 Share Posted December 3, 2018 Game Objects can be fixed to a camera with ".setScrollFactor(0)" : Phaser 3 example captainHook and samme 2 Link to comment Share on other sites More sharing options...
Telinc1 Posted December 3, 2018 Share Posted December 3, 2018 When you're more comfortable with Phaser, you can also consider moving your panels to a separate Scene. That would allow you to keep the UI's display list and logic separate from your gameplay, which may end up being easier to work with. For now, however, I'd go with Olf's solution of using `setScrollFactor`. samme and captainHook 2 Link to comment Share on other sites More sharing options...
samme Posted December 4, 2018 Share Posted December 4, 2018 http://labs.phaser.io/view.html?src=src\scenes\ui scene.js captainHook 1 Link to comment Share on other sites More sharing options...
captainHook Posted December 7, 2018 Author Share Posted December 7, 2018 Thank you very much for your answers, guys. Link to comment Share on other sites More sharing options...
Babsobar Posted December 7, 2018 Share Posted December 7, 2018 I had this exact question and I resolved my problem by building a new scene that contained all the UI and launching it from create captainHook 1 Link to comment Share on other sites More sharing options...
Recommended Posts