From bf0ea4f435a995acfc0236141e18d33183b9e133 Mon Sep 17 00:00:00 2001 From: oakes Date: Sun, 20 Apr 2014 22:19:14 -0400 Subject: [PATCH] Improve docstring for shape --- src/play_clj/core_graphics.clj | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index ac7920f..4766960 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -32,11 +32,19 @@ (defmacro shape "Returns an entity based on [ShapeRenderer](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShapeRenderer.html). +You may pass in a type (see `shape-type`) or an existing `shape` entity that you +want to modify. - ; create a red rectangle +A `shape` can draw multiple sub-shapes internally, allowing you to create more +complicated shapes. If you use `assoc` to set the overall :x and :y of the +`shape`, each sub-shape's x and y position will be relative to it. + + ; create a green and red rectangle (shape :filled + :set-color (color :green) + :rect 0 0 10 30 :set-color (color :red) - :rect 0 0 10 30) + :rect 10 0 10 30) ; create an empty shape, then set it to a green rectangle (shape (shape :filled) :set-color (color :green)