aframe-ui-components
UI components for A-Frame.
Components
Demo
gmarty.github.io/aframe-ui-components
cursor-feedback
Add visual feedback to a cursor when hovering a clickable object.
API
Property | Description | Default Value |
---|---|---|
property | The property of the cursor to animate. | scale |
dur | The duration of the animation in ms. | 300 |
to | Ending value of the property. | 2 2 2 |
Browser Installation
This component requires aframe-animation-component
.
Install and use by directly including the browser files.
Create a cursor with a cursor-feedback
attribute and tag all your interactive
entities with data-interactive="true"
:
My A-Frame Scene
It's recommended to deactivate fuse mode when using this component.
If all your interactive objects have a data-interactive
attribute, you can
optimise the cursor raycasting this way:
target-indicator
Displays an arrow pointing at an object when it is out of sight.
API
Property | Description | Default Value |
---|---|---|
target | A reference to the entity to target. |
Browser Installation
Install and use by directly including the browser files.
My A-Frame Scene
Volumetric Light
Material for spotlight, ideal to attract the user attention to an object.
API
Property | Description | Default Value |
---|---|---|
attenuation | The property of the cursor to animate. | 5 |
anglePower | The duration of the animation in ms. | 1.2 |
spotPosition | Ending value of the property. | 0 0 0 |
lightColor | Ending value of the property. | 1 1 1 |
Browser Installation
Install and use by directly including the browser files.
Create an <a-cone>
with a material="shader: volumetric-light;
attribute:
My A-Frame Scene
Ideally set the spotPosition
to the position of the entity.
The lightColor
attribute requires a Vector3 notation. For example white is
'1 1 1'.
You'll also probably want to use a <a-light type="spot"/>
for an improved
effect.
The original code for this shader can be found at github.com/jeromeetienne/threex.volumetricspotlight.
npm Installation
Install via npm:
npm install aframe-ui-components
Then register and use.
;;