This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| // Every great app starts with a great name (keep it short so that it can fit in the tablet button) | |
| var APP_NAME = "GEMSTONE"; | |
| // Get a reference to the tablet | |
| var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); | |
| // "Install" your cool new app to the tablet | |
| // The following lines create a button on the tablet's menu screen | |
| var button = tablet.addButton({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| // Every great app starts with a great name (keep it short so that it can fit in the tablet button) | |
| var APP_NAME = "GEMSTONE"; | |
| // Link to your app's HTML file | |
| var APP_URL = "https://hifi-content.s3.amazonaws.com/faye/gemstoneMagicMaker/gemstoneMagicMaker.html"; | |
| // Get a reference to the tablet | |
| var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); | |
| // "Install" your cool new app to the tablet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <body> | |
| <div class="top-bar"> | |
| <h4>Gemstone Magic Maker</h4> | |
| </div> | |
| <div class="content"> | |
| <p>Pick a gemstone from our curated collection:<p> | |
| <p><input type="button" class="gemstone-button white" value="Emerald"></p> | |
| <p><input type="button" class="gemstone-button red" value="Ruby"></p> | |
| <p><input type="button" class="gemstone-button blue" value="Sapphire"></p> | |
| <p><input type="button" class="gemstone-button white" value="Quartz"></p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Helper function that gives us a position right in front of the user | |
| function getPositionToCreateEntity() { | |
| var direction = Quat.getFront(MyAvatar.orientation); | |
| var distance = 0.3; | |
| var position = Vec3.sum(MyAvatar.position, Vec3.multiply(direction, distance)); | |
| position.y += 0.5; | |
| return position; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Handle the events we're recieving from the web UI | |
| function onWebEventReceived(event) { | |
| print("gemstoneApp.js received a web event:" + event); | |
| // Converts the event to a JavasScript Object | |
| if (typeof event === "string") { | |
| event = JSON.parse(event); | |
| } | |
| if (event.type === "click") { |