Skip to content

Commit d4f0e7b

Browse files
committed
Moved.
Signed-off-by: Grant Skinner <[email protected]>
1 parent 9590b23 commit d4f0e7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7194
-7
lines changed

README.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ZOË
2+
3+
Zoë is an open source tool for generating spritesheet images and frame data from SWF files.
4+
5+
The source code is licensed under the MIT public license.
6+
7+
If you are just want to use Zoë, the latest stable .air installer file can be found on the http://easeljs.com/ website.

REPO_MOVED.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

libs/JSON.swc

9.29 KB
Binary file not shown.

libs/gskinner_air.swc

181 KB
Binary file not shown.

libs/gskinner_as3.swc

89.5 KB
Binary file not shown.

src/Zoe-app.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<application xmlns="http://ns.adobe.com/air/application/3.0">
3+
<id>Zoe</id>
4+
<filename>Zoe</filename>
5+
<name>Zoë</name>
6+
<versionNumber>1.6.0</versionNumber>
7+
8+
<initialWindow>
9+
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
10+
<minSize>675 430</minSize>
11+
<autoOrients>false</autoOrients>
12+
<fullScreen>false</fullScreen>
13+
<visible>true</visible>
14+
</initialWindow>
15+
<icon>
16+
<image16x16>icons/16x16.png</image16x16>
17+
<image32x32>icons/32x32.png</image32x32>
18+
<image48x48>icons/48x48.png</image48x48>
19+
<image128x128>icons/128x128.png</image128x128>
20+
</icon>
21+
22+
</application>

