#author("2024-06-07T17:40:26+00:00","default:J4Y","J4Y") #author("2024-06-07T17:41:51+00:00","default:J4Y","J4Y") * OnEnter [#xfcc3915] A lifecycle hook that is called after the screen has been pushed in the ''screen manager''.~ Define an async method to load all big resources loading like music, texture, mesh etc... async onEnter() { this.mesh = new Gfx3MeshJSM(); await mesh.loadFromFile('./cube.jsm'); this.mesh.setMaterial(new Gfx3Material({ texture: await gfx3TextureManager.loadTexture('./cube.png') })); } * Update [#xfcc3915] A lifecycle hook that is called every frame.~ Define a method to handle all real-time logic behaviors. update(ts) { this.mesh.update(ts); } * Draw [#xfcc3915] A lifecycle hook that is called every frame.~ Define a method to handle all your draw calls. draw() { this.mesh.draw(); gfx3DebugRenderer.drawGrid(UT.MAT4_ROTATE_X(Math.PI * 0.5), 20, 1); }