content/hifi-public/scripts/painting/whiteboard/eraseBoardEntityScript.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

45 lines
1.4 KiB
JavaScript

//
// eraseBoardEntityScript.js
// examples/painting/whiteboard
//
// Created by Eric Levin on 9/21/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
/*global print, MyAvatar, Entities, AnimationCache, SoundCache, Scene, Camera, Overlays, Audio, HMD, AvatarList, AvatarManager, Controller, UndoStack, Window, Account, GlobalServices, Script, ScriptDiscoveryService, LODManager, Menu, Vec3, Quat, AudioDevice, Paths, Clipboard, Settings, XMLHttpRequest, randFloat, randInt */
/*global BoardEraser */
(function() {
var _this;
BoardEraser = function() {
_this = this;
};
BoardEraser.prototype = {
startFarTrigger: function() {
this.eraseBoard();
},
clickReleaseOnEntity: function() {
this.eraseBoard();
},
eraseBoard: function() {
Entities.callEntityMethod(this.whiteboard, "eraseBoard");
},
preload: function(entityID) {
this.entityID = entityID;
var props = Entities.getEntityProperties(this.entityID, ["userData"]);
this.whiteboard = JSON.parse(props.userData).whiteboard;
},
};
// entity scripts always need to return a newly constructed object of our type
return new BoardEraser();
});