View source code:


Class (extends TM.IObject)


A class that creates instances print debugging data on the browser.

Constructor Parameters

new TM.DebugManager(debugSetting)
  • customSreenSetting(optional): an object that will be used to create the instance overriding the values of TM.defaultSettings.debug. It does not print debugging data by default, so {devMode:true} should be passed to print them.

Important Properties

  • isActive: It will be set true after calling init function, false after calling inactivate. The Object status(active/inactive) can be checked by this property.

Important Functions

  • init(): activates/initializes the instance. (It executes when the instance created)
  • inactivate(): inactivates the instance. It will not print debugging data anymore.

Functions related to debugging

  • print(name,data): print name(text) and data(object) on the browser.
  • delete(name): delete debugging data of name on the browser.
  • deleteAll(): delete all debugging data on the browser.

Code Example

**View example source code: debug-manager-tutorial.js

First, create an instance of TM.ScreenManager and assign to var TMS(Text Game Maker Screen) and then First, create an instance of TM.DebugManager and assign to var TMD(Text Game Maker Debugging).

var TMS = new TM.ScreenManager(),
    TMD = new TM.DebugManager({devMode:true});

Create an instance of TM.Interval that creates current time and print on the screen with 1000 milliseconds interval. adding TMD.print function to print data.

var myWatch = new TM.Interval(1000,function(){
  var date = new Date();

Run Example


The debugging data is showing right side of Screen.

Type these commands into the browser console on this page to test.

//inactivate TMD 

//re-activate(initialize) TMD


Add Comment

Login with SNS account to write comments. see details