Andrew Vaughn
Andrew Vaughn

Reputation: 7

Does aframe allow a user to have a button or text fixed to the screen?

For exame, the enable vr mide button in the lower right hand corner. I need the buttons and text to appear and stay fixed to the screen when an event is triggered. Similar to how a canvas and button works in unity.

Upvotes: 0

Views: 602

Answers (1)

Thomas Williams
Thomas Williams

Reputation: 862

Parent the buttons to the camera. Then they will stay locked to the camera. Move the buttons using the position component, and they will move in their local coordinate space. Parent/child relationships are created by nesting the entities, like this.

<a-scene>
  <a-box>
    <a-sphere></a-sphere>
    <a-light></a-light>
  </a-box>
</a-scene>

Upvotes: 1

Related Questions