1.1.3 • Published 5 years ago

aframe-toggle-controls-component v1.1.3

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

aframe-toggle-controls-component

Version License

A Toggle Controls component for A-Frame. Toggle is touch and mouse click or by any other event, like from the input mapping or keydown events.

For A-Frame.

API

Multiple components may be set on the scene entity.

PropertyDescriptionDefault Value
enabledListen for eventsfalse
toggledInitial toggled statefalse
eventsList of events that are used for toggling[]
typeType of the toggle. Either single or doublesingle
toggleTimeoutThe time in milliseconds between to toggleEvents if the toggleType is double400
onEventsEvents to be fired when the toggle state is toggled[]
offEventsEvents to be fired when the toggle state is not toggled[]
eventCondCheck the specific event if the key meets the value. Format key=value, like keyCode=Space

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.9.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-toggle-controls-component/dist/aframe-toggle-controls-component.min.js"></script>
</head>

<body>
  <a-scene toggle-controls="onEvents: toggleOn: offEvents: toggleOff;">
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-toggle-controls-component

Then require and use.

require('aframe');
require('aframe-toggle-controls-component');
1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago