https://github.com/dawee/mei-goban
Goban for meishengo in HTML5 Canvas
https://github.com/dawee/mei-goban
Last synced: 2 months ago
JSON representation
Goban for meishengo in HTML5 Canvas
- Host: GitHub
- URL: https://github.com/dawee/mei-goban
- Owner: dawee
- License: mit
- Created: 2014-11-11T14:18:11.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-15T13:36:06.000Z (over 11 years ago)
- Last Synced: 2025-03-07T03:34:35.465Z (over 1 year ago)
- Language: JavaScript
- Size: 438 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mei-goban
Goban for [meishengo](https://github.com/dawicorti/meishengo) in HTML5 Canvas

## Usage
### Create and append goban
```js
var goban = new Goban();
parentNode.appendChild(goban.el);
```
### API
- **goban.set**(key, value)
- **'width' / 'height'** : resize goban canvas
- **'size'** : goban type (9/13/19)
- **'boardColor'** : lines and hoshis color
- **'blackStoneColor'** : color of a black stone
- **'whiteStoneColor'** : color of a white stone
- **goban.putStone**(row, col, color)
- **row** : stone row
- **col** : stone col
- **color** : 'black' or 'white'
- **goban.removeStone**(row, col)
- **row** : stone row
- **col** : stone col
- **goban.on**(event, callback)
- **event** : 'intersection:mousedown' / 'intersection:mouseup' / 'intersection:mousemove'
- **callback** : got params _row_ & _col_