Client

From Our World of Text Wiki
Revision as of 18:03, 17 May 2023 by Owot (talk | contribs)
Jump to navigation Jump to search

Client Documentation

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();
	}
});