README.md in sprite_animation-0.1.0 vs README.md in sprite_animation-0.2.0
- old
+ new
@@ -1,15 +1,24 @@
+# NOT FUNCTIONAL
+# WORKING ON IT
+
# SpriteAnimation
+> Attention please.<br>
+> I'm still working on documenting it.<br>
+> There are still no tests whatsoever.<br>
+> Any contribution would be extremely appreciated.<br>
+
+
This gem makes it easy creating animated images in your views given a sprite sheet. Just add it to your project and start animating sprite sheets.
SpriteAnimation gem encapsulates all the javascript, jquery and rails logic you need. It was made to be as simple as possible. Try it!
## Usage
-SpriteAnimation gem extends your view helpers with one more method: `animated_image`.
+SpriteAnimation gem extends your view helpers with one more method: `animate_sprite`.
-`animated_image(image_src, frame_count, params = {})`
+`animate_sprite(image_src, frame_count, params = {})`
**image_src**
The source of the image, just like in [image_tag helper](http://apidock.com/rails/ActionView/Helpers/AssetTagHelper/image_tag).
Can be a local image or a URL of an image.
@@ -18,27 +27,38 @@
String with the number of frames that your sprite sheet has.
**params**
-A hash containing the following optional parameters:
+An optional hash containing the following parameters:
-*scale*
+* scale: Decimal value to resize your frame size. Defaults to 1.
+* orientation: A symbol containing the orientation of your sprite sheet. <br>Can be: `:vertical` or `:horizontal`.
+ If it's not given, SpriteAnimation will try to guess it based on the height and width of your sprite sheet.
-Decimal value to resize your frame size. Defaults to 1.
+## Installation
+Add this line to your application's Gemfile:
+```ruby
+gem 'sprite_animation'
+```
+
+Then run
+```ruby
+bundle install
+```
-*orientation*
+After that, just add the require statement to your `application.js`
+```ruby
+//= require sprite_animation
+```
-A symbol containing the orientation of your sprite sheet. Can be: `:vertical` or `:horizontal`.
-If it's not given, SpriteAnimation will try to guess it based on the height and width of your sprite sheet.
-
## Examples
Using [slim-template](https://github.com/slim-template/slim)
```
-= animated_image("sample-sheet.png", "10") # Looks for a sprite sheet located at app/assets/images/ with 10 frames.
-= animated_image("sample-sheet.png", "10", scale: 0.5) # Same as above, but reducing the frame size to 50% of the original.
-= animated_image("horizontal-sheet.png", "10", orientation: :horizontal) # Forces the orientation to be horizontal
-= animated_image("http://www.remotesheet.com/sheet.jpg", "12") # Fetches the sprite sheet at the URL and animates it with 12 frames
+= animate_sprite("sample-sheet.png", "10") # Looks for a sprite sheet located at app/assets/images/ with 10 frames.
+= animate_sprite("sample-sheet.png", "10", scale: 0.5) # Same as above, but reducing the frame size to 50% of the original.
+= animate_sprite("horizontal-sheet.png", "10", orientation: :horizontal) # Forces the orientation to be horizontal
+= animate_sprite("http://www.remotesheet.com/sheet.jpg", "12") # Fetches the sprite sheet at the URL and animates it with 12 frames
```
## Dependencies
- [jquery-rails](https://github.com/rails/jquery-rails)
- [fastimage](https://github.com/sdsykes/fastimage)