mirror of
https://github.com/sexybiggetje/pixdisp.git
synced 2024-11-22 04:41:02 +01:00
Abstract version of the API
This commit is contained in:
parent
98acb150ab
commit
e7f23a391a
1 changed files with 15 additions and 1 deletions
|
@ -34,8 +34,22 @@ class VMController
|
|||
}
|
||||
|
||||
resetSandbox() {
|
||||
let matrixSize = this.driver.getSize();
|
||||
|
||||
this.sandbox = {
|
||||
'matrix': this.driver,
|
||||
'WIDTH': matrixSize.width,
|
||||
'HEIGHT': matrixSize.height,
|
||||
|
||||
'setBrightness': this.driver.setBrightness.bind( this.driver ),
|
||||
'getBrightness': this.driver.getBrightness.bind( this.driver ),
|
||||
'setPixel': this.driver.setPixel.bind( this.driver ),
|
||||
'getPixel': this.driver.getPixel.bind( this.driver ),
|
||||
'drawLine': this.driver.drawLine.bind( this.driver ),
|
||||
'drawRect': this.driver.drawRect.bind( this.driver ),
|
||||
'drawRectFilled': this.driver.drawRectFilled.bind( this.driver ),
|
||||
'drawCircle': this.driver.drawCircle.bind( this.driver ),
|
||||
'write': this.driver.write.bind( this.driver ),
|
||||
|
||||
'delta': this.getDelta.bind( this )
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue