bear
bear

Reputation: 663

How to attach text to camera in Aframe?

I want to render a text overlay on the camera that moves with the camera in my aframe scene.

My camera entity looks like this:

<a-entity position="33 0 -33" rotation="0 180 0" 
  look-controls id="camera" camera="userHeight: 1.6" listener>
</a-entity>

and my text entity looks like this:

<a-entity text="value: HELLO; color: red; width: 2;" position="0 0 0">
</a-entity>

But when I put the text entity inside the camera entity, the text is not visible:

<a-entity position="33 0 -33" rotation="0 180 0" look-controls 
  id="camera" camera="userHeight: 1.6" listener>
  <a-entity text="value: HELLO; color: red; width: 2;" position="0 0 0" >
  </a-entity>
</a-entity>

How do I have to place the text element to make it a visible overlay to the camera view?

Upvotes: 0

Views: 1507

Answers (1)

ngokevin
ngokevin

Reputation: 13233

Position it away from the camera a bit.

position="0 0 -1"

Upvotes: 1

Related Questions