Client: Difference between revisions

From Our World of Text Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 9: Line 9:
* fetchUnloadedTiles()
* fetchUnloadedTiles()
* getTileVisibility()
* getTileVisibility()
* getCenterCoords()
* getCenterCoords(): Array[number, number]
* broadcastReceive(force: boolean)
* broadcastReceive(force: boolean)
* broadcastCommand(data: string, includeUsername: boolean)
* broadcastCommand(data: string, includeUsername: boolean)
Line 51: Line 51:
* changeBgColor(color: string)
* changeBgColor(color: string)
* fetchUpdates(margin: number)
* fetchUpdates(margin: number)
* splitTile(str: string)
* splitTile(str: string): string
* shiftZoombar()
* shiftZoombar()
* setFlushInterval(rate: number)
* setFlushInterval(rate: number)

Revision as of 18:17, 17 May 2023

w Namespace

  • doGoToCoord(y: number, x: number)
  • typeChar(char: string, doNotMoveCursor: boolean, color: number, noNewline: boolean, undoCursorOffset: boolean, bgColor: number)
  • getChar(tileX: number, tileY: number, charX: number, charY: number)
  • moveCursor(direction: string, preserveVertPos, amount: number)
  • fetchUnloadedTiles()
  • getTileVisibility()
  • getCenterCoords(): Array[number, number]
  • broadcastReceive(force: boolean)
  • broadcastCommand(data: string, includeUsername: boolean)
  • jquery(callback: function)
  • redraw()
  • reloadRenderer()
  • setRedraw()
  • setTileRedraw(tileX: number, tileY: number)
  • setTileRender(tileX: number, tileY: number)
  • setTransparency(transparent: boolean)
  • render(redraw: boolean)
  • changeFont(fontData: string, noReload)
  • fixFonts(mainType: string)
  • loadFont(name: string, path: string, callback: function)
  • changeSpecialCharFont(fontData: string, noReload: boolean)
  • enableCombining(noReload: boolean)
  • disableCombining(noReload: boolean)
  • enableSurrogates(noReload: boolean)
  • disableSurrogates(noReload: boolean)
  • enableColors(noReload: boolean)
  • disableColors(noReload: boolean)
  • basic()
  • restore()
  • night(ignoreUnloadedPattern: boolean)
  • day(reloadStyle: boolean)
  • rotate(speed: number)
  • hideChat()
  • showChat()
  • disableDragging()
  • enableDragging()
  • disableCursor()
  • enableCursor()
  • disableScrolling()
  • enableScrolling()
  • setMouseCursor(cursor: string)
  • resetMouseCursor()
  • setDragCursor(cursor: string)
  • resetDragCursor()
  • changeSocket(address: string)
  • changeColor(color: string)
  • changeBgColor(color: string)
  • fetchUpdates(margin: number)
  • splitTile(str: string): string
  • shiftZoombar()
  • setFlushInterval(rate: number)
  • registerHook(event: string, callback: function)

RegionSelection

  • Constructor: RegionSelection
  • Properties
    • charColor: string
    • color: string
    • tiled: boolean
  • Methods
    • onselection
      • coordA: Array[number, number, number, number]
      • coordB: Array[number, number, number, number]
      • regWidth: number
      • regHeight: number
    • startSelection
    • stopSelectionUI

Code example:

var selection = new RegionSelection();
this.charColor = "#00AA00";
this.color = "rgba(0, 0, 255, 0.1)";
this.tiled = false;
selection.onselection(function(coordA, coordB, regWidth, regHeight) {
    console.log(coordA, coordB, regWidth, regHeight);
});
w.on("keyDown", function(e) {
	if(checkKeyPress(e, "ALT+H")) {
		selection.startSelection();
	}
});