0.1.0 • Published 8 years ago

aframe-alongpath v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

aframe-alongpath-component

A component for A-Frame that allows entities to follow predefined paths.

Properties

PropertyDescriptionDefault Value
pathOne or more point on the path the entity should follow (Format: "x,y,z x,y,z x,y,z")''
closedWhether or not the path should be closed automaticallyfalse
durDuration in milliseconds for the object to follow the entire path1000
delayNumber of milliseconds to wait for the animation to begin2000
loopWhether or not the animation should loopfalse

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://rawgit.com/protyze/aframe-alongpath-component/master/dist/aframe-alongpath-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-sphere color="red" radius="0.25" position="0 0 0"
              alongpath="path:2,2,-5 -2,1,-2.5 0,1,-1; closed:false; dur:5000; delay:4000">
    </a-sphere>
  </a-scene>
</body>

NPM Installation

Install via NPM:

npm install aframe-alongpath-component

Then register and use.

require('aframe');
require('aframe-alongpath-component');