Abstract Play Renderer
[0.6.0] - 2021-12-15
Breaking Change
- The renderer now works correctly in both Chrome and Firefox. The glyph sheets have now all been converted to
symbol
s instead of basicgroup
s. This has vastly simplified the layout code, though it required extensive code changes. Further testing is planned on other browsers.
Added
-
Added a new
glyph
marker for incorporating glyphs defined in thelegend
into the board itself. Only works in thedefault
andstacking-offset
renderers. This marker applies no extra padding around the glyph like it does for pieces. That would have to be added in the legend. -
Added a new
text
property to glyph definitions. This allows you to create arbitrary text glyphs using all the standard colour and layout options. It is mutually exclusive with thename
property. Because not all implementations of JSON schema handle this sort of validation equally, validation is not handled at that level. Ifname
is present, it will override thetext
property. If neither are present, a runtime error is thrown. -
Added a new
buffer
property to theboard
schema to create adjustable buffer zones on given edges of the board. The intent is that these would be used by the click handlers to do things like bear pieces off the board or other such interactions. Only works forsquare*
,vertex*
, andgo
boards. If a click handler is attached, they will all return the coordinates-1, -1
and the label_buffer_[DIR]
, eitherN
,E
,S
, orW
. Rotates correctly.Note: To avoid the buffer click handlers from interfering with the generic click handler on
vertex
boards, if a buffer is present at all (regardless of whether it is shown), the generic handler ignores clicks outside of the board's outer edge. This reduces the sensitivity of clicks along the edge, but it's still quite functional.
Removed
- Removed the
key
feature for now. It is a decidedly nontrivial task to generalize this in a way that works cross-browser. Its only use so far has been for Volcano, and that is now obviated by the click handler. This is something I may revisit.