src/Zoe.mxml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Zoë by gskinner.com.
4+
Visit www.gskinner.com/blog for documentation, updates and more free code.
5+
6+
Copyright (c) 2010 Grant Skinner
7+
8+
Permission is hereby granted, free of charge, to any person
9+
obtaining a copy of this software and associated documentation
10+
files (the "Software"), to deal in the Software without
11+
restriction, including without limitation the rights to use,
12+
copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
copies of the Software, and to permit persons to whom the
14+
Software is furnished to do so, subject to the following
15+
conditions:
16+
17+
The above copyright notice and this permission notice shall be
18+
included in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27+
OTHER DEALINGS IN THE SOFTWARE.
28+
-->
29+
30+
<!---
31+
32+
Zoë (from Zoetrope) is a simple AIR application for OSX or Windows provides an easy way to export swf animations as sprite sheets for use with EaselJS.
33+
34+
Simply drag a SWF file onto the application. It will scan the main timeline to find frame labels and dimensions. You can tweak the frame bounds, edit settings, then export a sprite sheet image and EaselJS code defining a SpriteSheet instance with frame data based on the timeline labels.
35+
36+
SWFs should have all animation on the main timeline, with frame labels to indicate the start of animations. Nested graphics are fine.
37+
38+
-->
39+
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" showStatusBar="false"
40+
xmlns:s="library://ns.adobe.com/flex/spark" width="675" height="500" applicationComplete="init()"
41+
xmlns:mx="library://ns.adobe.com/flex/mx" skinClass="com.gskinner.skins.ApplicationSkin"
42+
xmlns:views="com.gskinner.zoe.views.*"
43+
nativeDragOver="handleDragOver(event)" nativeDragDrop="handleDragDrop(event)"
44+
>
45+
46+
<fx:Script>
47+
<![CDATA[
48+
import com.chewtinfoil.utils.DateUtils;
49+
import com.gskinner.filesystem.Preferences;
50+
import com.gskinner.zoe.utils.ApplicationUpdater;
51+
52+
import mx.controls.Alert;
53+
import mx.controls.ToolTip;
54+
import flash.desktop.ClipboardFormats;
55+
import flash.filesystem.File;
56+
import flash.desktop.NativeDragManager;
57+
58+
/**
59+
* @private
60+
*
61+
*/
62+
protected function init():void {
63+
//Check for new versions, if needed.
64+
var lastUpdateTime:Date = Preferences.getPref('lastUpdateCheck') as Date;
65+
if (lastUpdateTime == null) {
66+
lastUpdateTime = new Date();
67+
} else if (DateUtils.addDays(lastUpdateTime, 5).time >= new Date().time) {
68+
ApplicationUpdater.checkForUpdates(true);
69+
lastUpdateTime = new Date();
70+
}
71+
72+
Preferences.setPref('lastUpdateCheck', lastUpdateTime, false, true);
73+
74+
//Center on screen
75+
var s:Screen = Screen.mainScreen;
76+
this.nativeWindow.x = (s.bounds.width-width) >> 1;
77+
this.nativeWindow.y = (s.bounds.height-height) >> 1;
78+
79+
this.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleError);
80+
}
81+
82+
/**
83+
* @private
84+
*
85+
*/
86+
protected function handleError(event:UncaughtErrorEvent):void {
87+
event.preventDefault();
88+
Alert.show((event.text.length) ? event.text : "An unexpected error has occurred.", "Error");
89+
}
90+
91+
/**
92+
* @private
93+
*
94+
* We allow draw and drop of multiple swfs.
95+
*/
96+
protected function handleDragOver(event:NativeDragEvent):void {
97+
if (!event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT)) {
98+
return;
99+
}
100+
101+
var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
102+
103+
var l:uint = files.length;
104+
var validFiles:uint = 0;
105+
for (var i:uint=0;i<l;i++) {
106+
var file:File = files[i];
107+
if (file.extension == 'swf') {
108+
validFiles++; break;
109+
}
110+
}
111+
112+
if (validFiles > 0) {
113+
NativeDragManager.acceptDragDrop(this);
114+
}
115+
}
116+
117+
/**
118+
* @private
119+
*
120+
*/
121+
protected function handleDragDrop(event:NativeDragEvent):void {
122+
var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
123+
var l:uint = files.length;
124+
125+
var swfs:Array = [];
126+
for (var i:uint=0;i<l;i++) {
127+
var file:File = files[i];
128+
if (file.extension == 'swf') {
129+
swfs.push(file);
130+
}
131+
}
132+
133+
swfCapture.loadSwfs(swfs);
134+
}
135+
136+
]]>
137+
</fx:Script>
138+
139+
<fx:Style source="com/gskinner/zoe/styles/styles.css" />
140+
141+
<s:layout>
142+
<s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" />
143+
</s:layout>
144+
145+
<s:SkinnableContainer width="100%" height="100%" backgroundColor="0xffffff">
146+
<views:Main id="swfCapture" width="100%" height="100%" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" />
147+
</s:SkinnableContainer>
148+
149+
</s:WindowedApplication>

src/assets/4x4Grid.png

2.76 KB
Loading

src/assets/ColorPicker.png

1.13 KB
Loading

src/assets/ColorPickerAlpha.png

1.16 KB
Loading

src/assets/DeleteConfigButton.png

2.86 KB
Loading

src/assets/FileIconAdd.png

204 Bytes
Loading

src/assets/FolderIcon.png

2.87 KB
Loading

src/assets/Graphics.fla

12.4 KB
Binary file not shown.

src/assets/Graphics.swf

1.83 KB
Binary file not shown.

src/assets/Refresh.png

309 Bytes
Loading

src/assets/RunArrow.png

278 Bytes
Loading

src/assets/TileMainBG.png

263 Bytes
Loading

src/assets/TileMenuBG.png

253 Bytes
Loading

src/assets/TilePopupBG.png

212 Bytes
Loading

src/assets/TransparencyBtn_over.gif

74 Bytes
Loading

src/assets/TransparencyBtn_up.png

2.76 KB
Loading
27.2 KB
Binary file not shown.

src/assets/helpIcon.png

706 Bytes
Loading

src/assets/play-pause.png

2.07 KB
Loading

src/assets/play.png

2.14 KB
Loading

