2.1.0 • Published 6 years ago

aframe-proxy-event-component v2.1.0

Weekly downloads
194
License
MIT
Repository
github
Last release
6 years ago

aframe-proxy-event-component

Version License

A component to declaratively proxy events for A-Frame.

For A-Frame.

API

PropertyDescriptionDefault Value
captureBubblesWhether to capture children's bubble events.false
enabledBoolean used to toggle. If false, event will not be proxied.true
eventEvent name to proxy.''
fromSelector of entities to proxy event from. If set to PARENT, then will listen to parent for event.''
toSelector of entities to proxy event to. If set to CHILDREN, then the event is recursively proxied to all children.''
asOptional. Rename the event as the event is proxied to its target(s).''
bubblesWhether to bubble the proxied event.false

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-proxy-event-component/dist/aframe-proxy-event-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity proxy-event="event: foo; to: a-scene; as: bar"></a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-proxy-event-component

Then require and use.

require('aframe');
require('aframe-proxy-event-component');