aframe-entity-generator-component

3.0.2 • Public • Published

aframe-entity-generator-component

An entity generator component for A-Frame. Given a mixin, generates a number of entities as children. Pairs well with Randomizer Components for a large number of entities with random elements.

Properties

Property Description Default Value
mixin Mixin ID that will be applied to generated entities. ''
num Number of entities to generate. 10

Usage

Browser Installation

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script> 
  <script src="https://unpkg.com/aframe-entity-generator-component@^3.0.0/dist/aframe-entity-generator-component.min.js"></script> 
</head>
 
<body>
  <a-scene>
    <a-assets>
      <a-mixin id="red" material="color: red"></a-mixin>
      <a-mixin id="candle" geometry="primitive: sphere" light></a-mixin>
    </a-assets>
 
    <a-entity entity-generator="mixin: red candle"></a-entity>
  </a-scene>
</body>

NPM Installation

Install via NPM:

npm install aframe-entity-generator-component

Then register and use.

require('aframe');
require('aframe-entity-generator-component');

Package Sidebar

Install

npm i aframe-entity-generator-component

Weekly Downloads

129

Version

3.0.2

License

MIT

Unpacked Size

1.45 MB

Total Files

10

Last publish

Collaborators

  • dmarcos
  • ngokevin