TM.defaultSettings

View source code: https://github.com/a-mean-blogger/text-game-maker-js/blob/master/src/default-settings/default-settings.js

Type

Object

Purpose

This is an object that has the default setting values. Default values are used If setting properties are not passed when manager instances are created. There are 3 setting objects below.

TM.defaultSettings.screen

Default screen settings. It will be used for creating TM.ScreenManager's instance.

  • canvasId: HTML canvas tag ID that will be used as Screen (default: 'tm-canvas')
  • fontSize: font size on Screen (default: 30)
  • frameSpeed: interval speed(millisecond) that updates Screen, update more often if the number is lower (default: 40)
  • zoom: Screen scale (1 = 100%) (default: 0.5),
  • column: the number of column in a row in Screen (default: 60)
  • row: the number of row in Screen (default: 20)
  • backgroundColor: background color of Screen (default:  '#151617')
  • fontColor: default font color of Screen (default:  '#F5F7FA')
  • webFontJsPath: webFontJS library location for loading external font (default:  'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js')
  • fontFamily: font of Screen (default:  'monospace')
  • fontSource: an exteranl font URL if you use one (default: null)

TM.defaultSettings.charGroups

Settings for specific group of characters like special characters, foreign languages, double spaced characters. It will be used creating for TM.ScreenManager's instance.

New groups can be added to TM.defaultSettings.charGroups, they need properties of below.

  • regex: Regular Expressions to specify characters
  • isFullwidth: if it takes 2 spaces => true, else false
  • sizeAdj: adjusting size (1 = 100%)
  • xAdj: adjusting +-x position (px)
  • yAdj: adjusting +-y position (px)

There is korean group as a default group. the object is below.

korean: {
  regex: '\u3131-\uD79D',
  isFullwidth: true,
  sizeAdj: 1,
  xAdj: 0,
  yAdj: 0, 
}

TM.defaultSettings.debug

debug settings. it will be used for creating TM.DebugManager's instance

  • devMode: if you want to print debugging data => true,  else false
  • outputDomId: HTML dom ID that will print debugging data (default:'tm-debug-output')

Comments

Add Comment

Login with SNS account to write comments. see details

UP