3.0.2 • Published 5 years ago

aframe-entity-generator-component v3.0.2

Weekly downloads
80
License
MIT
Repository
github
Last release
5 years ago

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

PropertyDescriptionDefault Value
mixinMixin ID that will be applied to generated entities.''
numNumber 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');