Allows for rendering of font-awesome icons in a scene.
- Add Font Awesome to your page
- Add
dist/aframe-font-awesome.min.js
The font-awesome
component will generate an image containing a single font-awesome icon.
Property | Description | Default value |
---|---|---|
charcode | The charcode of the icon to render. Can be found on the icon page on fontawesome.io. | |
color | Color of the icon | #000 |
size | The size of the texture being drawn. Make sure that the number is equal to the power of two. | 1024 |
visibleWhenDrawn | If set to true, it will hide the element on init, and show the element when the icon is drawn | true |
Event | Description |
---|---|
font-awesome.drawn | Fired when the icon is finished rendering |
<a-plane font-awesome="charcode: f06e; color: red;" position="0 -.375 -1"></a-plane>
The a-font-awesome
primitive is available for an easier way to create a font-awesome entity. It will draw the icon on top of a plane primitive with the material's side set to double and transparency set to true.
<a-font-awesome charcode="f06e" color="blue" size="512"></a-font-awesome>
The font-awesome
system keeps track for when the FontAwesome
font-family is available, so that the components known when they can start drawing.
It also contains the functionality to draw the icon on a canvas and returns it to the component. The results are stored in a cache to avoid icons being redrawn twice.
Event | Description |
---|---|
font-awesome.loaded | Fired when font-awesome has been loaded |