src/core/UIManager.js
/**
	* Creates the UI-elements for the FPS view.
	*
	* @return {UIManager} A reference to this UI manager.
	*/
Creates the UI-elements for the FPS view.
@return {UIManager} A reference to this UI manager.
Creates the UI - elements for the FPS view . @return { UIManager } A reference to this UI manager .
_buildFPSInterface() {
		const crosshairsTexture = this.world.assetManager.textures.get( 'crosshairs' );
		const crosshairsMaterial = new SpriteMaterial( { map: crosshairsTexture, opacity: CONFIG.UI.CROSSHAIRS.OPACITY } );
		const crosshairs = new Sprite( crosshairsMaterial );
		crosshairs.matrixAutoUpdate = false;
		crosshairs.visible = false;
		crosshairs.position.set( 0, 0, 1 );
		crosshairs.scale.set( CONFIG.UI.CROSSHAIRS.SCALE, CONFIG.UI.CROSSHAIRS.SCALE, 1 );
		crosshairs.updateMatrix();
		this.scene.add( crosshairs );
		this.sprites.crosshairs = crosshairs;
		const frontIndicatorTexture = this.world.assetManager.textures.get( 'damageIndicatorFront' );
		const frontIndicatorMaterial = new SpriteMaterial( { map: frontIndicatorTexture, opacity: CONFIG.UI.DAMAGE_INDICATOR.OPACITY } );
		const frontIndicator = new Sprite( frontIndicatorMaterial );
		frontIndicator.matrixAutoUpdate = false;
		frontIndicator.visible = false;
		frontIndicator.position.set( 0, 0, 1 );
		frontIndicator.scale.set( CONFIG.UI.DAMAGE_INDICATOR.SCALE, CONFIG.UI.DAMAGE_INDICATOR.SCALE, 1 );
		frontIndicator.updateMatrix();
		this.scene.add( frontIndicator );
		this.sprites.frontIndicator = frontIndicator;
		const rigthIndicatorTexture = this.world.assetManager.textures.get( 'damageIndicatorRight' );
		const rightIndicatorMaterial = new SpriteMaterial( { map: rigthIndicatorTexture, opacity: CONFIG.UI.DAMAGE_INDICATOR.OPACITY } );
		const rightIndicator = new Sprite( rightIndicatorMaterial );
		rightIndicator.matrixAutoUpdate = false;
		rightIndicator.visible = false;
		rightIndicator.position.set( 0, 0, 1 );
		rightIndicator.scale.set( CONFIG.UI.DAMAGE_INDICATOR.SCALE, CONFIG.UI.DAMAGE_INDICATOR.SCALE, 1 );
		rightIndicator.updateMatrix();
		this.scene.add( rightIndicator );
		this.sprites.rightIndicator = rightIndicator;
		const leftIndicatorTexture = this.world.assetManager.textures.get( 'damageIndicatorLeft' );
		const leftIndicatorMaterial = new SpriteMaterial( { map: leftIndicatorTexture, opacity: CONFIG.UI.DAMAGE_INDICATOR.OPACITY } );
		const leftIndicator = new Sprite( leftIndicatorMaterial );
		leftIndicator.matrixAutoUpdate = false;
		leftIndicator.visible = false;
		leftIndicator.position.set( 0, 0, 1 );
		leftIndicator.scale.set( CONFIG.UI.DAMAGE_INDICATOR.SCALE, CONFIG.UI.DAMAGE_INDICATOR.SCALE, 1 );
		leftIndicator.updateMatrix();
		this.scene.add( leftIndicator );
		this.sprites.leftIndicator = leftIndicator;
		const backIndicatorTexture = this.world.assetManager.textures.get( 'damageIndicatorBack' );
		const backIndicatorMaterial = new SpriteMaterial( { map: backIndicatorTexture, opacity: CONFIG.UI.DAMAGE_INDICATOR.OPACITY } );
		const backIndicator = new Sprite( backIndicatorMaterial );
		backIndicator.matrixAutoUpdate = false;
		backIndicator.visible = false;
		backIndicator.position.set( 0, 0, 1 );
		backIndicator.scale.set( CONFIG.UI.DAMAGE_INDICATOR.SCALE, CONFIG.UI.DAMAGE_INDICATOR.SCALE, 1 );
		backIndicator.updateMatrix();
		this.scene.add( backIndicator );
		this.sprites.backIndicator = backIndicator;
		return this;
	}
