@aistglobal/chessboard
v1.0.10
Published
Simple chess board
Downloads
33
Maintainers
Readme
Chess Board
Simple chess board used api from chess.js and chessboard.js include new
functionality custom handling envents and custom promotion
- example implementation
var config = {
...
//same chessboard.js configurations
};
var ex1Board = new BoardChess('board',config);
methods
- get fen
ex1Board.fen
- get game
ex1Board.game
- get board
ex1Board.board
- get pgn
ex1Board.pgn
- get move
ex1Board.move
- set position
ex1Board.position('position string like fen')
- mixins(triggers)
- on dragStart
ex1Board.on('dragStart',cb => {
//...
})
//es5
ex1Board.on('dragStart',function(){
//...
})
- on drop
ex1Board.on('drop',cb => {
//...
})
//es5
ex1Board.on('drop',function(){
//...
})
- on drop
ex1Board.on('snapEnd',cb => {
//...
})
//es5
ex1Board.on('snapEnd',function(){
//...
})
- on update
ex1Board.on('update',cb => {
//...
})
//es5
ex1Board.on('update',function(){
//...
})
Cancel the subscription, usage handler
ex1Board.off('update',cb => {
//...
})
//es5
ex1Board.off('update',function(){
//...
})
Chess Board
Simple chess board used api from chess.js and chessboard.js include new
functionality custom handling envents and custom promotion
- example implementation
var config = {
...
//same chessboard.js configurations
};
var ex1Board = new BoardChess('board',config);
methods
- get fen
ex1Board.fen
- get game
ex1Board.game
- get board
ex1Board.board
- get pgn
ex1Board.pgn
- get move
ex1Board.move
- set position
ex1Board.position('position string like fen')
- mixins(triggers)
- on dragStart
ex1Board.on('dragStart',cb => {
//...
})
//es5
ex1Board.on('dragStart',function(){
//...
})
- on drop
ex1Board.on('drop',cb => {
//...
})
//es5
ex1Board.on('drop',function(){
//...
})
- on drop
ex1Board.on('snapEnd',cb => {
//...
})
//es5
ex1Board.on('snapEnd',function(){
//...
})
- on update
ex1Board.on('update',cb => {
//...
})
//es5
ex1Board.on('update',function(){
//...
})
Cancel the subscription, usage handler
ex1Board.off('update',cb => {
//...
})
//es5
ex1Board.off('update',function(){
//...
})