|
@@ -1,14 +1,15 @@
|
|
import * as THREE from "three";
|
|
import * as THREE from "three";
|
|
import TextLabel from "./object/TextLabel";
|
|
import TextLabel from "./object/TextLabel";
|
|
|
|
+import SimpleLabel from "./object/SimpleLabel";
|
|
import ImgLabel from "./object/ImgLabel";
|
|
import ImgLabel from "./object/ImgLabel";
|
|
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
|
|
|
|
export default class HorizontalBox extends THREE.Group {
|
|
export default class HorizontalBox extends THREE.Group {
|
|
- constructor(manager, data, index) {
|
|
|
|
|
|
+ constructor(manager, data, index, total) {
|
|
super();
|
|
super();
|
|
this.manager = manager;
|
|
this.manager = manager;
|
|
this.name = "horizontal_box";
|
|
this.name = "horizontal_box";
|
|
-
|
|
|
|
|
|
+ this.total = total;
|
|
this.getStyle();
|
|
this.getStyle();
|
|
this.load(data, index);
|
|
this.load(data, index);
|
|
}
|
|
}
|
|
@@ -48,7 +49,6 @@ export default class HorizontalBox extends THREE.Group {
|
|
data.forEach((i, j) => {
|
|
data.forEach((i, j) => {
|
|
//img
|
|
//img
|
|
let img;
|
|
let img;
|
|
-
|
|
|
|
this.manager.loader.load(i.imgUrl, (texture) => {
|
|
this.manager.loader.load(i.imgUrl, (texture) => {
|
|
texture.colorSpace = THREE.SRGBColorSpace;
|
|
texture.colorSpace = THREE.SRGBColorSpace;
|
|
img = new ImgLabel(texture, matLine);
|
|
img = new ImgLabel(texture, matLine);
|
|
@@ -57,7 +57,7 @@ export default class HorizontalBox extends THREE.Group {
|
|
if (j === 0) {
|
|
if (j === 0) {
|
|
img.position.z -= 0.8;
|
|
img.position.z -= 0.8;
|
|
} else {
|
|
} else {
|
|
- img.position.z += 0.5;
|
|
|
|
|
|
+ img.position.z += 0.43;
|
|
}
|
|
}
|
|
this.add(img);
|
|
this.add(img);
|
|
this.manager.imgList.push(img);
|
|
this.manager.imgList.push(img);
|
|
@@ -67,5 +67,12 @@ export default class HorizontalBox extends THREE.Group {
|
|
textlabel.position.z += textlabel.scale.z * 0.5 + 0.1;
|
|
textlabel.position.z += textlabel.scale.z * 0.5 + 0.1;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ //页脚
|
|
|
|
+ const f_txt_label = ` 第 ${index + 1} 页 共 ${this.total} 页`;
|
|
|
|
+ const footlabel = new SimpleLabel(f_txt_label, true);
|
|
|
|
+ footlabel.renderOrder = 100;
|
|
|
|
+ footlabel.position.z += 1.26;
|
|
|
|
+
|
|
|
|
+ this.add(footlabel);
|
|
}
|
|
}
|
|
}
|
|
}
|