Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Communicate Chess Board State (FEN) to GUI in Real-Time #280

Open
38alysia opened this issue Jul 17, 2024 · 1 comment
Open

How to Communicate Chess Board State (FEN) to GUI in Real-Time #280

38alysia opened this issue Jul 17, 2024 · 1 comment
Labels
question Further information is requested

Comments

@38alysia
Copy link

Hello,

I am working on a project where I need to display chess positions on a GUI chessboard in real-time. Specifically, I am looking for a way to sync the FEN (Forsyth-Edwards Notation) string, which represents the chess board state, with the GUI, so that any changes in the game state are immediately reflected on the GUI board.

Could you provide guidance or examples on how to establish communication between the program logic (which generates the FEN string) and the GUI to achieve this? Any advice or pointers to relevant documentation or tools that could facilitate this synchronization would be greatly appreciated.

Thank you!

@QueensGambit
Copy link
Collaborator

Hey @38alysia ,

you can check out the code here:

FEN <input
id="lname"
type="text"
name="lname"
placeholder="fen position"
:value="fen"
:size="setFenSize()"
@change="checkValidFEN"
>

and here:
checkValidFEN (event) {
document.dispatchEvent(new Event('resetPlot'))
this.$store.dispatch('fenField', event.target.value)
this.resetAnalysis = !this.resetAnalysis
}
}

fen () {
this.updateBoard()
},

We use https://github.com/gbtami/chessgroundx for the board rendering, which is an extension of chessground used in lichess.org.

@QueensGambit QueensGambit added the question Further information is requested label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants