Martin Bennedik

The Silverlight chess board is designed to have a small footprint on your HTML pages. It is easy to use, you can insert it into your page or blog with one object tag. It won't take over your whole page, you can integrate it into any layout or styling you have on your site.

You can use the Silverlight chess board to show a simple diagram, allow the user to replay a game, show annotated games with comments and variations, choose from a list of replayable games, and do live transmission of games.

Get Microsoft Silverlight

The Silverlight chess board is written by Martin Bennedik, all rights reserved.

If you want to use the Silverlight chess board on your own web site or blog, you can buy a license. There are two types of licenses available below, for personal and for commercial use. Payment is via Paypal. The fee is a one-off payment and includes all future updates. The license is per site, please mention the name of the site when paying.

Not included are live broadcasts of tournaments. Please contact Martin Bennedik at bennedik@googlemail.com if you want to do live broadcasts.

After your payment is received, you will receive the software by email.

License type

Use the following object tag to define a Silverlight chess board:

                <div>

                    <object id="chess" data="data:application/x-silverlight," type="application/x-silverlight-2"

                        width="400" height="400">

                        <param name="source" value="ClientBin/SilverBoard.xap" />

                        <param name="onerror" value="onSilverlightError" />

                        <param name="background" value="white" />

                        <param name="initParams" value="pgnfile=mygames.pgn" />

                        <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">

                            <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"

                                style="border-style: none" />

                        </a>

                    </object>

                    <iframe style='visibility: hidden; height: 0; width: 0; border: 0px'></iframe>

                </div>

The anchor and image tags are used to display a download link for Silverlight to users who haven't got Silverlight installed.

You can use parameters to customize the Silverlight chess board. The parameters for width and height are specified as attributes of the object tag. The other parameters are specified as a comma separated list as the value attribute of the param tag name "initParams". You can use the following parameters with the Silverlight chess board:

width
height
You can specify the width and height of the board using these attributes of the object tag. You can specify the number of pixels here. The Silverlight chess board will make sure that the chess squares are actually squares, not rectangles. It will try the best fit for the given width and height. The best fit is the minium of the width divided by eight, and the height divided by 10. You can also specify the width and height of the board as relative percantage sizes. This should be done as a style, to work correctly in Firefox. This way you can create smoothly resizing chess boards that automatically adapt to the size of the monitor / browser window of the user.
fen
Use the fen parameter to specify a chess position according to the FEN standard.
fenfile
Use the fenfile parameter to specify a fen file name. The fen file must be a text file describing a chess position according to the FEN standard.
san
Use the san parameter to specify a chess game in standard algebraic notation, as used in the PGN standard.
pgnfile
Use the pgnfile parameter to specify a file name of a PGN file. The PGN file must comply with the PGN standard.
refresh
Use the refresh parameter to automatically reload the PGN file every n seconds. This can be used for live transmissions of games. Setting a small number of seconds here will create a high load on your server, so be careful.
game
If you have a PGN file with more than one game, use the game parameter to specify which game to show. By default, the first game in the PGN file is shown.
select
If you have a PGN file with more than one game, by default the user can choose the game from a drop down list. Set the select parameter to 0 if you do not want a drop down list to appear.
notation
Use the notation parameter to specify the id of a div tag on your HTML page that should contain the notation of the game. The Silverlight chess board will generate HTML code of the notation into the specified div. If the user selects a different game from the drop down list, the notation will be updated. You can use CSS on the div to style the notation. Also, the CSS classes ".move", ".comment", and ".variation" are now used for moves, comments, and variations, and allow further formatting.
header
Use the header parameter to specify the id of a div tag on your HTML page that should contain the header information of the game. The following PGN tags are parsed for the header: White, Black, WhiteTitle, BlackTitle, WhiteElo, BlackElo, Event, Site, Round, and Date.
lastmove
Use the lastmove parameter to specify the id of a div tag on your HTML page that should contain the notation of the last move of the game.
whiteclock, blackclock
Use the whiteclock and blackclock parameters to specify the ids of two div tags on your HTML page that should contain the clock times of the games. These clock times are extracted from {[%clk ...]} comments in the PGN, such as written by DGT.
ply
By default the Silverlight chess board will always show the last position of the chess game when loaded. Users can use the arrow buttons or cursor keys to replay the game. If you want to display a diagram of an interesting position in the middle of a game, use the ply parameter to specify the ply number of the position. Do not use the ply parameter in live transmissions.
arrows
By default the board shows a yellow arrow indicating the last move. You can set the parameter arrows to 0 to turn off the arrows.
light
You can change the color of the light squares of the board with the light parameter. The color is specified with a hexadecimal RGB notation (for example 0000ff would be blue).
dark
You can change the color of the dark squares of the board with the dark parameter. The color is specified in the same way as for the light parameter.
flip
By default the board is displayed from White's point of view. Set the flip parameter to 1 to display the board from Black's point of view.
piece
By default the notation is displayed using the English characters for the pieces. The piece parameter can be used to customize the characters used in the notation. The value of the parameter consists of the characters for the pieces in the following order: Pawn, Rook, Knight, Bishop, Queen, King. For example, piece=PRNBQK would be the default English, piece=BTSLDK would be German.
Version 1.6, published 20th March 2012
  • Added support for clock info in PGN files using {[%clk ...]} comments, such as written by DGT.
  • Added support for displaying the last move only, instead of a full notation.
  • Board now adjusts font size for player labels, if only one game is displayed.
  • Improved handling of missing and broken PGN files.
Version 1.4.0.5, published 21st December 2009
  • This version runs on Linux, using the Moonlight plugin.
Version 1.4, published 12th September 2009
  • Added support for international characters in PGN files (according to the PGN standard section 4.1, a subset of ISO 8859/1 Latin 1 is used).
  • Added a new parameter "piece" to allow customized piece characters used in the notation, instead of the English ones used by default. See the description of the "piece" parameter for details.
  • Better error message when a PGN file was not found.
  • Put in a work around for an IE8 standard modes bug, which caused the notation not to wrap lines correctly in some cases.
Version 1.3, published 7th May 2009
  • Added full support for variations. Variations can be replayed by clicking with the mouse on a variation in the notation div.
  • An additional CSS class ".variation" can be used to format variations.
  • Added keyboard support for replaying when the focus is on the notation div. Available keys depend on the browser being used. I have found that the left and right cursor keys work fine in Internet Explorer and Firefox, but not in Google Chrome.
 
Version 1.2, published 22nd April 2009
  • Added optional game header to appear in a div specified with the "header" parameter.
  • PGN comments in curly braces are now supported and appear in the notation div.
  • PGN variations are now partly supported and appear as comments. Full support for PGN variations is planned for a future release.
  • CSS classes ".move" and ".comment" are now used for moves and comments and allow formatting.
  • Fixed an issue where the current move was not highlighted in the notation.
 
Version 1.1, published 18th January 2009
  • Added flip button to show the board from Black's point of view.
  • Added animation when flipping the board.
  • Support keyboard shortcuts page up and page down to switch between games.
  • Added arrows parameter to turn off arrows.
  • Added light and dark parameters to customize board colors.
  • Added a small help screen showing the copyright and keyboard short cuts.
  • Support PGN files with embedded FEN tag for specifying the starting position used for game fragments and solutions to problems or studies.
  • Added flip parameter to flip the board.
 
Version 1.0, published 14th October 2008
  • Initial version for the Silverlight 2.0 release.