content/hifi-content/wadewatts/Animation Apps/front flip in place/animation app button front flip 2.js
2022-02-14 02:04:11 +01:00

28 lines
987 B
JavaScript

//WW
var URL = 'https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/front%20flip%20in%20place/front_flip_animation.fbx';
var CONFIG = {
text: 'F Flip',
icon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/front%20flip%20in%20place/front-flip-off.svg",
activeIcon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/front%20flip%20in%20place/front-flip-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, 41);
else
MyAvatar.restoreAnimation();
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });