I have set up a scene using A-frame () where I currently have a green box attached to the camera at all times. However, as the camera moves, the box also moves along with it. My question is, how can I position the box in the top right corner of the screen regardless of the device being used? Right now, I am using the 'position' property in A-frame to try and place the box in the top right corner, but on smaller screens, the box doesn't appear, while on larger screens, it appears in the middle of the screen. Is there a way to ensure that the box stays glued to the top right corner no matter the screen size?
Current code:
<html>
<head>
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-camera>
<a-plane color="green" scale="0.7 0.4 0.6" position="1.5 0.75 -2" rotation="5 -15 -2.5"></a-plane>
</a-camera>
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
</body>
</html>
Here's the Fiddle with the code: https://jsfiddle.net/AidanYoung/0sjLrhfg/