Hanming Zeng
Hanming Zeng

Reputation: 367

How to add fixed text

This question is specific to aframe library.

I was wondering how you can make a text always fixed on the screen, no matter how users move/look around;

E.g. I am developing an aframe VR game and I want to show the scores on the top left of the screen. So no matter what angle the user looks at or wherever he moves to, he will be able to see the his score on the screen.

Hope my question is clear enough.

Upvotes: 0

Views: 402

Answers (1)

Diego Marcos
Diego Marcos

Reputation: 4585

You have to make the text a child of the camera:

<a-camera>
 <a-text value="Hello, World!" position="0 0 -1"></a-text>
</a-camera>

This will place the text 1m in front of the user.

Upvotes: 3

Related Questions