Jump to content

Client: Difference between revisions

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>