Permalink
Browse files

修改ISpriteSheetMetada定义;加入ant编译功能;删除FB的项目文件。

  • Loading branch information...
1 parent b21d19b commit 515450979b63bc790bf4e5be7039470ef813aacf @zrong committed Jun 13, 2013
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<actionScriptProperties analytics="false" mainApplicationPath="我的通用类.as" projectUUID="4f177082-2376-49f6-bc1e-bc3778c7f3fa" version="6">
- <compiler additionalCompilerArguments="" autoRSLOrdering="true" copyDependentFiles="false" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
- <compilerSourcePath/>
- <libraryPath defaultLinkType="0">
- <libraryPathEntry kind="4" path="">
- <modifiedEntries>
- <libraryPathEntry index="3" kind="3" linkType="4" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="true">
- <crossDomainRsls>
- <crossDomainRslEntry autoExtract="true" policyFileUrl="" rslUrl="framework_3.5.0.12683.swz"/>
- <crossDomainRslEntry autoExtract="true" policyFileUrl="" rslUrl="framework_3.5.0.12683.swf"/>
- </crossDomainRsls>
- </libraryPathEntry>
- <libraryPathEntry index="5" kind="3" linkType="4" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="true">
- <crossDomainRsls>
- <crossDomainRslEntry autoExtract="true" policyFileUrl="http://fpdownload.adobe.com/pub/swz/crossdomain.xml" rslUrl="http://fpdownload.adobe.com/pub/swz/flex/4.0.0.14159/sparkskins_4.0.0.14159.swz"/>
- <crossDomainRslEntry autoExtract="true" policyFileUrl="" rslUrl="sparkskins_4.0.0.14159.swz"/>
- </crossDomainRsls>
- </libraryPathEntry>
- </modifiedEntries>
- <excludedEntries>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/utilities.swc" useDefaultLinkType="false"/>
- </excludedEntries>
- </libraryPathEntry>
- </libraryPath>
- <sourceAttachmentPath/>
- </compiler>
- <applications>
- <application path="我的通用类.as"/>
- </applications>
- <modules/>
- <buildCSSFiles/>
-</actionScriptProperties>
View
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<flexLibProperties includeAllClasses="true" version="3">
- <includeClasses>
- <classEntry path="org.zengrong.flex.controls.ColoredDataGrid"/>
- <classEntry path="org.zengrong.flex.controls.Loader"/>
- <classEntry path="org.zengrong.events.InfoEvent"/>
- <classEntry path="org.zengrong.logging.Firebug"/>
- <classEntry path="org.zengrong.logging.FirebugLogger"/>
- <classEntry path="org.zengrong.logging.Logger"/>
- <classEntry path="org.zengrong.logging.targets.FirebugTarget"/>
- <classEntry path="org.zengrong.logging.targets.LCDebugTarget"/>
- <classEntry path="org.zengrong.net.SoundLoader"/>
- <classEntry path="org.zengrong.media.cm.CM"/>
- <classEntry path="org.zengrong.media.cm.CMEvent"/>
- <classEntry path="org.zengrong.rpc.FaultEvent"/>
- <classEntry path="org.zengrong.rpc.Operation"/>
- <classEntry path="org.zengrong.rpc.OperationPool"/>
- <classEntry path="org.zengrong.rpc.Remoting"/>
- <classEntry path="org.zengrong.rpc.ResultEvent"/>
- <classEntry path="org.zengrong.rpc.ServiceProxy"/>
- <classEntry path="org.zengrong.flex.utils.Dialog"/>
- <classEntry path="org.zengrong.flex.utils.JS"/>
- <classEntry path="org.zengrong.utils.TimeUtil"/>
- <classEntry path="org.zengrong.flex.controls.ImageButton"/>
- <classEntry path="org.zengrong.display.BMPSlicer"/>
- <classEntry path="org.zengrong.utils.MathUtil"/>
- <classEntry path="org.zengrong.display.BMPText"/>
- <classEntry path="org.zengrong.net.Packet"/>
- <classEntry path="org.zengrong.utils.ColorMatrix"/>
- <classEntry path="org.zengrong.controls.CDImageButton"/>
- <classEntry path="org.zengrong.display.Tooltip"/>
- <classEntry path="org.zengrong.utils.StringUtil"/>
- <classEntry path="org.zengrong.controls.ClassButton"/>
- <classEntry path="org.zengrong.utils.Chessboard"/>
- <classEntry path="org.zengrong.utils.ObjectUtil"/>
- <classEntry path="org.zengrong.utils.Vec2D"/>
- <classEntry path="org.zengrong.text.FTEFactory"/>
- <classEntry path="org.zengrong.utils.SOUtil"/>
- <classEntry path="org.zengrong.display.spritesheet.SpriteSheetType"/>
- <classEntry path="org.zengrong.display.spritesheet.SpriteSheetMetadata"/>
- <classEntry path="org.zengrong.display.spritesheet.BMPSprite"/>
- <classEntry path="org.zengrong.display.spritesheet.BMPMovieClip"/>
- <classEntry path="org.zengrong.display.spritesheet.MaskType"/>
- </includeClasses>
- <includeResources/>
- <namespaceManifests/>
-</flexLibProperties>
View
@@ -1,2 +1,3 @@
-/bin/
-.settings/
+bin/
+*.as3proj
+*.bat
View
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>zrong_as3code</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.adobe.flexbuilder.project.flexbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.adobe.flexbuilder.project.flexlibnature</nature>
- <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
- </natures>
-</projectDescription>
@@ -1,6 +0,0 @@
-#Thu Feb 25 00:29:52 CST 2010
-DELEGATES_PREFERENCE=delegateValidatorList
-USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.html.internal.validation.HTMLValidator\:org.eclipse.php.core.phpsource;
-USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.html.internal.validation.HTMLValidator\:org.eclipse.php.core.phpsource;
-USER_PREFERENCE=overrideGlobalPreferencesfalse
-eclipse.preferences.version=1
View
@@ -0,0 +1,17 @@
+PROJECT_NAME=zrongas3
+
+# The project can have multiple main class file.
+MAIN_NAME=zrongas3
+
+FLEX_HOME=D:/flashsdks/flex4.6.0
+FLEX_FRAMEWORKS=${FLEX_HOME}/frameworks
+
+# SRC - mxml and as files
+# BIN - output files
+# LIB - swc files
+SRC_DIR=${basedir}/src
+BIN_DIR=${basedir}/bin
+LIB_DIR=${basedir}/lib
+
+# Your application ID (must match <id> of Application descriptor)
+APP_ID=zrongas3
View
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Compile Debug and Package the AIR Flex 4 Project -->
+<!-- Author : zrong -->
+<!-- Blog: zengrong.net -->
+<!-- E-mail : zrongzrong@gmail.com -->
+<!-- Creation : 2012-10-29 -->
+<!-- Modification : 2013-06-13 -->
+<project name="swcGenerator" default="packswc">
+ <property file="build.properties" />
+ <property name="swf.name" value="${MAIN_NAME}.swc"/>
+ <property name="swf.file" value="${BIN_DIR}/${swf.name}"/>
+ <echo>swf.file:${swf.file}</echo>
+ <echo>swf.name:${swf.name}</echo>
+ <echo>FLEX_HOME:${FLEX_HOME}</echo>
+
+ <target name="clearswc">
+ <delete file="${swf.file}"/>
+ </target>
+
+ <target name="packswc" depends="clearswc" description="Build SWC library">
+ <condition property="var.debug" value="${var.debug}" else="false">
+ <isset property="var.debug" />
+ </condition>
+ <condition property="var.optimize" value="${var.optimize}" else="true">
+ <isset property="var.optimize" />
+ </condition>
+ <condition property="var.swfversion" value="${var.swfversion}" else="14">
+ <isset property="var.swfversion" />
+ </condition>
+ <fileset dir="${SRC_DIR}" casesensitive="yes" id="classfiles">
+ <include name="**/*.as"/>
+ </fileset>
+ <pathconvert property="classlist" refid="classfiles" pathsep=" " dirsep=".">
+ <regexpmapper from=".*src.(.*)\.as" to="\1"/>
+ </pathconvert>
+ <echo>Base dir:${basedir}</echo>
+ <echo>Building swf file ${swf.file}...</echo>
+ <echo>debug:${var.debug} optimize:${var.optimize} swfversion:${var.swfversion}</echo>
+ <java jar="${FLEX_HOME}/lib/compc.jar" fork="true" failonerror="true" dir="${FLEX_FRAMEWORKS}">
+ <arg line='-source-path ${SRC_DIR}'/>
+ <arg line='-include-classes ${classlist}'/>
+ <arg line='-output ${swf.file}'/>
+ <arg line='-swf-version ${var.swfversion}'/>
+ <arg value="-library-path+=${LIB_DIR}"/>
+ <arg value="-load-config+=air-config.xml"/>
+ <arg line='-external-library-path+="${FLEX_FRAMEWORKS}/libs/framework.swc"'/>
+ <arg line='-external-library-path+="${FLEX_FRAMEWORKS}/libs/spark.swc"'/>
+ <arg line='-external-library-path+="${FLEX_FRAMEWORKS}/libs/mx/mx.swc"'/>
+ <arg line='-external-library-path+="${FLEX_FRAMEWORKS}/libs/air/airglobal.swc"'/>
+ <arg value="-debug=${var.debug}"/>
+ <arg value="-optimize=${var.optimize}"/>
+ <arg value="-compress=true" />
+ <arg value="-strict=false" />
+ <arg value="-mobile=false" />
+ </java>
+ </target>
+</project>
@@ -30,7 +30,7 @@ package gnu.as3.gettext
* matches the keys of the string.
* @return The formatted string.
*/
- public function sprintf(string:String, values:* = undefined):String
+ public function sprintf(string:String, values:* = null):String
{
regexpValues = values;
var stringOut:String = string.replace(tokenPattern, repFunc);
@@ -117,26 +117,26 @@ public interface ISpriteSheetMetadata
*/
function set originalFrameRects($value:Vector.<Rectangle>):void;
- /**
- * Sheet的帧数
- */
+ /**
+ * Sheet的帧数
+ */
function get totalFrame():int;
- /**
- * 返回自身的副本(深复制)
- */
+ /**
+ * 返回自身的副本(深复制)
+ */
function clone():ISpriteSheetMetadata;
- /**
+ /**
* 根据设置的属性初始化一些值
- *
- * @param $force 是否强制初始化。值为true则不判断原来是否存在该变量,强行覆盖
- */
- function setup($force:Boolean=false):void;
-
- /**
- * 销毁整个对象
- */
+ *
+ * @param $force 是否强制初始化。值为true则不判断原来是否存在该变量,强行覆盖
+ */
+ function setup($force:Boolean=false):void;
+
+ /**
+ * 销毁整个对象
+ */
function destroy():void;
/**
@@ -147,9 +147,9 @@ public interface ISpriteSheetMetadata
/**
* 将自身数据对象化
*
- * @param $isSimple 是否简单数据
+ * @param $isSimple 是否简单数据
* @param $includeName 是否包含name
- * @return 返回的可能是任何类型的数据
+ * @return 返回的可能是任何类型的数据
*/
function objectify($isSimple:Boolean=false, $includeName:Boolean=true):*;
@@ -160,35 +160,41 @@ public interface ISpriteSheetMetadata
*/
function addLabel($labelName:String, $labelFrame:Array):void;
- /**
+ /**
* 设置Label的属性
- *
- * @param $hasLabel 是否使用了Label
- * @param $labels Label的对象,每个键名为label名称,每个键值是数组,保存帧的索引号,格式为:[1,2,3]
- */
+ *
+ * @param $hasLabel 是否使用了Label
+ * @param $labels Label的对象,每个键名为label名称,每个键值是数组,保存帧的索引号,格式为:[1,2,3]
+ */
function setLabels($hasLabel:Boolean, $labels:Object=null):void;
-
- /**
- * 从外部向数组中添加帧的尺寸,一般在循环中执行
- */
+
+ /**
+ * 从外部向数组中添加帧的尺寸,一般在循环中执行
+ */
function addFrame($sizeRect:Rectangle, $originalRect:Rectangle=null, $name:String=null):void;
/**
* 从外部向数组中添加帧的尺寸,指定帧索引
- */
+ */
function addFrameAt($index:int, $sizeRect:Rectangle, $originalRect:Rectangle=null, $name:String=null):void;
/**
* 从指定的索引移除帧
- */
+ */
function removeFrameAt($index:int):void;
- /**
+ /**
* 返回帧索引对应的帧名称。如果选择了不保存名称,或者没有名称,或者该帧没有对应名称,就返回null
- *
- * @param $includeName 是否包含名称
- * @param $index 帧索引
- */
- function getFrameName($includeName:Boolean, $index:int):String;
+ *
+ * @param $includeName 是否包含名称
+ * @param $index 帧索引
+ */
+ function getFrameName($includeName:Boolean, $index:int):String;
+
+ /**
+ * 直接调用objectify方法,传递的参数均为true
+ * @return
+ */
+ function toString():String;
}
}
@@ -162,13 +162,13 @@ public class SpriteSheetMetadataWrapper implements ISpriteSheetMetadata
_metadata.removeFrameAt($index);
}
- /**
- * @inheritDoc
- */
- public function getFrameName($includeName:Boolean, $index:int):String
+ /**
+ * @inheritDoc
+ */
+ public function getFrameName($includeName:Boolean, $index:int):String
{
return _metadata.getFrameName($includeName, $index);
- }
+ }
/**
* @inheritDoc
@@ -186,5 +186,9 @@ public class SpriteSheetMetadataWrapper implements ISpriteSheetMetadata
return null;
}
+ public function toString():String
+ {
+ return String(objectify(true, true));
+ }
}
}
Oops, something went wrong.

0 comments on commit 5154509

Please sign in to comment.