Coffee Shop API beta 2 Preview

Coffee Shop API beta 2 Preview

Coffee Shop beta 1

Yesterday, I have published the first beta release of the SPAS 3.0 API Coffee Shop API. This release is for beta testing, but the current classes of the Coffee Bean API (org.flashapi.coffeeshop.coffeebean) are perfectly stable.
The Coffee Bean API contains all classes for creating "Blitting" transitions.

Coffee Shop beta 2

The following code, available in the next beta release, illustrates the real purpose of the CoffeeShop class:

package {
	
	import flash.display.*;
	import org.flashapi.coffeeshop.*;
	import org.flashapi.coffeeshop.coffeebean.*;
	import org.flashapi.coffeeshop.milling.*;
	
	[SWF(width='336', height='280', backgroundColor='#000000', frameRate='30')]
	public class CoffeeShopExample5 extends Sprite {
		
		public function CoffeeShopExample5() {
			super();
			this.init();
		}
		
		[Embed (source="img1.jpg")]
		private const INITIAL_IMG:Class;
		[Embed (source="img2.jpg")]
		private const FINAL_IMG:Class;
		[Embed (source="img3.png")]
		private const LOGO_IMG:Class;
		
		private var _viewport:Viewport;
		
		private function init():void {
			_viewport = new Viewport(336, 280, false);
			this.addChild(_viewport);
			createMaterial();
			createSample();
		}
		
		//--------------------------------------------------------------------------
		//
		// 	Specific example statement
		//
		//--------------------------------------------------------------------------
		
		private var _img1:BitmapData;
		private var _img2:BitmapData;
		private var _img3:BitmapData;
		
		private function createSample():void {
			var shop:CoffeeShop = new CoffeeShop();
			shop.loop = true;
			
			var background:CoffeeCup = new CoffeeCup(_viewport.bitmapData);
			background.freeze(_img1, 1000);
			background.addTransition(_img1, _img2, PushToBottom, 500);
			background.freeze(_img2, 1000, false);
			background.addTransition(_img2, _img1, Pixelation, 1000);
			
			var text:CoffeeCup = new CoffeeCup(_viewport.bitmapData);
			text.freeze(_img3, 1000);
			text.freeze(_img3, 500, false, FreezeType.FREEZE_TRANSITION);
			text.freeze(_img3, 1000);
			text.freeze(_img3, 1000, false, FreezeType.FREEZE_TRANSITION);
			
			shop.addCoffeeCup(text);
			shop.addCoffeeCup(background);
			
			shop.play();
		}
		
		private function createMaterial():void {
			_img1 = new INITIAL_IMG().bitmapData;
			_img2 = new FINAL_IMG().bitmapData;
			_img3 = new LOGO_IMG().bitmapData;
		}
	}
}

Get Adobe Flash player

Coffee Shop RC 1

The RC1 version is scheduled for release in early September. If you are using beta releases, all feedback is welcome and will be helpful to improve the API.

The Coffee Shop API should be available in the SPAS 3.0 alpha 6.1 release.

Share this article:

Comments:

There are no comments yet for this article.

Leave a reply

Your email is required but will not be displayed.

To prevent abusive emails, please enter the numbers you see in the image below:

Security code