-
I am using the ScreenElement for a UI, so that it always remains in place when the camera is moving around.
Code class Game extends Engine {
constructor() {
super({ width: 800, height: 600 })
Physics.useRealisticPhysics()
Physics.gravity = new Vector(0, 800)
const loader = new Loader([...])
this.start(loader).then(() => this.startGame())
}
startGame(){
let test = new ScreenElement()
this.add(test)
}
}
new Game() Another problem is that if I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @KokoDoko that error also seems like a bug... I think it might be because there is no width/height specified in the ScreenElement so it tries to create a 0/0 collider causing the message. Thanks for spotting, I'll add another bug for that! To have the children independent of the camera try setting their
|
Beta Was this translation helpful? Give feedback.
Hi @KokoDoko that error also seems like a bug... I think it might be because there is no width/height specified in the ScreenElement so it tries to create a 0/0 collider causing the message. Thanks for spotting, I'll add another bug for that!
To have the children independent of the camera try setting their
TransformComponent.coordPlan
to Screen or use anotherScreenElement
as the child.ScreenElement
under the hood is really just sugar on top of actor to set a couple of properties that are convenient for that use case.