_buildFPSInterface ( ) { const crosshairsTexture = this . world . assetManager . textures . get ( 'crosshairs' ) ; const crosshairsMaterial = new SpriteMaterial ( { map : crosshairsTexture , opacity : CONFIG . UI . CROSSHAIRS . OPACITY } ) ; const crosshairs = new Sprite ( crosshairsMaterial ) ; crosshairs . matrixAutoUpdate = false ; crosshairs . visible = false ; crosshairs . position . set ( 0 , 0 , 1 ) ; crosshairs . scale . set ( CONFIG . UI . CROSSHAIRS . SCALE , CONFIG . UI . CROSSHAIRS . SCALE , 1 ) ; crosshairs . updateMatrix ( ) ; this . scene . add ( crosshairs ) ; this . sprites . crosshairs = crosshairs ; const frontIndicatorTexture = this . world . assetManager . textures . get ( 'damageIndicatorFront' ) ; const frontIndicatorMaterial = new SpriteMaterial ( { map : frontIndicatorTexture , opacity : CONFIG . UI . DAMAGE_INDICATOR . OPACITY } ) ; const frontIndicator = new Sprite ( frontIndicatorMaterial ) ; frontIndicator . matrixAutoUpdate = false ; frontIndicator . visible = false ; frontIndicator . position . set ( 0 , 0 , 1 ) ; frontIndicator . scale . set ( CONFIG . UI . DAMAGE_INDICATOR . SCALE , CONFIG . UI . DAMAGE_INDICATOR . SCALE , 1 ) ; frontIndicator . updateMatrix ( ) ; this . scene . add ( frontIndicator ) ; this . sprites . frontIndicator = frontIndicator ; const rigthIndicatorTexture = this . world . assetManager . textures . get ( 'damageIndicatorRight' ) ; const rightIndicatorMaterial = new SpriteMaterial ( { map : rigthIndicatorTexture , opacity : CONFIG . UI . DAMAGE_INDICATOR . OPACITY } ) ; const rightIndicator = new Sprite ( rightIndicatorMaterial ) ; rightIndicator . matrixAutoUpdate = false ; rightIndicator . visible = false ; rightIndicator . position . set ( 0 , 0 , 1 ) ; rightIndicator . scale . set ( CONFIG . UI . DAMAGE_INDICATOR . SCALE , CONFIG . UI . DAMAGE_INDICATOR . SCALE , 1 ) ; rightIndicator . updateMatrix ( ) ; this . scene . add ( rightIndicator ) ; this . sprites . rightIndicator = rightIndicator ; const leftIndicatorTexture = this . world . assetManager . textures . get ( 'damageIndicatorLeft' ) ; const leftIndicatorMaterial = new SpriteMaterial ( { map : leftIndicatorTexture , opacity : CONFIG . UI . DAMAGE_INDICATOR . OPACITY } ) ; const leftIndicator = new Sprite ( leftIndicatorMaterial ) ; leftIndicator . matrixAutoUpdate = false ; leftIndicator . visible = false ; leftIndicator . position . set ( 0 , 0 , 1 ) ; leftIndicator . scale . set ( CONFIG . UI . DAMAGE_INDICATOR . SCALE , CONFIG . UI . DAMAGE_INDICATOR . SCALE , 1 ) ; leftIndicator . updateMatrix ( ) ; this . scene . add ( leftIndicator ) ; this . sprites . leftIndicator = leftIndicator ; const backIndicatorTexture = this . world . assetManager . textures . get ( 'damageIndicatorBack' ) ; const backIndicatorMaterial = new SpriteMaterial ( { map : backIndicatorTexture , opacity : CONFIG . UI . DAMAGE_INDICATOR . OPACITY } ) ; const backIndicator = new Sprite ( backIndicatorMaterial ) ; backIndicator . matrixAutoUpdate = false ; backIndicator . visible = false ; backIndicator . position . set ( 0 , 0 , 1 ) ; backIndicator . scale . set ( CONFIG . UI . DAMAGE_INDICATOR . SCALE , CONFIG . UI . DAMAGE_INDICATOR . SCALE , 1 ) ; backIndicator . updateMatrix ( ) ; this . scene . add ( backIndicator ) ; this . sprites . backIndicator = backIndicator ; return this ; }
Creates the UI-elements for the FPS view.
Creates the UI - elements for the FPS view .
// crosshairs // damage indication // front // right // left // right