From: Ian Jackson Date: Sun, 23 May 2021 00:52:36 +0000 (+0100) Subject: docs: wip document shapelibs, move from shapelib-toml X-Git-Tag: otter-0.6.0~35 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=59bcdd203f800160b2354fde936fa66f39139928;p=otter.git docs: wip document shapelibs, move from shapelib-toml Signed-off-by: Ian Jackson --- diff --git a/docs/shapelibs.rst b/docs/shapelibs.rst index 390fe081..3d4a9f50 100644 --- a/docs/shapelibs.rst +++ b/docs/shapelibs.rst @@ -195,4 +195,11 @@ Parameters the other face is the same image, but flipped left-to-right. It doesn't make sense to enable this for pieces with a symmetrical appearance. (It is a bad idea to have the game contain state which - is not visible to the players.) + is not visible to the players.) Not compatible with ``back``. + + * ``back``: [_`Piece spec`]. The back of this piece looks like some + other piece (typically, another library item such as a card back). + If specified, the piece will have two faces: the one implied by its + ``files`` entry, and a 2nd face looking like ``back``. If you want + to make the piece be occultable, you must also specify + ``occulted``. ``back`` is not compatible with ``flip``. diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 7bea1e28..3759e972 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -25,11 +25,7 @@ pub struct GroupDetails { #[serde(default)] pub orig_size: Vec, #[serde(default)] pub centre: Option<[f64; 2]>, #[serde(default)] pub flip: bool, - - /// The back of this is some other item. Doesn't make sense - /// with `flip`. - #[serde(default)] - pub back: Option>, + #[serde(default)] pub back: Option>, /// `size` and `centre` are in the SVG's own internal coordinate /// system, not the Otter scaled coordinates which result from