From adac73a951e0d749adc9c80edaec54ec8e860e6d Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Sun, 12 Jun 2011 01:47:38 -0400 Subject: [PATCH] updated docs to reflect engine change --- .../content/help/tutorials/extending.markdown | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/doc-src/content/help/tutorials/extending.markdown b/doc-src/content/help/tutorials/extending.markdown index 9d7f4d88..e07fe249 100644 --- a/doc-src/content/help/tutorials/extending.markdown +++ b/doc-src/content/help/tutorials/extending.markdown @@ -14,11 +14,9 @@ The sprite engine is the work horse of sprite generation it's the interface for ### Requirements -A sprite engine requires only one method and that is `construct_sprite` which must return an object that responds to `save(filepath)` +A sprite engine requires two methods `construct_sprite`, and `save(filename)` -Once inside this method you have access to `images` which is a collection of [Compass::SassExtensions::Sprites::Image](http://rdoc.info/github/chriseppstein/compass/dda7c9/Compass/SassExtensions/Sprites/Image) - -Since the Engine module extends base you also have access to all methods in [Compass::SassExtensions::Sprites::Base](http://rdoc.info/github/chriseppstein/compass/dda7c9/Compass/SassExtensions/Sprites/Base) +Once inside the class you have access to `images` which is a collection of [Compass::SassExtensions::Sprites::Image](http://rdoc.info/github/chriseppstein/compass/dda7c9/Compass/SassExtensions/Sprites/Image) ### Configuration @@ -26,7 +24,7 @@ To enable your sprite engine from the config file set sprite_engine = : -The example below will load `Compass::SassExtension::Sprites::ChunkyPngEngine` +The example below will load `Compass::SassExtension::Sprites::ChunkyPngEngine.new(width, height, images)` sprite_engine = :chunky_png @@ -35,13 +33,16 @@ The example below will load `Compass::SassExtension::Sprites::ChunkyPngEngine` module Compass module SassExtensions module Sprites - module Engine + class ChunkyPngEngine < Compass::SassExtensions::Sprites::Engine - # Returns an object def construct_sprite - #must return a image object that responds to save(filename) + #do something + end + + def save(filename) + #save file end - + end end end