Utilities

Utilities

Helper classes for debugging, sizing, logging, and loading screens.

Debug

Provides a Tweakpane debug UI panel, activated by appending #debug to the URL.

// Accessed via game.debug
const debug = game.debug

if (debug.ui) {
  // Tweakpane Pane is available
  const folder = debug.ui.addFolder({ title: 'My Settings' })
  folder.addBinding(myObject, 'speed', { min: 0, max: 10 })
}

debug.ui is undefined when not in debug mode, so always guard against it.

Sizes

Tracks the window dimensions and pixel ratio, and emits a resize event.

// Accessed via game.sizes
const sizes = game.sizes

console.log(sizes.width, sizes.height, sizes.pixelRatio)

sizes.on('resize', () => {
  // Window was resized
})

Logger

A Winston logger wrapper for structured server-side logging.

import { Logger } from '@mavonengine/core'

Logger.info('Server started')
Logger.warn('High latency detected', { ping: 200 })
Logger.error('Unhandled error', { error })

LoadingScreen

Automatically shown during asset loading and hidden when all assets are ready. It integrates with Resources internally — no manual setup required.

// Accessed via game.loadingScreen
const loadingScreen = game.loadingScreen

SkeletonAxesHelper

Visualizes skeleton joints as axis helpers in the Three.js scene. Useful for debugging animation rigs.

import { SkeletonAxesHelper } from '@mavonengine/core'

Toggle via the debug panel's armature option in the Renderer.

Math & Helpers

The engine exports some math utilities and general helpers used internally:

import { Math, Helpers } from '@mavonengine/core'

Refer to the source for the full list of available functions.