Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
local: { position: { x: 0.5, y, z: 0 } }
}
}
});
y = y + 0.5;
}
// Create a label for the menu title.
MRESDK.Actor.CreateEmpty(this.context, {
actor: {
parentId: menu.id,
name: 'label',
text: {
contents: ''.padStart(8, ' ') + "Wear a Hat",
height: 0.8,
anchor: MRESDK.TextAnchorLocation.MiddleCenter,
color: MRESDK.Color3.Yellow()
},
transform: {
local: { position: { x: 0.5, y: y + 0.25, z: 0 } }
}
}
});
}
}
});
// Set a click handler on the button.
button.value.setBehavior(MRESDK.ButtonBehavior)
.onClick('released', user => this.wearHat(hatId, user.id));
// Create a label for the menu entry.
MRESDK.Actor.CreateEmpty(this.context, {
actor: {
parentId: menu.id,
name: 'label',
text: {
contents: HatDatabase[hatId].displayName,
height: 0.5,
anchor: MRESDK.TextAnchorLocation.MiddleLeft
},
transform: {
local: { position: { x: 0.5, y, z: 0 } }
}
}
});
y = y + 0.5;
}
// Create a label for the menu title.
MRESDK.Actor.CreateEmpty(this.context, {
actor: {
parentId: menu.id,
name: 'label',
text: {
contents: ''.padStart(8, ' ') + "Wear a Hat",
geometry: { shape: 'auto' }
}
}
});
const label = MRE.Actor.Create(this.context, {
actor: {
parentId: this.exclusiveUserToggle.id,
transform: {
local: {
position: { x: 0.3 }
}
},
text: {
contents: this.exclusiveUser ? `Exclusive to:\n${this.exclusiveUser.name}` : "Inclusive",
height: 0.2,
anchor: MRE.TextAnchorLocation.MiddleLeft
}
}
});
this.exclusiveUserLabel = label.text;
this.exclusiveUserToggle.setBehavior(MRE.ButtonBehavior)
.onButton('released', user => this.toggleExclusiveUser(user));
const floor = MRE.Actor.Create(this.context, {
actor: {
name: 'floor',
appearance: {
meshId: this.assets.createBoxMesh('floor', 2, 0.1, 2.1 ).id,
materialId: this.backgroundMaterial.id
},
transform: {
collider: { geometry: { shape: 'auto' } }
}
});
this.playPauseText = MRE.Actor.Create(this.context, {
actor: {
parentId: this.playPauseButton.id,
transform: {
local: {
position: { z: -0.1 }
}
},
text: {
contents: "Start",
height: 0.15,
anchor: MRE.TextAnchorLocation.MiddleCenter,
justify: MRE.TextJustify.Center,
color: NeutralColor
}
}
});
this.playPauseButton.setBehavior(MRE.ButtonBehavior)
.onButton("released", user => {
if (this.activeTest === null) {
this.runTest(user);
} else {
this.stopTest().catch(() => { });
}
});
const menuButton = MRE.Actor.Create(this.context, {
}
});
const backLabel = MRE.Actor.Create(this.context, {
actor: {
name: 'BackLabel',
parentId: backButton.id,
transform: {
local: {
position: { x: buttonWidth * 1.2, z: 0.05 }
},
},
text: {
contents: "Back",
height: 0.2,
anchor: MRE.TextAnchorLocation.MiddleLeft
}
}
});
backButton.setBehavior(MRE.ButtonBehavior)
.onButton('released', () => {
this.back();
this.show();
});
this.otherActors = [backButton, backLabel];
}
colliderType: 'sphere',
actor: {
name: `${bodyName}-body`,
parentId: obliquity1.value.id,
transform: {
scale: scaleValue
}
}
});
label.value.enableText({
contents: bodyName,
height: 0.5,
pixelsPerLine: 50,
color: MRESDK.Color3.Yellow(),
anchor: MRESDK.TextAnchorLocation.TopCenter,
justify: MRESDK.TextJustify.Center,
});
setTimeout(() => {
label.value.text.color = MRESDK.Color3.White();
}, 5000);
this.celestialBodies[bodyName] = {
inclination: inclination.value,
position: position.value,
obliquity0: obliquity0.value,
obliquity1: obliquity1.value,
model: model.value
} as CelestialBody;
this.createAnimations(bodyName);
actor: {
name: `${bodyName}-body`,
parentId: obliquity1.value.id,
transform: {
local: { scale: scaleValue }
}
}
});
label.value.enableText({
contents: bodyName,
height: 0.5,
pixelsPerLine: 50,
color: MRESDK.Color3.Yellow(),
anchor: MRESDK.TextAnchorLocation.TopCenter,
justify: MRESDK.TextJustify.Center,
});
setTimeout(() => {
label.value.text.color = MRESDK.Color3.White();
}, 5000);
this.celestialBodies[bodyName] = {
inclination: inclination.value,
position: position.value,
obliquity0: obliquity0.value,
obliquity1: obliquity1.value,
model: model.value
} as CelestialBody;
this.createAnimations(bodyName);