content/hifi-content/wadewatts/Animation Apps/ballet/animation app button ballet.js
2022-02-14 02:04:11 +01:00

28 lines
925 B
JavaScript

//WW
var URL = 'https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/ballet/Dancing.fbx';
var CONFIG = {
text: 'Ballet',
icon: "https://hifi-content.s3.amazonaws.com/wadewatts/animations/dying%201/power-button-icon-off.svg",
activeIcon: "https://hifi-content.s3.amazonaws.com/wadewatts/animations/dying%201/power-button-icon-on.svg"
};
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"),
button = tablet.addButton(CONFIG);
button.clicked.connect(function() {
this.a = !this.a;
button.editProperties({ isActive: this.a });
if (this.a)
MyAvatar.overrideAnimation(URL, 30, true, 0,372);
else
MyAvatar.restoreAnimation();
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });