Repository navigation
Expand file tree
/
Copy pathxr.js
More file actions
62 lines (57 loc) · 1.4 KB
/
Copy pathxr.js
File metadata and controls
62 lines (57 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import * as Blockly from "blockly";
import { categoryColours } from "../toolbox.js";
import {
getHelpUrlFor,
} from "../blocks.js";
import { translate, getTooltip, getDropdownOption } from "../main/translation.js";
export function defineXRBlocks() {
Blockly.Blocks["device_camera_background"] = {
init: function () {
this.jsonInit({
type: "device_camera_background",
message0: translate("device_camera_background"),
args0: [
{
type: "field_dropdown",
name: "CAMERA",
options: [
getDropdownOption("user"),
getDropdownOption("environment"),
],
},
],
previousStatement: null,
nextStatement: null,
colour: categoryColours["Scene"],
tooltip: getTooltip("device_camera_background"),
});
this.setHelpUrl(getHelpUrlFor(this.type));
this.setStyle('scene_blocks');
},
};
Blockly.Blocks["set_xr_mode"] = {
init: function () {
this.jsonInit({
type: "set_xr_mode",
message0: translate("set_xr_mode"),
args0: [
{
type: "field_dropdown",
name: "MODE",
options: [
getDropdownOption("VR"),
getDropdownOption("AR"),
getDropdownOption("MAGIC_WINDOW"),
],
},
],
previousStatement: null,
nextStatement: null,
colour: categoryColours["Scene"],
tooltip: getTooltip("set_xr_mode"),
});
this.setHelpUrl(getHelpUrlFor(this.type));
this.setStyle('scene_blocks');
},
};
}