Width of the console in pixels. Use resize to change it.
Height of the console in pixels. Use resize to change it.
Retained entries, oldest first, including those hidden by the filter. A live view: it
changes as entries are added, collapsed into or dropped. Copy it ([...devConsole.entries]) to
keep a snapshot.
Calls per level that the retained entries stand for, collapsed repeats included. Entries
dropped by maxEntries are subtracted, and entries with a kind (command-line input and
results) are not counted.
Levels that are currently displayed.
Maximum number of entries kept, see PixiConsoleOptions.maxEntries. Lowering it drops the oldest entries right away.
Whether consecutive identical messages are merged, see PixiConsoleOptions.collapseRepeats.
Whether entries are prefixed with their time, see PixiConsoleOptions.timestamps.
console levels currently captured. Assign true, false or a list of levels to change it.
Whether uncaught errors and unhandled promise rejections are captured.
Show the console automatically when an error is logged or thrown.
Whether the toolbar is shown, see PixiConsoleOptions.toolbar.
Keyboard key (KeyboardEvent.code or .key) toggling the console, or null.
Keeps the console sized to a renderer, see PixiConsoleOptions.autoResize.
Whether the command line is shown, see PixiConsoleOptions.prompt.
Runs lines that are not commands, see PixiConsoleOptions.evaluator.
Registered commands by lower-case name, built-ins included. A snapshot: change it with addCommand / removeCommand.
What the last line produced: every evaluator result, and command results other than undefined.
Lines entered at the prompt, oldest first, at most 100. Assign it to restore a saved history, e.g. from localStorage.
Scroll offset in pixels from the top of the history.
Whether the view sticks to the newest entry.
Adds a log entry without writing to the browser console. Accepts the same arguments as console.log.
Adds an info entry without writing to the browser console.
Adds a debug entry without writing to the browser console.
Adds a warn entry without writing to the browser console.
Adds an error entry without writing to the browser console.
Prints a message as-is, optionally in a custom colour.
Optionalcolor: ColorSourceRemoves every entry.
Registers or replaces a command. Names are case-insensitive.
Unregisters a command, built-ins included. Unknown names are ignored.
Runs a line as if it was entered at the prompt: echoes it as > line, runs the matching command
or the evaluator, and prints the result. Works whether or not prompt is on.
Synchronous results are printed before this returns. Not added to history.
The result, awaited when it is a promise; undefined when the line was blank or failed.
Failures are printed, never thrown or rejected.
Shows the console and focuses the command line. Does nothing when prompt is off. If the input can't be placed yet (renderer not known), it is focused after the next render. On touch devices the on-screen keyboard only opens when this runs inside a user gesture.
Removes focus from the command line, closing the on-screen keyboard and returning keys to the page.
Scrolls up by a number of lines.
Scrolls down by a number of lines.
Scrolls to the newest entry and keeps following new ones.
Changes the console size. Text is re-wrapped to the new width.
Applies pending changes immediately. This happens automatically every frame the console is rendered, call it only when you need up-to-date layout without rendering (e.g. in tests).
Destroys the console, restores console and removes every listener it installed.
Optionaloptions: DestroyOptions
An in-canvas developer console for PixiJS v8.
Captures
console.*calls and uncaught errors and renders them on top of your scene, which is invaluable on devices without devtools. Rendering is virtualized: only the visible lines exist as display objects, so tens of thousands of logs cost the same to draw as a screenful.The console is a render group of its own, so its text changing with every log doesn't make pixi rebuild the rest of the stage. Don't cache it, or an ancestor, with
cacheAsTexture: it would stop updating.Example