Have elements relative to camera position?

Is there a way to have elements move relative to the camera’s posistion? (like a HUD) that’t not using camera.x and camera.y?

@kookooloopdaking
I don’t understand what you’re trying to do. camera.x and camera.y and camera.zoom is the only way your HUD will move out position.
Here’s what I did to solve my problem.

     push();
     scale(1/camera.zoom);
     translate(camera.x-400+200*camera.zoom, camera.y-400+200*camera.zoom);
     drawHeadsUpDislay();
     pop();

Hi @kookooloopdaking,

I’m assuming you’re in Game Lab for this question. To my knowledge the answer is no, because Game Lab is an educational tool designed to be an introduction to coding in JavaScript for middle school students. As such, it’s limited to a two-dimensional canvas. 3D design is beyond the scope of how Game Lab is intended to be used.

If you’re interested in 3D game design, I’m sure there’s plenty of resources on the Internet that can help you expand your skill set. Does anyone on this forum have any links to ones they’ve used?

Best,
Michael K.