diff --git a/.gitignore b/.gitignore index fd70c71..343ecaf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,10 @@ +airsdk +flex exporter/src/test/export +exporter/buildWithAnt.bat +exporter/debugWithAdl.bat +exporter/dist +exporter/flump-exporter.as3proj +runtime/dist +runtime/buildWithAnt.bat +runtime/Flump-runtime.as3proj \ No newline at end of file diff --git a/exporter/src/main/as/flump/export/texturepacker/MaxRectPackerImpl.as b/exporter/src/main/as/flump/export/texturepacker/MaxRectPackerImpl.as index f4942b4..5c34acb 100644 --- a/exporter/src/main/as/flump/export/texturepacker/MaxRectPackerImpl.as +++ b/exporter/src/main/as/flump/export/texturepacker/MaxRectPackerImpl.as @@ -158,7 +158,7 @@ public class MaxRectPackerImpl { [Inline] final protected function isContainedIn(a:Rectangle, b:Rectangle):Boolean { - return a.x >= b.x && a.y >= b.y && a.x + a.width <= b.x + b.width && a.y + a.height <= b.y + b.height; + return a.x >= b.x && a.y >= b.y && a.x + a.width <= b.x + b.width && a.y + a.height <= b.y + b.height; } diff --git a/exporter/src/main/as/flump/xfl/XflInstance.as b/exporter/src/main/as/flump/xfl/XflInstance.as index 2b30b4e..4a53459 100644 --- a/exporter/src/main/as/flump/xfl/XflInstance.as +++ b/exporter/src/main/as/flump/xfl/XflInstance.as @@ -10,6 +10,8 @@ public class XflInstance public static const LIBRARY_ITEM_NAME :String = "libraryItemName"; public static const IS_VISIBLE :String = "isVisible"; public static const ALPHA :String = "alphaMultiplier"; + public static const TINT_MULTIPLIER :String = "tintMultiplier"; + public static const TINT :String = "tintColor"; public static function getColorXml (instanceXml :XML) :XML { return (instanceXml.color != null ? instanceXml.color.Color[0] : null); diff --git a/exporter/src/main/as/flump/xfl/XflKeyframe.as b/exporter/src/main/as/flump/xfl/XflKeyframe.as index aea1c8b..614949b 100644 --- a/exporter/src/main/as/flump/xfl/XflKeyframe.as +++ b/exporter/src/main/as/flump/xfl/XflKeyframe.as @@ -120,6 +120,7 @@ public class XflKeyframe const colorXml :XML = XflInstance.getColorXml(instanceXml); if (colorXml != null) { kf.alpha = XmlUtil.getNumberAttr(colorXml, XflInstance.ALPHA, 1); + if (XmlUtil.hasAttr(colorXml,XflInstance.TINT_MULTIPLIER)) kf.tint = [XmlUtil.getNumberAttr(colorXml, XflInstance.TINT_MULTIPLIER, 1), XmlUtil.hasAttr(colorXml,XflInstance.TINT) ? XmlUtil.getStringAttr(colorXml, XflInstance.TINT): "#000000"]; } return kf; } diff --git a/runtime/src/main/as/flump/mold/KeyframeMold.as b/runtime/src/main/as/flump/mold/KeyframeMold.as index 4bb9ddc..7eb70ad 100644 --- a/runtime/src/main/as/flump/mold/KeyframeMold.as +++ b/runtime/src/main/as/flump/mold/KeyframeMold.as @@ -31,6 +31,8 @@ public class KeyframeMold public var pivotX :Number = 0.0, pivotY :Number = 0.0; public var alpha :Number = 1; + + public var tint :Array; public var visible :Boolean = true; @@ -50,6 +52,7 @@ public class KeyframeMold extractFields(o, mold, "skew", "skewX", "skewY"); extractFields(o, mold, "pivot", "pivotX", "pivotY"); extractField(o, mold, "alpha"); + extractField(o, mold, "tint"); extractField(o, mold, "visible"); extractField(o, mold, "ease"); extractField(o, mold, "tweened"); @@ -80,6 +83,7 @@ public class KeyframeMold if (skewX != 0 || skewY != 0) json.skew = [round(skewX), round(skewY)]; if (pivotX != 0 || pivotY != 0) json.pivot = [round(pivotX), round(pivotY)]; if (alpha != 1) json.alpha = round(alpha); + if (tint != null) json.tint = tint; if (!visible) json.visible = visible; if (!tweened) json.tweened = tweened; if (ease != 0) json.ease = round(ease); @@ -97,6 +101,7 @@ public class KeyframeMold if (skewX != 0 || skewY != 0) xml.@skew = "" + round(skewX) + "," + round(skewY); if (pivotX != 0 || pivotY != 0) xml.@pivot = "" + round(pivotX) + "," + round(pivotY); if (alpha != 1) xml.@alpha = round(alpha); + if (tint !=null) xml.@tint = "" + tint[0] + "," + tint[1]; if (!visible) xml.@visible = visible; if (!tweened) xml.@tweened = tweened; if (ease != 0) xml.@ease = round(ease);