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

Support for alternatives when loading custom chess pieces (PNGs, individual SVGs) #90

Open
vesper8 opened this issue Oct 5, 2022 · 3 comments

Comments

@vesper8
Copy link

vesper8 commented Oct 5, 2022

I would like to use the pieces from these chess sets: https://commons.wikimedia.org/wiki/Category:SVG_chess_pieces/Maurizio_Monge

I've been trying to make it work with the way you've set up your SVG sprite that includes all pieces in one file.. and I'm having a very hard time. I've found two other dozen sets of chess SVGs (here:https://github.com/supertorpe/chessendgametraining/tree/master/src/assets/pieces) that I would love to play with and possibly use but making it work with your format is very difficult.

It would have been lovely if you added support for alternatives when using custom piece sets.. such as allowing us to pass individual svgs or individual pngs.

Or some kind of converter script that accepts the individual SVGs and resizes them and constructs the sprite SVG in the format usable by cm-chessboard.

I know it's a shot in the dark and asking for a lot.. but figured it doesn't hurt to ask. In its current form.. it's just rather hard to work with any other custom set.

If you have tips on how to go about it, such as a handy tool to use, that adds to your comment here #26 (comment), I'd love to hear it.

Many thanks

@vesper8 vesper8 changed the title Support for alternatives when loading custom chess pieces (PNGs, individual SVGs) [Feature Request] Support for alternatives when loading custom chess pieces (PNGs, individual SVGs) Feb 23, 2023
@vesper8
Copy link
Author

vesper8 commented Feb 23, 2023

Being able to assign individual SVGs for each of the black and white pieces would be such a game changer! CM-Chessboard is already a very popular library but being restricted to only a few chess pieces styles I think is holding it back from becoming the de facto JS chessboard! Don't you agree @shaack ?

@shaack
Copy link
Owner

shaack commented Feb 23, 2023

I don't think that individual pieces sets for b and w would be necessary. But adding more sets is easy, there are many in the lichess repository which can be integrated.

@vesper8
Copy link
Author

vesper8 commented Feb 28, 2023

I would still love to see this kind of support added. Currently adding more sets is not what I would call easy as you must take 10+ individual SVGs and build a single SVG sprite which to an SVG expert might not be so hard but because of issues with scale, coordinates translation in the SVG paths, and the difficulty in perfectly aligning the pieces on the SVG sprite.. in the best case scenario where the individual SVGs follow a standard, as perhaps in the case of Lichess, this may be not that hard, but when wanting to use other sets such as the ones I link to in my first post, it's very hard indeed.

@shaack shaack changed the title [Feature Request] Support for alternatives when loading custom chess pieces (PNGs, individual SVGs) Support for alternatives when loading custom chess pieces (PNGs, individual SVGs) Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants