Client: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Client Documentation == === RegionSelection ===") |
No edit summary |
||
Line 2: | Line 2: | ||
=== RegionSelection === | === 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:<syntaxhighlight lang="javascript"> | |||
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(); | |||
} | |||
}); | |||
</syntaxhighlight> |
Revision as of 18:03, 17 May 2023
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
- onselection
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();
}
});