From 391fbf51d9e96f81e21fa78b5762fce3b74f97db Mon Sep 17 00:00:00 2001 From: Corey Date: Mon, 28 Apr 2014 08:59:13 -0400 Subject: [PATCH] Updated tutorial to include info on rotation/scaling --- TUTORIAL.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TUTORIAL.md b/TUTORIAL.md index 3cd6d80..5402c37 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -65,6 +65,16 @@ A `texture` contains the underlying Java object. By default, it will be drawn at :x 50 :y 50 :width 100 :height 100) ``` +You can also set scaling and rotation on a texture using :scale-x, :scale-y, and :angle, which all use either (:origin-x, :origin-y) as the center, or calculate it from the size of the texture: +```clojure + (assoc (texture "clojure.png") + :x 50 :y 50 :width 100 :height 100 + :scale-x 1.5 :scale-y 0.75 :angle 30 + :origin-x 50 :origin-y 0) +``` + +Note: if you're not rotating/scaling, try to set the angle and scale keys to nil, so that the simpler drawing function will be used. + ## Input Let's add a new function at the end of `defscreen` called `:on-key-down`, which runs when a key is pressed: