Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aframe-gamepad-controls

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aframe-gamepad-controls

Gamepad controls for A-Frame VR.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by280%
Maintainers
1
Weekly downloads
 
Created
Source

A-Frame gamepad-controls Component

Gamepad controls for A-Frame VR.

Overview

Supports one or more gamepads, attached to an A-Frame scene.

This component uses the HTML5 Gamepad API. The underlying API supports Firefox, Chrome, Edge, and Opera (as of 01/2016). Safari and Internet Explorer do not currently support gamepads.

Usage (script)

<html>
  <head>
    <!-- A-Frame VR Library -->
    <script src="https://aframe.io/releases/latest/aframe.js"></script>

    <!-- Component -->
    <script src="dist/aframe-gamepad-controls.js"></script>
  </head>
  <body>
    <a-scene>
      <!-- ... -->
      <a-entity camera gamepad-controls></a-entity>
    </a-scene>
  </body>
</html>

Usage (NPM)

Install NPM module.

$ npm install aframe-gamepad-controls

Register gamepad-controls component.

var AFRAME = require('aframe-core');
var GamepadControls = require('aframe-gamepad-controls');
AFRAME.registerComponent('gamepad-controls', GamepadControls);

Add markup.

<!-- First-person controls -->
<a-entity camera gamepad-controls></a-entity>

<!-- Third-person controls -->
<a-cube gamepad-controls="lookEnabled: false"></a-cube>

<!-- Two players -->
<a-model src="player1.obj" gamepad-controls="controller: 0; lookEnabled: false"></a-model>
<a-model src="player2.obj" gamepad-controls="controller: 1; lookEnabled: false"></a-model>

Options

PropertyDefaultDescription
controller0Which controller (0..3) the object should be attached to.
enabledtrueEnables/disables all events on this controller.
movementEnabledtrueEnables/disables movement via the left thumbstick.
lookEnabledtrueEnables/disables view rotation via the right thumbstick.
flyEnabledfalseEnables/disables movement off the horizontal plane.
debugfalseEnables/disables debug logging to the console.

Keywords

FAQs

Package last updated on 02 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc