将元素固定在Phaser3的缩放上 [英] Fix element at zoom on Phaser3
问题描述
尽管缩放,如何将元素固定在一个点上? setScrollFactor(x [, y])
不帮助我.
我有一个正在移动的元件,相机在该元件后面移动.但是我需要始终将按钮保持在右角
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
感谢您的快速回复
推荐答案
为要保持静态的元素专门创建一个单独的场景
create a separate scene specifically for the element that you want to remain static
在Phaser 3中可以同时存在多个场景,并且它们具有自己的摄像机(每个场景至少有一个主摄像机),这使您可以将场景A和移动的摄像机渲染到游戏世界中,而场景B用静态相机渲染用户界面
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
这篇关于将元素固定在Phaser3的缩放上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!