Владислав
Владислав

Reputation: 297

Fix element at zoom on Phaser3

How to fix an element at one point, despite the zoom? setScrollFactor(x [, y]) doesn't hepl me. I have a moving element behind which the camera is moving. But I need to keep the button always in the right corner

Thanks for the fast reply)

Upvotes: 3

Views: 1059

Answers (1)

keeri
keeri

Reputation: 814

create a separate scene specifically for the element that you want to remain static

in Phaser 3 multiple scenes can exist at the same time, and they have their own cameras (at least one main camera per scene), which allows you to have scene A with a moving camera rendering the game world, and scene B with a static camera rendering the UI

Upvotes: 4

Related Questions