src/com/adobe/images/PNGEncoder.as

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
Copyright (c) 2008, Adobe Systems Incorporated
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are
7+
met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright
13+
notice, this list of conditions and the following disclaimer in the
14+
documentation and/or other materials provided with the distribution.
15+
16+
* Neither the name of Adobe Systems Incorporated nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
package com.adobe.images
33+
{
34+
import flash.geom.*;
35+
import flash.display.Bitmap;
36+
import flash.display.BitmapData;
37+
import flash.utils.ByteArray;
38+
39+
/**
40+
* Class that converts BitmapData into a valid PNG
41+
*/
42+
public class PNGEncoder
43+
{
44+
/**
45+
* Created a PNG image from the specified BitmapData
46+
*
47+
* @param image The BitmapData that will be converted into the PNG format.
48+
* @return a ByteArray representing the PNG encoded image data.
49+
* @langversion ActionScript 3.0
50+
* @playerversion Flash 9.0
51+
* @tiptext
52+
*/
53+
public static function encode(img:BitmapData):ByteArray {
54+
// Create output byte array
55+
var png:ByteArray = new ByteArray();
56+
// Write PNG signature
57+
png.writeUnsignedInt(0x89504e47);
58+
png.writeUnsignedInt(0x0D0A1A0A);
59+
// Build IHDR chunk
60+
var IHDR:ByteArray = new ByteArray();
61+
IHDR.writeInt(img.width);
62+
IHDR.writeInt(img.height);
63+
IHDR.writeUnsignedInt(0x08060000); // 32bit RGBA
64+
IHDR.writeByte(0);
65+
writeChunk(png,0x49484452,IHDR);
66+
// Build IDAT chunk
67+
var IDAT:ByteArray= new ByteArray();
68+
for(var i:int=0;i < img.height;i++) {
69+
// no filter
70+
IDAT.writeByte(0);
71+
var p:uint;
72+
var j:int;
73+
if ( !img.transparent ) {
74+
for(j=0;j < img.width;j++) {
75+
p = img.getPixel(j,i);
76+
IDAT.writeUnsignedInt(
77+
uint(((p&0xFFFFFF) << 8)|0xFF));
78+
}
79+
} else {
80+
for(j=0;j < img.width;j++) {
81+
p = img.getPixel32(j,i);
82+
IDAT.writeUnsignedInt(
83+
uint(((p&0xFFFFFF) << 8)|
84+
(p>>>24)));
85+
}
86+
}
87+
}
88+
IDAT.compress();
89+
writeChunk(png,0x49444154,IDAT);
90+
// Build IEND chunk
91+
writeChunk(png,0x49454E44,null);
92+
// return PNG
93+
return png;
94+
}
95+
96+
private static var crcTable:Array;
97+
private static var crcTableComputed:Boolean = false;
98+
99+
private static function writeChunk(png:ByteArray,
100+
type:uint, data:ByteArray):void {
101+
if (!crcTableComputed) {
102+
crcTableComputed = true;
103+
crcTable = [];
104+
var c:uint;
105+
for (var n:uint = 0; n < 256; n++) {
106+
c = n;
107+
for (var k:uint = 0; k < 8; k++) {
108+
if (c & 1) {
109+
c = uint(uint(0xedb88320) ^
110+
uint(c >>> 1));
111+
} else {
112+
c = uint(c >>> 1);
113+
}
114+
}
115+
crcTable[n] = c;
116+
}
117+
}
118+
var len:uint = 0;
119+
if (data != null) {
120+
len = data.length;
121+
}
122+
png.writeUnsignedInt(len);
123+
var p:uint = png.position;
124+
png.writeUnsignedInt(type);
125+
if ( data != null ) {
126+
png.writeBytes(data);
127+
}
128+
var e:uint = png.position;
129+
png.position = p;
130+
c = 0xffffffff;
131+
for (var i:int = 0; i < (e-p); i++) {
132+
c = uint(crcTable[
133+
(c ^ png.readUnsignedByte()) &
134+
uint(0xff)] ^ uint(c >>> 8));
135+
}
136+
c = uint(c^uint(0xffffffff));
137+
png.position = e;
138+
png.writeUnsignedInt(c);
139+
}
140+
}
141+
}

0 commit comments

Comments
 (0)