Comments/Ratings for a Single Item
The showpiece.php script is not the old way. It is newer than even shortcodes. Both are described on this page in a details section that you have to click on to open. Unlike this script, which draws a piece on a colored space surrounded by a colored border, showpiece.php will draw nothing but the piece, and it will be against a transparent background. While displaying individual pieces with showpiece.php is preferable to using drawdiagram.php, it is mainly intended for use with Game Courier or Interactive Diagrams, and shortcodes remain the best thing to use for illustrating member-submitted rules pages.
Here's a post with a bit of history. In case there was doubt, it wasn't my imagination that I/other(s) had been allowed since long ago to use drawdiagram.php to display individual pieces in submissions:
Fergus wrote (on 11 Mar 2016):
"Since some contributors have been using drawdiagram.php to display individual pieces, I have made a couple changes.
-
When drawdiagram.php is used to display a single piece image, it will not display coordinate labels.
-
The Diagram Designer now includes code you can cut and paste for displaying the piece images used in your diagram. This code places piece images within FIGURE.piece tags with a caption, and I have added CSS to the global css files for formatting the piece class for FIGURE..."
[edit: Where did I more recently get the idea I was no longer allowed to display individual pieces my old way?:
Fergus wrote on Tue, Jan 16 04:28 PM EST (in a Comment to my Waffle Chess rules page): "I used shortcodes to display the Waffle piece image, as drawdiagram.php is meant for diagrams, not for displaying individual pieces..."]
edit2: to be fair, displaying an individual piece with shortcodes these days (don't think it was always an available option) is fairly easy (once I saw Fergus' example on my rules page), I hadn't noticed that method. Displaying individual pieces with the showpiece.php script (or whatever Fergus' old way was, if different), on the other hand, is a process I never understood, and it seemed lengthy however it is done.
I have fixed this so that setting the group changes the available sets like it does in Game Courier, using JavaScript without any need to reload the page.
I've reorganized this page to be less cluttered and more mobile-friendly, and I've updated the details on how to display individual pieces. I'll continue work on it tomorrow.
I have now redesigned the layout with flexbox.
What heppened with diagram designer? It's some kind of bug because diagram is going to obscured on something and prevent me for change that such as piece style.
I moved the form up higher to make it level with the diagram. This didn't cause any problems on my wide HD screen, but when I made the window narrower just now, I saw that the diagram was overlapping with the form. I'll look into fixing that.
Common Parameters for all Shapes used to be lower down on this page - avoiding the current problem. I believe the HTML and Markdown boxes were above it before.
What heppened with diagram designer? It's some kind of bug because diagram is going to obscured on something and prevent me for change that such as piece style.
The set groups Chushin Shogi and Taishin Shogi have no working graphics for any of the sets listed.
I have now moved test.php to drawdiagram.php. It now uses the $scale
value while drawing the board instead of after it is already drawn. So, if you want to use it with oversized SVG pieces at a size that will still look good when displayed at different sizes, you can do it by setting the scale
value. Values under 20 will be interpreted as raw multiples, and values above 20 or with a % at the end will be interpreted as percentages. So, scale=2, scale=200, and scale=200% should all have the same effect. While there are still some issues with this script, I did not notice any that were not already in drawdiagram.php.
I made some progress on this today. It helped that I figured out how to customize the color temperature on my monitor and change the color theme of my text editor. Now that I have a dark background with lower light levels, it's easier to stare at code. In test.php, I got scaling to work for tiled boards, and I got the file markers to show up properly for the grid shape, but there are still issues with displaying full board images.
I just remembered this morning that I was working on updating a copy of drawdiagram.php for the sake of using the scale value while drawing the board instead of after it was all drawn, and I got stuck in the section for using board images. Meanwhile, I made some further changes to the main drawdiagram.php script. Before I do anything else with this script, I will have to integrate the change to both versions.
The file labels still seem to be positioned incorrectly.
I've now gotten drawdiagram.php to accept a theme
parameter. This will not work without the game
parameter, and it may sometimes require the settings
parameter. The theme
parameter includes a theme file after the settings file, further modifying settings to conform to a specific theme. Here's one test run with the Motif-Wood theme for Chess.
I added some new parameters to drawdiagram.php. These are game
and settings
. When used together, the script will load a Game Courier settings file, and it will overwrite any value that is still set to a default value. This will allow you to use the fen
shortcode to show diagrams for specific games without specifying all the particular details. When you use these two parameters, the fen
shortcode will not add its own defaults to the query string. This will allow you to use the default values provided by the settings file instead. But you can override any value in a settings file by explicitly including a new value in the query string.
I've now changed the default to the green/white combination I posted last night. For the sake of contrasting with the blue pieces, I made the green brighter than the blue, and I gave it more red than blue. To better contrast with the white pieces and the beige background, I made the light squares an off-white that is darker than full white, and to better contrast with the blue pieces, I made the red and green components slightly higher than the blue component. But I avoided making it into a clear yellow, because the use of yellow generally added to the brightness of the board.
Yep, good enough for me.
This green/white layout looks good and has no annoying flaws.
I have grown to hate the darkkhaki/whitesmoke board, mainly for the darkkhaki squares, which have begun to look like gold to me. They seem very bright and flashy, as well as less solid.
Here are the characteristics I think the default board should have:
- It should not be too loud, bright, or flashy.
- It should appear solid enough that it doesn't need a border.
- There should be good contrast between all the colors.
- It should generally follow a green/white color scheme
It was using ctype_lower, which checks whether every character is lowercase, and these had numerals in them. So, I replaced ctype_lower with my own function haslower, which checks whether any character in a string is lowercase.
The chancellor2 and cardinal2 are not being recolored for some reason.
Beside this, how do you do to embedd images of diagrams in your comments? Is there a trick?
Yes, there is a trick, and this is what the discussion is about. Just write a FEN of the position you want to show as part of your text, and surround it by 'tags' [ fen] and [/ fen] (without the internal space, which I just added here to prevent the word 'and' will be interpreted as a FEN of a 3x1 board).
E.g. [ fen]nqkrb/ppppp/5/PPPPP/NQKRB[ /fen] would give you:
I'm feeling stupid. This discussion with tens of messages from Fergus, HG, etc. is related to what?
It is linked to Diagram Designer page but I don't understand what it is for. I see no change on that page. Can it be explained?
I do feel my question is stupid but I really don't understand what you are talking about.
Beside this, how do you do to embedd images of diagrams in your comments? Is there a trick?
Thank you.
25 comments displayed
Permalink to the exact comments currently displayed.
Last night I did open links on the details section on Diagram Designer Page, but I still could not quite get my head around what the showpiece.php script was all about. It looked like something a Diagram Designer really ought to be able to generate by putting a piece into the diagram somehow, but I was afraid it's something you have to type in character by character somewhere, and then cut and paste somewhere. Maybe there was technical stuff a user should know about (e.g. HTML knowledge assumed).
Whatever the old way of generating an individual piece was, I could not get my head around that either, and technical stuff is not always easy to explain to someone unfamiliar with modern computers/software, unless a ready example or two is available. I was quite happy when I realized I could put an individual piece on a 1x1 'board' (i.e. single square) using the drawdiagram.php. The method is quick and easy, if not 'brilliant', though it produces an image of the sort you seem to no longer be quite satisfied with, after second thoughts (maybe years later[?]). Too bad drawdiagram.php does not work if a 0x0 board were specified, to leave out the image of a single 'square'.