chiark / gitweb /
docs: wip document shapelibs, move from shapelib-toml
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 May 2021 00:45:54 +0000 (01:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 May 2021 00:45:54 +0000 (01:45 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
docs/shapelibs.rst
src/shapelib-toml.rs

index 8b0bb031362abde03b607b31fad508c7ebb0aee3..390fe08139f3445d9af2e1be9f10f3b76582962d 100644 (file)
@@ -184,3 +184,15 @@ Parameters
    to ``size``.  If both ``size`` and ```orig_size`` are 2 elements,
    this can scale by different amounts in x and y, distorting the
    image.
+
+ * ``centre`` [2-element array].  The centre of the image, measured
+   from the top left in the image's own internal units.  If not
+   supplied, calculated from the size.
+
+ * ``flip`` [boolean, default: false].  Whether this piece can "flip".
+   If true, the piece will have two faces, one of which is a mirror
+   image of the other.  The default face will be un-reflected version;
+   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.)
index 89d581e9ba40a9f74dcebcd8bb47756b93243126..7bea1e2838261f3cc88b22c45957541e25e8ae50 100644 (file)
@@ -23,14 +23,8 @@ pub struct GroupDetails {
   #[cfg(doc)]inherit: String, // handled specially
   pub size: Vec<f64>,  // scaled when put into GroupData
   #[serde(default)] pub orig_size: Vec<f64>,
-
-  #[serde(default)]
-  /// Default if not supplied is the centre according to the size.
-  pub centre: Option<[f64; 2]>,
-
-  #[serde(default)]
-  /// Default is `false`
-  pub flip: bool,
+  #[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`.