XFL是新的无压缩ADOBE FLASH(CS5)源文件,它由XML定义组成,其中大部分都是清晰但不幸的是,重要的是奇怪的.
展望各种现有资源,我可以看到shape的EDGE定义如下:
<Edge strokeStyle="1" edges="!0 0S4|180 0"/>
<Edge strokeStyle="1" edges="!2720 2720S6|0 2720!0 2720|0 0!0 0/2720 2720"/>
<Edge fillStyle1="1" edges="!3532 1539.5S2[#BD9.4D #577.3C 2952.5 1756.5!2952.5 1756.5[#AF6.DA #4C6.1D 3584 1119!3584 1119|3532 1539.5"/>
Run Code Online (Sandbox Code Playgroud)
做一些测试我可以说:
! == move to position
| == draw line from the position to the new position
/ == probably same like |
[ == draw curve
( == probably same like [
Run Code Online (Sandbox Code Playgroud)
但是什么意味着像S4或#BD9.4D这样的价值?我还没有证明,#值可以以某种方式编码非常小的数字.我不知道什么是S4.
有没有一种常用的方法将Flash Professional中绘制的矢量图形转换为Drawing API的代码?
这些绘制或导入的矢量图形资源的代码在源文件(.xfl)中作为XML数据提供.例如,以下绘制的矢量图形是尾随的XML数据.

<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="MSprite" itemID="4e03ae4f-00002c0f" linkageExportForAS="true" linkageBaseClass="flash.display.Sprite" linkageClassName="MSprite" sourceLibraryItemHRef="Symbol 1" lastModified="1308864079" isSpriteSubclass="true">
<timeline>
<DOMTimeline name="MSprite">
<layers>
<DOMLayer name="Layer 1" color="#4FFF4F" current="true" isSelected="true">
<frames>
<DOMFrame index="0" keyMode="9728">
<elements>
<DOMShape>
<fills>
<FillStyle index="1">
<SolidColor color="#00CCFF"/>
</FillStyle>
</fills>
<strokes>
<StrokeStyle index="1">
<SolidStroke scaleMode="normal">
<fill>
<SolidColor/>
</fill>
</SolidStroke>
</StrokeStyle>
</strokes>
<edges>
<Edge fillStyle0="1" strokeStyle="1" edges="!6883 745S5[6369 340 5741 148!5741 148[5534 85 5314 78!5314 78[4037 36 2754 2!2754 2[1956 -18 1222 211!1222 211[693 376 393 745!393 745[139 1056 48 1512!48 1512[-130 …Run Code Online (Sandbox Code Playgroud)