Learn to use HoloPlayCore.JS by Looking Glass!

Step 0. Install the HoloPlay Service

You can download it here!

Step 1. Select an example quilt...

... or upload your own quilt!

Step 2. Send to Looking Glass

Step 3. Learn how to use HoloPlayCore JS!

There are 3 ways to use HoloPlayCore.js. You can either import it via script tag, like so:


<script src="holoplaycore.js"></script>
Or import it using ES6 module syntax:

import * as HoloPlayCore from 'https://unpkg.com/holoplay-core@0.0.8/dist/holoplaycore.module.js';
Or even use it in node.js.

const HoloPlayCore = require('holoplaycore.js');

Instantiate a HoloPlay client.


let client = new HoloPlayCore.Client(onopen, onerror, onclose);

By sending a show command with attached binaries of the loaded file, you can show stuff in the Looking Glass!


let showCmd = new HoloPlayCore.ShowMessage({vx :5, vy :9, vtotal: 45}, rawData);
  client
    .sendMessage(showCmd)
    .then(function() { 
      document.getElementById("info").innerHTML = "Quilt displayed.";
    })
    .catch(function(err) {
      console.log(err);
    });