on master help sign in
Merge branch 'master' into dev
commit3ae8b16109388816827bcfa86b2095ac24c58156 authorEvan Czaplicki <info@elm-lang.org> dateTue 29 Oct 2013, 15:40 (13 years ago) parentd97fe1971fb0a3
2 files changed+16−16
libraries/Automaton.elm+1−1 libraries/Graphics/Collage.elm+15−15
libraries/Automaton.elm+1−1
@@ -4,7 +4,7 @@ module Automaton ( pure, state, hiddenState, run, step
44
55{-| This library is a way to package up dynamic behavior. It makes it easier to
66dynamically create dynamic components. See the [original release
7−notes](/blog/announce/version-0.5.0.elm) on this library to get a feel for how
7+notes](http://elm-lang.org/blog/announce/0.5.0.elm) on this library to get a feel for how
88it can be used.
99
1010# Create
libraries/Graphics/Collage.elm+15−15
@@ -162,37 +162,37 @@ transformation.
162162groupTransform : Transform2D -> [Form] -> Form
163163groupTransform matrix fs = form (FGroup matrix fs)
164164
165−{-| Rotate a form by a given angle. Rotate takes standard Elm angles (radians)
166−and turns things counterclockwise. So to turn `form` 30&deg; to the left
167−you would say, `(rotate (degrees 30) form)`.
168−-}
169−rotate : number -> Form -> Form
170−rotate t f = { f | theta <- f.theta + t }
171−
172−{-| Scale a form by a given factor. Scaling by 2 doubles the size.
173−-}
174−scale : number -> Form -> Form
175−scale s f = { f | scale <- f.scale * s }
176−
177165{-| Move a form by the given amount. This is a relative translation so
178166`(move (10,10) form)` would move `form` ten pixels up and ten pixels to the
179167right.
180168-}
181−move : (number,number) -> Form -> Form
169+move : (Float,Float) -> Form -> Form
182170move (x,y) f = { f | x <- f.x + x, y <- f.y + y }
183171
184172{-| Move a shape in the x direction. This is relative so `(moveX 10 form)` moves
185173`form` 10 pixels to the right.
186174-}
187−moveX : number -> Form -> Form
175+moveX : Float -> Form -> Form
188176moveX x f = { f | x <- f.x + x }
189177
190178{-| Move a shape in the y direction. This is relative so `(moveY 10 form)` moves
191179`form` upwards by 10 pixels.
192180-}
193−moveY : number -> Form -> Form
181+moveY : Float -> Form -> Form
194182moveY y f = { f | y <- f.y + y }
195183
184+{-| Scale a form by a given factor. Scaling by 2 doubles the size.
185+-}
186+scale : Float -> Form -> Form
187+scale s f = { f | scale <- f.scale * s }
188+
189+{-| Rotate a form by a given angle. Rotate takes standard Elm angles (radians)
190+and turns things counterclockwise. So to turn `form` 30&deg; to the left
191+you would say, `(rotate (degrees 30) form)`.
192+-}
193+rotate : Float -> Form -> Form
194+rotate t f = { f | theta <- f.theta + t }
195+
196196{-| Set the alpha of a `Form`. The default is 1, and 0 is totally transparent. -}
197197alpha : Float -> Form -> Form
198198alpha a f = { f | alpha <- a }