Skip to content

Latest commit

 

History

History

hud

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

HUD component

npm version npm version github twitter mastodon ko-fi

This component allows hud elements to be rendered. The elements render in both desktop and VR mode. On desktop the elements appear on the screen (flat), whereas in VR they are projected on a sphere around the user's head.

The intended usage is mostly for debugging, but can be used for simple overlays as well.

Checkout the example: Online Demo | Source

Usage

Load the script from npm or add the following script tag:

<script src="https://cdn.jsdelivr.net/npm/@fern-solutions/aframe-hud/dist/hud.umd.min.js"></script>

The a-hud and a-hud-element primitives can be used as children of <a-camera> as follows:

<a-camera>
    <a-hud>
        <a-hud-element align="center" content-size="1 1" hud-size="0.5" anchor="center"><a-plane></a-plane></a-hud-element>
    </a-hud>
</a-camera>