Socket
Socket
Sign inDemoInstall

aframe-cubemenu

Package Overview
Dependencies
154
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aframe-cubemenu

A-Frame component for creating a controller held menu in WebVR


Version published
Maintainers
1
Created

Readme

Source

Credits

Justin Slud created this repository. This component uses many ideas from Paul Armstrong's host-menu cube and Roland DuBois' A-GUI components.

ComponentWhat it isWhere it goes
a-cube-menumenu itselfinside of controller or anywhere
a-sideone side of the cube, manually or automatically generatedinside of a-cube-menu
a-buttonbutton on a sideinside of a-side

a-cube-menu

NameActionDefaultOptions
colorcolor of each side, unless specified in a-side'black'
opacityopacity of each side1
heightheight.1
widthwidth.1
depthdepth.1
showis cube small or full sizetrue
showinwebhow to display menu in webVR'''cube', 'flat'
rotationaxiswhich axis to rotate around'y''x', 'y', 'z'
vrrotateeventevent to trigger rotation in VR'axismove'any from oculus-touch-controls, vive-controls, raycaster, etc
webrotateventevent to trigger rotation in webVR''
toggleeventevent to trigger expand / shrink of cube''

a-side

NameActionDefaultOptions
colorcolor of each side, overrides cube color''
opacityopacity1
facewhich face on the cube'front''front', 'top', 'right', 'bottom', 'back', 'top'
flexdirectionwhich way the buttons should be arranged on the face'column''column', 'row'
marginspacing between buttons 'top right bottom left''0 0 0 0'
distancez-distance of buttons from face.05

a-button

NameActionDefaultOptions
typeKind of button'toggle''toggle', 'radio'
hovercolorcolor of button onhover or raycaster-intersected event''
colorcolor of button when not hovered'black'
onclickfunction to perform on click or triggerdown or ... event''
heightheight of button1
widthwidth of button1

Custom Events

NameAction
switchhandschanges which hand holds the cube and which has the raycaster

No text component. You can add your own to the button as or child.

Sample Usage

<html>
  <head>
    <script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
    <script src="cube"></script>
  </head>
  
  <body>
    <a-scene>
      <a-entity id="right-hand" oculus-touch-controls="hand: right">
        <a-cube-menu height=".2" depth=".5" vrrotatevent="bbuttondown">
          <a-side face="front" color="blue" >
            <a-button width=".2" height=".3"></a-button>
          </a-side>
          <a-side face="back" opacity=".5" ></a-side>
        </a-cube-menu>
      </a-entity>
    </a-scene>
  </body>
</html>  

Download

Keywords

FAQs

Last updated on 05 Aug 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc