mirror of
https://github.com/overte-org/overte.git
synced 2025-07-16 00:56:48 +02:00
Adding erase board feature to whiteboard
This commit is contained in:
parent
2c8b85bb5c
commit
e42bbbc10d
1 changed files with 38 additions and 8 deletions
|
@ -64,7 +64,7 @@ var colorSquareDimensions = {
|
|||
y: .1,
|
||||
z: 0.05
|
||||
};
|
||||
colorBoxPosition.y += whiteboardDimensions.y / 2 + colorSquareDimensions.y/2 - 0.01;
|
||||
colorBoxPosition.y += whiteboardDimensions.y / 2 + colorSquareDimensions.y / 2 - 0.01;
|
||||
var spaceBetweenColorBoxes = Vec3.multiply(direction, colorSquareDimensions.x * 2);
|
||||
var scriptURL = Script.resolvePath("colorSelectorEntityScript.js");
|
||||
for (var i = 0; i < colors.length; i++) {
|
||||
|
@ -81,19 +81,49 @@ for (var i = 0; i < colors.length; i++) {
|
|||
})
|
||||
});
|
||||
colorBoxes.push(colorBox);
|
||||
|
||||
colorBoxPosition = Vec3.sum(colorBoxPosition, spaceBetweenColorBoxes);
|
||||
|
||||
}
|
||||
|
||||
|
||||
var eraseBoxDimensions = {
|
||||
x: 0.5,
|
||||
y: 0.1,
|
||||
z: 0.01
|
||||
};
|
||||
|
||||
|
||||
var eraseBoxPosition = Vec3.sum(center, Vec3.multiply(direction, whiteboardDimensions.x / 2 + eraseBoxDimensions.x/2));
|
||||
eraseBoxPosition.y += 0.3;
|
||||
|
||||
var eraseAllText = Entities.addEntity({
|
||||
type: "Text",
|
||||
position: eraseBoxPosition,
|
||||
rotation: rotation,
|
||||
dimensions: eraseBoxDimensions,
|
||||
backgroundColor: {
|
||||
red: 0,
|
||||
green: 60,
|
||||
blue: 0
|
||||
},
|
||||
textColor: {
|
||||
red: 255,
|
||||
green: 10,
|
||||
blue: 10
|
||||
},
|
||||
text: "ERASE BOARD",
|
||||
lineHeight: 0.07
|
||||
});
|
||||
print(JSON.stringify(Entities.getEntityProperties(eraseAllText)))
|
||||
|
||||
|
||||
|
||||
function cleanup() {
|
||||
Entities.deleteEntity(whiteboard);
|
||||
Entities.deleteEntity(eraseAllText);
|
||||
colorBoxes.forEach(function(colorBox) {
|
||||
Entities.deleteEntity(colorBox);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
Script.scriptEnding.connect(cleanup);
|
Loading…
Reference in a new issue