mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00

* When launching the Debugger to inspect a game, open the Console to see internal messages sent by the game, JavaScript code or the game engine. * This is an advanced feature that is useful to find issues in your game or to see if your game is displaying any internal error.
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
namespace gdjs {
|
|
export namespace evtTools {
|
|
/**
|
|
* The namespace containing tools to interact with the debugger.
|
|
* @namespace
|
|
*/
|
|
export namespace debuggerTools {
|
|
/**
|
|
* Stop the game execution.
|
|
* @param runtimeScene - The current scene.
|
|
*/
|
|
export const pause = function (runtimeScene: gdjs.RuntimeScene) {
|
|
runtimeScene.getGame().pause(true);
|
|
};
|
|
|
|
/**
|
|
* Logs a message to the console.
|
|
* @param message - The message to log.
|
|
* @param type - The type of log (info, warning or error).
|
|
* @param group - The group of messages it belongs to.
|
|
*/
|
|
export const log = function (
|
|
message: string,
|
|
type: 'info' | 'warning' | 'error',
|
|
group: string
|
|
) {
|
|
gdjs.log(group, message, type, false);
|
|
};
|
|
|
|
/**
|
|
* Enable or disable the debug draw.
|
|
* @param runtimeScene - The current scene.
|
|
* @param enableDebugDraw - true to enable the debug draw, false to disable it.
|
|
* @param showHiddenInstances - true to apply the debug draw to hidden objects.
|
|
* @param showPointsNames - true to show point names.
|
|
* @param showCustomPoints - true to show custom points of Sprite objects.
|
|
*/
|
|
export const enableDebugDraw = function (
|
|
runtimeScene: gdjs.RuntimeScene,
|
|
enableDebugDraw: boolean,
|
|
showHiddenInstances: boolean,
|
|
showPointsNames: boolean,
|
|
showCustomPoints: boolean
|
|
) {
|
|
runtimeScene.enableDebugDraw(
|
|
enableDebugDraw,
|
|
showHiddenInstances,
|
|
showPointsNames,
|
|
showCustomPoints
|
|
);
|
|
};
|
|
}
|
|
}
|
|
}
|