This commit is contained in:
2025-10-29 18:01:43 +02:00
parent 127f71f345
commit 40fe3b998c
2 changed files with 16 additions and 10 deletions
+7 -9
View File
@@ -1,5 +1,4 @@
import { MeshBasicMaterial, TextureLoader, LinearFilter,
sRGBEncoding,
Mesh,
OrthographicCamera,
PlaneGeometry,
@@ -11,24 +10,23 @@ import { Text } from 'troika-three-text';
class DashBoard {
constructor(renderer, width, height) {
var _camera = new OrthographicCamera(width / -2, width / 2, height / 2, height / -2, 0, 1);
let _camera = new OrthographicCamera(width / -2, width / 2, height / 2, height / -2, 0, 1);
var _scene = new Scene();
let _scene = new Scene();
var _params = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat, stencilBuffer: true };
//let _params = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat, stencilBuffer: true };
this.points = 0;
var _texture = new TextureLoader().load('./assets/maze/x.png');
_texture.encoding = sRGBEncoding;
let _texture = new TextureLoader().load('./assets/maze/x.png');
var _material = new MeshBasicMaterial({
let _material = new MeshBasicMaterial({
map: _texture,
alphaTest: .5
});
// _mesh = new Mesh( new PlaneGeometry( width * 0.015, width * 0.015 ), _material );
var _text = new Text();
_text.font = './assets/fonts/MonomakhUnicode.otf';
let _text = new Text();
_text.font = '/static/fonts/Montserrat-Regular.ttf';
_text.text = 'Точки: 0';
_text.anchorX = 'right';
_text.anchorY = 'top';