回答編集履歴

1

ソースコードを更に簡略化

2021/11/11 13:50

投稿

cx20
cx20

スコア4633

test CHANGED
@@ -40,7 +40,7 @@
40
40
 
41
41
  ```javascript
42
42
 
43
- const text = new Blotter.Text("こんにちは", {
43
+ var text = new Blotter.Text("こんにちは", {
44
44
 
45
45
  family : "serif",
46
46
 
@@ -52,17 +52,9 @@
52
52
 
53
53
 
54
54
 
55
- const mainImageSource = [
55
+ var mainImageSource = document.getElementById("fs").textContent;
56
56
 
57
- Blotter.Assets.Shaders.Noise3D,
58
-
59
- document.getElementById("fs").textContent
60
-
61
- ].join("\n");
62
-
63
-
64
-
65
- const material = new Blotter.ShaderMaterial(mainImageSource, {
57
+ var material = new Blotter.ShaderMaterial(mainImageSource, {
66
58
 
67
59
  uniforms : {
68
60
 
@@ -76,9 +68,9 @@
76
68
 
77
69
 
78
70
 
79
- const blotter = new Blotter(material, { texts : text });
71
+ var blotter = new Blotter(material, { texts : text });
80
72
 
81
- const scope = blotter.forText(text);
73
+ var scope = blotter.forText(text);
82
74
 
83
75
  scope.appendTo(document.body);
84
76
 
@@ -92,8 +84,6 @@
92
84
 
93
85
  });
94
86
 
95
-
96
-
97
87
  ```
98
88
 
99
89