├── .gitignore
├── DragonBonesDesignPanel.zxp
├── DragonBonesDesignPanelLib
├── libs
│ ├── DBGATracker.swc
│ ├── DragonBonesLightSDK.swc
│ ├── Swiftsuspenders-v2.1.0.swc
│ ├── TweenMax.swc
│ ├── boneSymbol.swc
│ ├── modifySWF.swc
│ ├── robotlegs-framework-v2.2.1.swc
│ └── zip.swc
├── locale
│ ├── en_US
│ │ └── resources.properties
│ ├── fr_FR
│ │ └── resources.properties
│ ├── ja_JP
│ │ └── resources.properties
│ └── zh_CN
│ │ └── resources.properties
└── src
│ ├── assets
│ ├── armature_icon.png
│ ├── armature_open_icon.png
│ ├── bone_icon.png
│ ├── button
│ │ ├── about.png
│ │ ├── connect.png
│ │ ├── demo.png
│ │ ├── disconnect.png
│ │ ├── effecthub.png
│ │ ├── export.png
│ │ ├── help.png
│ │ ├── home.png
│ │ ├── import.png
│ │ ├── open.png
│ │ ├── pause.png
│ │ ├── play.png
│ │ ├── playnext.png
│ │ ├── playprevious.png
│ │ ├── remove.png
│ │ ├── settings.png
│ │ └── update.png
│ ├── mouse_scroll.png
│ ├── mouse_scrollDrag.png
│ └── others
│ │ ├── logo.png
│ │ └── title.png
│ ├── com
│ └── adobe
│ │ └── serialization
│ │ └── json
│ │ ├── JSON.as
│ │ ├── JSONDecoder.as
│ │ ├── JSONEncoder.as
│ │ ├── JSONParseError.as
│ │ ├── JSONToken.as
│ │ ├── JSONTokenType.as
│ │ └── JSONTokenizer.as
│ └── core
│ ├── AssetManager.as
│ ├── SettingManager.as
│ ├── ShareBundle.as
│ ├── ShareConfig.as
│ ├── controller
│ ├── ControlCommand.as
│ ├── CreateAnimationToFlashCommand.as
│ ├── ExportFileCommand.as
│ ├── ImportFLACommand.as
│ ├── ImportFileCommand.as
│ ├── ModelCommand.as
│ ├── MultipleImportAndExportCommand.as
│ ├── RemoveArmatureCommand.as
│ ├── SettingStartupCommand.as
│ └── ViewCommand.as
│ ├── events
│ ├── ControllerEvent.as
│ ├── MediatorEvent.as
│ ├── ModelEvent.as
│ ├── ServiceEvent.as
│ └── ViewEvent.as
│ ├── mediator
│ ├── AnimationControlViewMediator.as
│ ├── ArmaturesPanelMediator.as
│ └── BoneControlViewMediator.as
│ ├── model
│ ├── ImportModel.as
│ ├── ParsedModel.as
│ └── vo
│ │ ├── ExportVO.as
│ │ ├── ImportVO.as
│ │ └── ParsedVO.as
│ ├── service
│ ├── ImportDataToExportDataService.as
│ ├── ImportFLAService.as
│ ├── ImportFileService.as
│ ├── JSFLService.as
│ └── LoadTextureAtlasBytesService.as
│ ├── suppotClass
│ ├── _BaseCommand.as
│ ├── _BaseMediator.as
│ ├── _BaseModel.as
│ └── _BaseService.as
│ ├── utils
│ ├── BitmapDataUtil.as
│ ├── DataFormatUtils.as
│ ├── DataUtils.as
│ ├── GlobalConstValues.as
│ ├── OptimizeDataUtils.as
│ ├── PNGEncoder.as
│ ├── TextureUtil.as
│ ├── checkBytesTailisXML.as
│ ├── decompressData.as
│ ├── formatDataToCurrentVersion.as
│ ├── formatSpineData.as
│ ├── getPointTarget.as
│ └── objectToXML.as
│ └── view
│ ├── AnimationControlView.mxml
│ ├── ArmatureSymbols.as
│ ├── ArmatureView.mxml
│ ├── ArmaturesPanel.mxml
│ ├── BoneControlView.mxml
│ ├── components
│ ├── DragTree.mxml
│ └── PlayButton.mxml
│ └── skin
│ ├── BottomBarButtonSkin.mxml
│ ├── BottomContextMenuButtonSkin.mxml
│ ├── HighlightIconButtonSkin.mxml
│ └── IconButtonSkin.mxml
├── DragonBonesDesignPanelPlugin
├── build
│ ├── DragonBonesDesignPanel.mxi
│ └── DragonBonesDesignPanel
│ │ ├── createAnimation.jsfl
│ │ ├── dragonBones.jsfl
│ │ ├── events.jsfl
│ │ ├── import3DTextures.jsfl
│ │ └── utils.jsfl
├── libs
│ ├── DBGATracker.swc
│ └── DragonBonesCloud.swc
└── src
│ ├── DragonBonesDesignPanel.mxml
│ └── plugin
│ ├── PluginConfig.as
│ └── view
│ ├── AboutWindow.mxml
│ ├── BaseWindow.mxml
│ ├── ExportWindow.mxml
│ ├── ImportWindow.mxml
│ ├── TextureAtlasWindow.mxml
│ └── XMLWindow.mxml
├── LICENSE
├── README.md
└── docs
├── DB4.0数据格式前瞻.pdf
├── Design Panel 3.0.0 Release Notes.md
├── Design Panel 3.0.1 Release Notes.md
├── DragonBonesDataFormatSpec_V3.0_cn.xml
├── DragonBonesDataFormatSpec_V3.0_en.xml
└── Install DesignPanel Directly.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build and Release Folders
2 | bin/
3 | bin-debug/
4 | bin-release/
5 | html-template/
6 | *.swf
7 |
8 | # Other files and folders
9 | .settings/
10 |
11 | # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
12 | .project
13 | .actionScriptProperties
14 | .flexProperties
15 | .flexLibProperties
16 |
17 | # should NOT be excluded as they contain compiler settings and other important
18 | # information for Eclipse / Flash Builder.
19 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanel.zxp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanel.zxp
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/DBGATracker.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/DBGATracker.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/DragonBonesLightSDK.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/DragonBonesLightSDK.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/Swiftsuspenders-v2.1.0.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/Swiftsuspenders-v2.1.0.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/TweenMax.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/TweenMax.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/boneSymbol.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/boneSymbol.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/modifySWF.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/modifySWF.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/robotlegs-framework-v2.2.1.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/robotlegs-framework-v2.2.1.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/libs/zip.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/libs/zip.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/locale/en_US/resources.properties:
--------------------------------------------------------------------------------
1 | editor=Editor
2 | xml=XML
3 | copyBehaviors=Copy Behaviors
4 | textureAtlas=Texture Atlas
5 | help=Help
6 | onlineHelp=Online Help
7 | contactUs=Contact Us
8 | about=About
9 | helpUs=Help Us
10 | skeleton=Skeleton:
11 | behaviorList=Behavior List
12 | boneTree=Bone Tree
13 | textureList=Texture List
14 | boneHighlight=Bone Highlight
15 | import=Import
16 | export=Export
17 | bone=Bone
18 | behavior=Behavior
19 | source=Source
20 | target=Target
21 | frameRate=Frame Rate:
22 | behaviorPanelTitle=Behavior -
23 | totalTimeSec=Total Time(sec):
24 | totalTimeScale=Total Time Scale(%):
25 | blendingTime=Blending Time(sec):
26 | keyFrameEase=Keyframe Ease:
27 | loop=Play Times:
28 | autotween=Auto Tween
29 | play=Play
30 | stop=Stop
31 | bonePanelTitle=Bone -
32 | totalFramesScale=Total Frames Scale(%):
33 | playDelay=Play Delay(%):
34 | importLabel=Import:
35 | textureSetting=Texture Setting
36 | layoutAlgorithm=Layout Algorithm:
37 | size=Texture Atlas Size:
38 | autoSize=AutoSize
39 | padding=Texture Padding:
40 | exportLabel=Export:
41 | allLibraryItems=All Library Items
42 | selectedItems=Selected Items
43 | exportedData=Exported Data(SWF/PNG/Zip)
44 | spineData=Spine Data(Zip)
45 |
46 | swf=SWF (Data Merged)
47 | png=PNG (Data Merged)
48 | swf+xml=Zip (XML + SWF)
49 | png+xml=Zip (XML + PNG)
50 | pngs+xml=Zip (XML + PNGs)
51 | swf+json=Zip (JSON + SWF)
52 | png+json=Zip (JSON + PNG)
53 | pngs+json=Zip (JSON + PNGs)
54 |
55 | dataMerged=Data Merged
56 | dataAmf3=AMF(Binary)
57 | dataXml=XML
58 | dataJson=JSON(Support Egret Engine)
59 | textureSwf=DBSWF(Vector)
60 | texturePng=PNG
61 | texturePngs=PNGS
62 | dataTypeAbsolute=Global
63 | dataTypeRelative=Parent
64 | compressData=Compress Data
65 | dataTypeAbsoluteToolTip=Using global coordinate, perfect compatible with older version libraries, but file size will be bigger.
66 | dataTypeAbsoluteDisableToolTip=Because the Imported data is based on parent coordinate. It cannot be exported to global coordinate.
67 | dataTypeRelativeToolTip=Using parent coordinate, the exported data file can be further compressed, but it will not be older version libraries compatible and its skeleton hierarchy will not be editable after opened by DesignPanel.
68 | compressDataToolTip=Enable compress data can great reduce exported data file size, but the exported data file will not be older version libraries compatible.
69 |
70 | exportscale=Export Scale
71 | backgroundColor=Background Color
72 | advanceOption=Advanced Options
73 | ok=OK
74 | save=Save
75 | cancel=Cancel
76 |
77 | batchProcess=BatchProcess
78 | importFolder=ImportFolder:
79 | exportFolder=ExportFolder:
80 | browse=Browse
81 | importFileTypeSelection=ImportFileType:
82 | fadeInTime=FadeInTime:
83 | millisecond=ms
84 | pixel=px
85 |
86 | dataFormat=Data Format:
87 | textureFormat=Texture Format:
88 | dataType=Data Coordinate:
89 | startBatchProcess=StartBatchProcess
90 | textureAtlasPath=Texture Atlas Path:
91 | skeletonDataFileName=Skeleton Data File Name:
92 | textureDataFileName=Texture Data File Name:
93 | textureFileName=Texture File Name:
94 | subTextureFolderName=Textures' Folder Name:
95 | skeletonDataName=Skeleton Data Name:
96 | advanced=Advanced
97 | source=Source:
98 | animation=Animation
99 | texture=Texture
100 |
101 | importFLAWaitting=Importing...\rPlease wait until importing finished.
102 | importNoElement=Cannot find any skeleton item in the library of Fla {0}!
103 | importSkeletonProgress=Import Skeleton: {0} / {1}
104 | importTextureProgress=Import Texture: {0} / {1}
105 | saveAnimation=Saving...\rPlease wait until Saving finished.
106 | saveAnimationProgress=Save Animation: {0} / {1}
107 | importFileWaitting=Importing...
108 | importFileError=Import failed!\rUnknown data format error!
109 | importFileProgress=Import Progress: {0} %
110 | exportWaitting=Exporting...\rPlease wait until exporting finished.
111 | exportError=Export failed!\rUnknown error on data writing!
112 | contactUsBy=Contact us by {0}
113 | copyright=Copyright 2012-2013 The DragonBones team and other contributors.
114 |
115 | menu_file=File
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/locale/fr_FR/resources.properties:
--------------------------------------------------------------------------------
1 | editor=Editeur
2 | xml=XML
3 | copyBehaviors=Copie de comportements
4 | textureAtlas=Atlas des textures
5 | help=Aide
6 | onlineHelp=L'aide en ligne
7 | contactUs=Contactez-nous
8 | about=A propos de
9 | helpUs=aidez nous
10 | skeleton=Squelettes:
11 | behaviorList=Liste de comportements
12 | boneTree=Arborescence d’os
13 | textureList=Liste de textures
14 | boneHighlight=Os surligné
15 | import=Importer
16 | export=Exporter
17 | bone=Os
18 | behavior=Comportement
19 | source=Source
20 | target=Cible
21 | frameRate=Fréquence d’images:
22 | behaviorPanelTitle=Comportement -
23 | totalTimeSec=Durées totales(sec):
24 | totalTimeScale=Durées totales échelle(%):
25 | blendingTime=Les temps de mélange(sec):
26 | keyFrameEase=Accélération image-clé:
27 | loop=Jouez fois:
28 | autotween=Automatique Tween
29 | play=Lire
30 | stop=Arrêt
31 | bonePanelTitle=Os -
32 | totalFramesScale=images totale échelle(%):
33 | playDelay=Temporisation de lecture(%):
34 | importLabel=Importer:
35 | textureSetting=Paramétrage de la texture
36 | layoutAlgorithm=Algorithme de layout:
37 | size=Texture Atlas Taille :
38 | autoSize=Taille automatique
39 | padding=Texture Remplissage:
40 | exportLabel=Exporter:
41 | allLibraryItems=Tous éléments de la bibliothèque
42 | selectedItems=Eléments sélectionnés
43 | exportedData=Données exportées(SWF/PNG/Zip)
44 | spineData=Données Spine(Zip)
45 |
46 | swf=SWF (Data fusionné)
47 | png=PNG (Data fusionné)
48 | swf+xml=Zip (XML + SWF)
49 | png+xml=Zip (XML + PNG)
50 | pngs+xml=Zip (XML + PNGs)
51 | swf+json=Zip (JSON + SWF)
52 | png+json=Zip (JSON + PNG)
53 | pngs+json=Zip (JSON + PNGs)
54 |
55 | dataMerged=Data Fusionné
56 | dataAmf3=AMF(Binaire)
57 | dataXml=XML
58 | dataJson=JSON(Soutenir Egret Moteur)
59 | textureSwf=DBSWF(Vecteur)
60 | texturePng=PNG
61 | texturePngs=PNGS
62 | dataTypeAbsolute=Mondial
63 | dataTypeRelative=Mère
64 | compressData=Comprimé Data
65 | dataTypeAbsoluteToolTip=L'utilisation globale de coordonnées, parfaitement compatible avec l'ancienne version de la bibliothèque, mais la taille du fichier sera encore plus grand.
66 | dataTypeAbsoluteDisableToolTip=En raison de l'importation de données sur la base de coordonnées de l'objet parent.Il ne peut pas être exportés vers les coordonnées mondial.
67 | dataTypeRelativeToolTip=L'utilisation de coordonnées de l'objet parent, le document d'exportation de données peut en outre être comprimé, mais n'est pas compatible avec la base de l'ancienne version, le squelette de la hiérarchie ne sera pas ouvert designpanel après l'édition.
68 | compressDataToolTip=De sorte que la compression des données, on peut considérablement réduire la taille du fichier de données d'exportation, mais le fichier de données d'exportation ne sera pas compatible avec une ancienne version de la bibliothèque.
69 |
70 | exportscale=exporter échelle
71 | backgroundColor=Couleur de fond
72 | advanceOption=Options avancées
73 | ok=OK
74 | save=Sauver
75 | cancel=Annuler
76 |
77 | batchProcess=BatchProcess
78 | importFolder=ImportFolder:
79 | exportFolder=ExportFolder:
80 | browse=Browse
81 | importFileTypeSelection=ImportFileType:
82 | fadeInTime=FadeInTime:
83 | millisecond=ms
84 | pixel=px
85 |
86 | dataFormat=Data Format:
87 | textureFormat=Texture Format:
88 | dataType=Data Coordonnées:
89 | startBatchProcess=StartBatchProcess
90 | textureAtlasPath=Texture Atlas Chemin:
91 | skeletonDataFileName=Skeleton données Nom de fichier:
92 | textureDataFileName=Texture fichier de données Nom:
93 | textureFileName=Texture Nom du fichier:
94 | subTextureFolderName=Dossier Nom de textures:
95 | skeletonDataName=Nom données Skeleton:
96 |
97 | advanced=Advanced
98 | source=Source:
99 | animation=Animation
100 | texture=Texture
101 |
102 | importFLAWaitting=Importation en cours...\rPatientez jusqu’à ce que l’importation soit terminée.
103 | importNoElement=Impossible de trouver un squelette dans la bibliothèque de Fla {0}.
104 | importSkeletonProgress=Importer le squelette : {0} / {1}
105 | importTextureProgress=Importer la texture : {0} / {1}
106 | importFileWaitting=Importation en cours...
107 | importFileError=Echec de l’importation.\rErreur de format de données inconnue.
108 | importFileProgress=Progression de l’importation : {0} %
109 | exportWaitting=Exportation en cours...\rPatientez jusqu’à ce que l’exportation soit terminée.
110 | exportError=Echec de l’exportation.\rErreur inconnue lors de l’écriture des données.
111 | contactUsBy=Contactez-nous par {0}
112 | copyright=Copyright 2012-2013 L’équipe DragonBones et autres contributeurs.
113 |
114 | menu_file=File
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/locale/ja_JP/resources.properties:
--------------------------------------------------------------------------------
1 | editor=エディター
2 | xml=XML
3 | copyBehaviors=コピー機能
4 | textureAtlas=テクスチャアトラス
5 | help=ヘルプ
6 | onlineHelp=オンラインヘルプ
7 | contactUs=お問い合わせ
8 | about=DragonBonesについて
9 | helpUs=HELP US!
10 | skeleton=スケルトン:
11 | behaviorList=モーション一覧
12 | boneTree=ボーンツリー
13 | textureList=テクスチャリスト
14 | boneHighlight=ボーンハイライト色
15 | import=読み込み
16 | export=書き出し
17 | bone=ボーン
18 | behavior=モーション
19 | source=コピー元
20 | target=コピー先
21 | frameRate=フレームレート:
22 | behaviorPanelTitle=モーション -
23 | totalTimeSec=合計時間(秒):
24 | totalTimeScale=合計時間の倍率(%):
25 | blendingTime=混合時間(秒):
26 | keyFrameEase=キーフレームのイージング:
27 | loop=再生回数:
28 | autotween=自動トゥイーン
29 | play=再生
30 | stop=停止
31 | bonePanelTitle=ボーン -
32 | totalFramesScale=合計フレーム長の倍率(%):
33 | playDelay=再生ディレイ(%):
34 | importLabel=読み込み:
35 | textureSetting=テクスチャ設定
36 | layoutAlgorithm=レイアウトアルゴリズム:
37 | size=テクスチャアトラスサイズ:
38 | autoSize=自動サイズ設定
39 | padding=テクスチャパディング:
40 | exportLabel=書き出し:
41 | allLibraryItems=全てのライブラリアイテム
42 | selectedItems=選択したライブラリアイテム
43 | exportedData=書き出し済みファイル(SWF/PNG/Zip)
44 | spineData=Spineデータ(Zip)
45 |
46 | swf=SWF(データを含む)
47 | png=PNG(データを含む)
48 | swf+xml=Zip(XML + SWF)
49 | png+xml=Zip(XML + PNG)
50 | pngs+xml=Zip(XML + 複数PNG)
51 | swf+json=Zip(JSON + SWF)
52 | png+json=Zip(JSON + PNG)
53 | pngs+json=Zip(JSON + 複数PNG)
54 |
55 | dataMerged=統合データ
56 | dataAmf3=AMF(バイナリー)
57 | dataXml=XML
58 | dataJson=JSON(支持Egretエンジン)
59 | textureSwf=DBSWF(ベクトル)
60 | texturePng=PNG
61 | texturePngs=PNGS
62 | dataTypeAbsolute=世界の
63 | dataTypeRelative=父の
64 | compressData=圧縮データ
65 | dataTypeAbsoluteToolTip=世界の座標のデータが完璧に互換ボス本の倉庫、しかしデータファイルサイズが大きい。
66 | dataTypeAbsoluteDisableToolTip=導入に父からの座標係のデータに基づいて、ないからエクスポートを世界の座標係のデータ.
67 | dataTypeRelativeToolTip=父の座標のデータが最大限の圧縮データサイズで、でもそれは上司と本のライブラリには対応していない、そしてエクスポートしたデータを支持しないでDesignPanelで再び改正骨格関係。
68 | compressDataToolTip=開くデータ圧縮できる最大限の圧縮データサイズがターンの古いバージョンのライブラリには対応していない。
69 |
70 | exportscale=書き出しの倍率
71 | backgroundColor=背景色
72 | advanceOption=高級オプション
73 | ok=OK
74 | save=保存
75 | cancel=キャンセル
76 |
77 | batchProcess=BatchProcess
78 | importFolder=ImportFolder:
79 | exportFolder=ExportFolder:
80 | browse=Browse
81 | importFileTypeSelection=ImportFileType:
82 | fadeInTime=FadeInTime:
83 | millisecond=ms
84 | pixel=px
85 |
86 | dataFormat=データフォーマット:
87 | textureFormat=テクスチャフォーマット:
88 | dataType=データ座標係:
89 | startBatchProcess=StartBatchProcess
90 | textureAtlasPath=テクスチャアトラスのパス:
91 | skeletonDataFileName=スケルトンデータファイル名:
92 | textureDataFileName=テクスチャデータのファイル名:
93 | textureFileName=テクスチャファイル名:
94 | subTextureFolderName=テクスチャ「フォルダ名:
95 | skeletonDataName=スケルトンデータ名:
96 |
97 | advanced=Advanced
98 | source=Source:
99 | animation=Animation
100 | texture=Texture
101 |
102 | importFLAWaitting=読み込み中...\r読込みが完了するまでお待ちください。
103 | importNoElement=Fla {0} のライブラリにスケルトンが見つかりません。
104 | importSkeletonProgress=スケルトンの読み込み : {0} / {1}
105 | importTextureProgress=テクスチャの読み込み : {0} / {1}
106 | importFileWaitting=読み込み中...
107 | importFileError=読込みに失敗しました。\r不明なデータ形式です。
108 | importFileProgress=読み込みの進行状況 : {0} %
109 | exportWaitting=書き出し...\r書き出しが完了するまでお待ちください。
110 | exportError=書き出しに失敗しました。\rデータの書き込み中に不明なエラーが発生しました。
111 | contactUsBy={0} に問い合わせ
112 | copyright=Copyright 2012-2013 DragonBonesチーム および その他のContributor
113 |
114 | menu_file=File
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/locale/zh_CN/resources.properties:
--------------------------------------------------------------------------------
1 | editor=编辑器
2 | xml=XML
3 | copyBehaviors=复制动作
4 | textureAtlas=纹理集
5 | help=帮助
6 | onlineHelp=在线帮助
7 | contactUs=联系我们
8 | about=关于
9 | helpUs=帮助我们
10 | skeleton=骨架:
11 | behaviorList=动作列表
12 | boneTree=骨骼树
13 | textureList=纹理列表
14 | boneHighlight=骨骼高亮
15 | import=导入
16 | export=导出
17 | bone=骨骼
18 | behavior=动作
19 | source=源
20 | target=目标
21 | frameRate=帧频:
22 | behaviorPanelTitle=动作 -
23 | totalTimeSec=总时间(秒):
24 | totalTimeScale=总时间缩放(%):
25 | blendingTime=混合时间(秒):
26 | keyFrameEase=关键帧缓动:
27 | loop=播放次数:
28 | autotween=自动补间
29 | play=播放
30 | stop=停止
31 | bonePanelTitle=骨骼 -
32 | totalFramesScale=总帧数缩放(%):
33 | playDelay=播放延时(%):
34 | importLabel=导入:
35 | textureSetting=纹理设置
36 | layoutAlgorithm=排列算法:
37 | size=纹理集尺寸:
38 | autoSize=自适应
39 | padding=纹理间距:
40 | exportLabel=导出:
41 | allLibraryItems=所有库元件
42 | selectedItems=选中的库元件
43 | exportedData=导出的数据(SWF/PNG/Zip)
44 | spineData=Spine的数据(Zip)
45 |
46 | swf=SWF (包含数据)
47 | png=PNG (包含数据)
48 | swf+xml=Zip (XML + SWF)
49 | png+xml=Zip (XML + PNG)
50 | pngs+xml=Zip (XML + PNGs)
51 | swf+json=Zip (JSON + SWF)
52 | png+json=Zip (JSON + PNG)
53 | pngs+json=Zip (JSON + PNGs)
54 |
55 | dataMerged=集成数据
56 | dataAmf3=AMF(二进制)
57 | dataXml=XML
58 | dataJson=JSON(支持Egret引擎)
59 | textureSwf=DBSWF(矢量图)
60 | texturePng=PNG
61 | texturePngs=PNGS
62 | dataTypeAbsolute=世界
63 | dataTypeRelative=父
64 | compressData=压缩数据
65 | dataTypeAbsoluteToolTip=世界坐标数据能够完美兼容老板本的库,但是数据文件尺寸会比较大。
66 | dataTypeAbsoluteDisableToolTip=因为导入的是基于父坐标系的数据,所以无法导出为基于世界坐标系的数据。
67 | dataTypeRelativeToolTip=父坐标数据能够最大限度的压缩数据尺寸,但是可能会和老板本的库不兼容,并且导出的数据将不支持在DesignPanel中再次修改骨架关系。
68 | compressDataToolTip=开启数据压缩能够最大限度的压缩数据尺寸,但是可能回合老版本的库不兼容。
69 |
70 | exportscale=导出缩放比
71 | backgroundColor=背景颜色
72 | advanceOption=高级选项
73 | ok=确定
74 | save=保存
75 | cancel=取消
76 |
77 | batchProcess=批处理
78 | importFolder=导入路径:
79 | exportFolder=导出路径:
80 | browse=浏览
81 | importFileTypeSelection=导入类型选择:
82 | fadeInTime=动作淡入时间:
83 | millisecond=毫秒
84 | pixel=像素
85 |
86 | dataFormat=数据格式:
87 | textureFormat=纹理格式:
88 | dataType=数据坐标系:
89 | startBatchProcess=开始批处理
90 | textureAtlasPath=纹理集路径:
91 | skeletonDataFileName=骨架数据文件名:
92 | textureDataFileName=纹理数据文件名:
93 | textureFileName=纹理文件名:
94 | subTextureFolderName=纹理文件夹名:
95 | skeletonDataName=骨架数据名:
96 |
97 | advanced=高级
98 | source=源:
99 | animation=动画
100 | texture=纹理
101 |
102 | importFLAWaitting=导入中请稍后...\r请耐心等待直到导入结束.
103 | importNoElement=未在 Fla {0} 库中找到符合骨架结构的元件!
104 | importSkeletonProgress=导入骨架: {0} / {1}
105 | importTextureProgress=导入纹理: {0} / {1}
106 | saveAnimation=保存中请稍后...\r请耐心等待直到保存结束.
107 | saveAnimationProgress=保存动画: {0} / {1}
108 | importFileWaitting=导入中请稍后...
109 | importFileError=导入失败!\r未知的数据格式错误!
110 | importFileProgress=导入进度: {0} %
111 | exportWaitting=导出中请稍后...\r请耐心等待直到导出结束.
112 | exportError=导出失败!\r文件写入时发生未知错误!
113 | contactUsBy=通过 {0} 联系我们
114 | copyright=版权所有 2012-2013 DragonBones团队和其他贡献者保留所有权利.
115 |
116 | menu_file=文件
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/armature_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/armature_icon.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/armature_open_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/armature_open_icon.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/bone_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/bone_icon.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/about.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/connect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/connect.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/demo.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/disconnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/disconnect.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/effecthub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/effecthub.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/export.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/export.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/help.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/home.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/import.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/import.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/open.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/pause.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/play.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/playnext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/playnext.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/playprevious.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/playprevious.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/remove.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/settings.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/button/update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/button/update.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/mouse_scroll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/mouse_scroll.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/mouse_scrollDrag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/mouse_scrollDrag.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/others/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/others/logo.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/assets/others/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/assets/others/title.png
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/com/adobe/serialization/json/JSON.as:
--------------------------------------------------------------------------------
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 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | * @private
37 | * This class provides encoding and decoding of the JSON format.
38 | *
39 | * Example usage:
40 | *
41 | * // create a JSON string from an internal object
42 | * JSON.encode( myObject );
43 | *
44 | * // read a JSON string into an internal object
45 | * var myObject:Object = JSON.decode( jsonString );
46 | *
47 | */
48 | public class JSON {
49 |
50 |
51 | /**
52 | * Encodes a object into a JSON string.
53 | *
54 | * @param o The object to create a JSON string for
55 | * @return the JSON string representing o
56 | * @langversion ActionScript 3.0
57 | * @playerversion Flash 9.0
58 | * @tiptext
59 | */
60 | public static function encode( o:Object ):String {
61 |
62 | var encoder:JSONEncoder = new JSONEncoder( o );
63 | return encoder.getString();
64 |
65 | }
66 |
67 | /**
68 | * Decodes a JSON string into a native object.
69 | *
70 | * @param s The JSON string representing the object
71 | * @return A native object as specified by s
72 | * @throw JSONParseError
73 | * @langversion ActionScript 3.0
74 | * @playerversion Flash 9.0
75 | * @tiptext
76 | */
77 | public static function decode( s:String ):* {
78 |
79 | var decoder:JSONDecoder = new JSONDecoder( s )
80 | return decoder.getValue();
81 |
82 | }
83 |
84 | }
85 |
86 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/com/adobe/serialization/json/JSONDecoder.as:
--------------------------------------------------------------------------------
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 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | * @private
37 | */
38 | public class JSONDecoder {
39 |
40 | /** The value that will get parsed from the JSON string */
41 | private var value:*;
42 |
43 | /** The tokenizer designated to read the JSON string */
44 | private var tokenizer:JSONTokenizer;
45 |
46 | /** The current token from the tokenizer */
47 | private var token:JSONToken;
48 |
49 | /**
50 | * Constructs a new JSONDecoder to parse a JSON string
51 | * into a native object.
52 | *
53 | * @param s The JSON string to be converted
54 | * into a native object
55 | * @langversion ActionScript 3.0
56 | * @playerversion Flash 9.0
57 | * @tiptext
58 | */
59 | public function JSONDecoder( s:String ) {
60 |
61 | tokenizer = new JSONTokenizer( s );
62 |
63 | nextToken();
64 | value = parseValue();
65 | }
66 |
67 | /**
68 | * Gets the internal object that was created by parsing
69 | * the JSON string passed to the constructor.
70 | *
71 | * @return The internal object representation of the JSON
72 | * string that was passed to the constructor
73 | * @langversion ActionScript 3.0
74 | * @playerversion Flash 9.0
75 | * @tiptext
76 | */
77 | public function getValue():* {
78 | return value;
79 | }
80 |
81 | /**
82 | * Returns the next token from the tokenzier reading
83 | * the JSON string
84 | */
85 | private function nextToken():JSONToken {
86 | return token = tokenizer.getNextToken();
87 | }
88 |
89 | /**
90 | * Attempt to parse an array
91 | */
92 | private function parseArray():Array {
93 | // create an array internally that we're going to attempt
94 | // to parse from the tokenizer
95 | var a:Array = new Array();
96 |
97 | // grab the next token from the tokenizer to move
98 | // past the opening [
99 | nextToken();
100 |
101 | // check to see if we have an empty array
102 | if ( token.type == JSONTokenType.RIGHT_BRACKET ) {
103 | // we're done reading the array, so return it
104 | return a;
105 | }
106 |
107 | // deal with elements of the array, and use an "infinite"
108 | // loop because we could have any amount of elements
109 | while ( true ) {
110 | // read in the value and add it to the array
111 | a.push ( parseValue() );
112 |
113 | // after the value there should be a ] or a ,
114 | nextToken();
115 |
116 | if ( token.type == JSONTokenType.RIGHT_BRACKET ) {
117 | // we're done reading the array, so return it
118 | return a;
119 | } else if ( token.type == JSONTokenType.COMMA ) {
120 | // move past the comma and read another value
121 | nextToken();
122 | } else {
123 | tokenizer.parseError( "Expecting ] or , but found " + token.value );
124 | }
125 | }
126 | return null;
127 | }
128 |
129 | /**
130 | * Attempt to parse an object
131 | */
132 | private function parseObject():Object {
133 | // create the object internally that we're going to
134 | // attempt to parse from the tokenizer
135 | var o:Object = new Object();
136 |
137 | // store the string part of an object member so
138 | // that we can assign it a value in the object
139 | var key:String
140 |
141 | // grab the next token from the tokenizer
142 | nextToken();
143 |
144 | // check to see if we have an empty object
145 | if ( token.type == JSONTokenType.RIGHT_BRACE ) {
146 | // we're done reading the object, so return it
147 | return o;
148 | }
149 |
150 | // deal with members of the object, and use an "infinite"
151 | // loop because we could have any amount of members
152 | while ( true ) {
153 |
154 | if ( token.type == JSONTokenType.STRING ) {
155 | // the string value we read is the key for the object
156 | key = String( token.value );
157 |
158 | // move past the string to see what's next
159 | nextToken();
160 |
161 | // after the string there should be a :
162 | if ( token.type == JSONTokenType.COLON ) {
163 |
164 | // move past the : and read/assign a value for the key
165 | nextToken();
166 | o[key] = parseValue();
167 |
168 | // move past the value to see what's next
169 | nextToken();
170 |
171 | // after the value there's either a } or a ,
172 | if ( token.type == JSONTokenType.RIGHT_BRACE ) {
173 | // // we're done reading the object, so return it
174 | return o;
175 |
176 | } else if ( token.type == JSONTokenType.COMMA ) {
177 | // skip past the comma and read another member
178 | nextToken();
179 | } else {
180 | tokenizer.parseError( "Expecting } or , but found " + token.value );
181 | }
182 | } else {
183 | tokenizer.parseError( "Expecting : but found " + token.value );
184 | }
185 | } else {
186 | tokenizer.parseError( "Expecting string but found " + token.value );
187 | }
188 | }
189 | return null;
190 | }
191 |
192 | /**
193 | * Attempt to parse a value
194 | */
195 | private function parseValue():Object
196 | {
197 | // Catch errors when the input stream ends abruptly
198 | if ( token == null )
199 | {
200 | tokenizer.parseError( "Unexpected end of input" );
201 | }
202 |
203 | switch ( token.type ) {
204 | case JSONTokenType.LEFT_BRACE:
205 | return parseObject();
206 |
207 | case JSONTokenType.LEFT_BRACKET:
208 | return parseArray();
209 |
210 | case JSONTokenType.STRING:
211 | case JSONTokenType.NUMBER:
212 | case JSONTokenType.TRUE:
213 | case JSONTokenType.FALSE:
214 | case JSONTokenType.NULL:
215 | return token.value;
216 |
217 | default:
218 | tokenizer.parseError( "Unexpected " + token.value );
219 |
220 | }
221 | return null;
222 | }
223 | }
224 | }
225 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/com/adobe/serialization/json/JSONParseError.as:
--------------------------------------------------------------------------------
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 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | * @private
37 | */
38 | public class JSONParseError extends Error {
39 |
40 | /** The location in the string where the error occurred */
41 | private var _location:int;
42 |
43 | /** The string in which the parse error occurred */
44 | private var _text:String;
45 |
46 | /**
47 | * Constructs a new JSONParseError.
48 | *
49 | * @param message The error message that occured during parsing
50 | * @langversion ActionScript 3.0
51 | * @playerversion Flash 9.0
52 | * @tiptext
53 | */
54 | public function JSONParseError( message:String = "", location:int = 0, text:String = "") {
55 | super( message );
56 | name = "JSONParseError";
57 | _location = location;
58 | _text = text;
59 | }
60 |
61 | /**
62 | * Provides read-only access to the location variable.
63 | *
64 | * @return The location in the string where the error occurred
65 | * @langversion ActionScript 3.0
66 | * @playerversion Flash 9.0
67 | * @tiptext
68 | */
69 | public function get location():int {
70 | return _location;
71 | }
72 |
73 | /**
74 | * Provides read-only access to the text variable.
75 | *
76 | * @return The string in which the error occurred
77 | * @langversion ActionScript 3.0
78 | * @playerversion Flash 9.0
79 | * @tiptext
80 | */
81 | public function get text():String {
82 | return _text;
83 | }
84 | }
85 |
86 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/com/adobe/serialization/json/JSONToken.as:
--------------------------------------------------------------------------------
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 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | * @private
37 | */
38 | public class JSONToken {
39 |
40 | private var _type:int;
41 | private var _value:Object;
42 |
43 | /**
44 | * Creates a new JSONToken with a specific token type and value.
45 | *
46 | * @param type The JSONTokenType of the token
47 | * @param value The value of the token
48 | * @langversion ActionScript 3.0
49 | * @playerversion Flash 9.0
50 | * @tiptext
51 | */
52 | public function JSONToken( type:int = -1 /* JSONTokenType.UNKNOWN */, value:Object = null ) {
53 | _type = type;
54 | _value = value;
55 | }
56 |
57 | /**
58 | * Returns the type of the token.
59 | *
60 | * @see com.adobe.serialization.json.JSONTokenType
61 | * @langversion ActionScript 3.0
62 | * @playerversion Flash 9.0
63 | * @tiptext
64 | */
65 | public function get type():int {
66 | return _type;
67 | }
68 |
69 | /**
70 | * Sets the type of the token.
71 | *
72 | * @see com.adobe.serialization.json.JSONTokenType
73 | * @langversion ActionScript 3.0
74 | * @playerversion Flash 9.0
75 | * @tiptext
76 | */
77 | public function set type( value:int ):void {
78 | _type = value;
79 | }
80 |
81 | /**
82 | * Gets the value of the token
83 | *
84 | * @see com.adobe.serialization.json.JSONTokenType
85 | * @langversion ActionScript 3.0
86 | * @playerversion Flash 9.0
87 | * @tiptext
88 | */
89 | public function get value():Object {
90 | return _value;
91 | }
92 |
93 | /**
94 | * Sets the value of the token
95 | *
96 | * @see com.adobe.serialization.json.JSONTokenType
97 | * @langversion ActionScript 3.0
98 | * @playerversion Flash 9.0
99 | * @tiptext
100 | */
101 | public function set value ( v:Object ):void {
102 | _value = v;
103 | }
104 |
105 | }
106 |
107 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/com/adobe/serialization/json/JSONTokenType.as:
--------------------------------------------------------------------------------
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 |
33 | package com.adobe.serialization.json {
34 |
35 | /**
36 | * @private
37 | * Class containing constant values for the different types
38 | * of tokens in a JSON encoded string.
39 | */
40 | public class JSONTokenType {
41 |
42 | public static const UNKNOWN:int = -1;
43 |
44 | public static const COMMA:int = 0;
45 |
46 | public static const LEFT_BRACE:int = 1;
47 |
48 | public static const RIGHT_BRACE:int = 2;
49 |
50 | public static const LEFT_BRACKET:int = 3;
51 |
52 | public static const RIGHT_BRACKET:int = 4;
53 |
54 | public static const COLON:int = 6;
55 |
56 | public static const TRUE:int = 7;
57 |
58 | public static const FALSE:int = 8;
59 |
60 | public static const NULL:int = 9;
61 |
62 | public static const STRING:int = 10;
63 |
64 | public static const NUMBER:int = 11;
65 |
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/AssetManager.as:
--------------------------------------------------------------------------------
1 | package core
2 | {
3 | public class AssetManager
4 | {
5 | [Embed(source='./assets/button/open.png')]
6 | public static const Open:Class;
7 | [Embed(source='./assets/button/import.png')]
8 | public static const Import:Class;
9 | [Embed(source='./assets/button/export.png')]
10 | public static const Export:Class;
11 | [Embed(source='./assets/button/effecthub.png')]
12 | public static const EffectHub:Class;
13 | [Embed(source='./assets/button/home.png')]
14 | public static const Home:Class;
15 | [Embed(source='./assets/button/help.png')]
16 | public static const Help:Class;
17 | [Embed(source='./assets/button/about.png')]
18 | public static const About:Class;
19 | [Embed(source='./assets/button/demo.png')]
20 | public static const Demos:Class;
21 | [Embed(source='./assets/button/connect.png')]
22 | public static const Connect:Class;
23 | [Embed(source='./assets/button/disconnect.png')]
24 | public static const Disconnect:Class;
25 | [Embed(source='./assets/button/settings.png')]
26 | public static const Settings:Class;
27 | [Embed(source='./assets/button/update.png')]
28 | public static const Update:Class;
29 | [Embed(source='./assets/button/remove.png')]
30 | public static const Remove:Class;
31 | [Embed(source='./assets/button/play.png')]
32 | public static const Play:Class;
33 | [Embed(source='./assets/button/pause.png')]
34 | public static const Pause:Class;
35 | [Embed(source='./assets/button/playnext.png')]
36 | public static const PlayNext:Class;
37 | [Embed(source='./assets/button/playprevious.png')]
38 | public static const PlayPrevious:Class;
39 |
40 | [Embed(source='./assets/others/logo.png')]
41 | public static const Logo:Class;
42 | [Embed(source='./assets/others/title.png')]
43 | public static const Title:Class;
44 | }
45 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/ShareBundle.as:
--------------------------------------------------------------------------------
1 | package core
2 | {
3 | import robotlegs.bender.bundles.mvcs.MVCSBundle;
4 | import robotlegs.bender.extensions.contextView.ContextViewExtension;
5 | import robotlegs.bender.extensions.contextView.ContextViewListenerConfig;
6 | import robotlegs.bender.extensions.contextView.StageSyncExtension;
7 | import robotlegs.bender.extensions.directCommandMap.DirectCommandMapExtension;
8 | import robotlegs.bender.extensions.enhancedLogging.InjectableLoggerExtension;
9 | import robotlegs.bender.extensions.enhancedLogging.TraceLoggingExtension;
10 | import robotlegs.bender.extensions.eventCommandMap.EventCommandMapExtension;
11 | import robotlegs.bender.extensions.eventDispatcher.EventDispatcherExtension;
12 | import robotlegs.bender.extensions.localEventMap.LocalEventMapExtension;
13 | import robotlegs.bender.extensions.mediatorMap.MediatorMapExtension;
14 | import robotlegs.bender.extensions.modularity.ModularityExtension;
15 | import robotlegs.bender.extensions.viewManager.StageCrawlerExtension;
16 | import robotlegs.bender.extensions.viewManager.StageObserverExtension;
17 | import robotlegs.bender.extensions.viewManager.ViewManagerExtension;
18 | import robotlegs.bender.extensions.viewProcessorMap.ViewProcessorMapExtension;
19 | import robotlegs.bender.extensions.vigilance.VigilanceExtension;
20 | import robotlegs.bender.framework.api.IContext;
21 | import robotlegs.bender.framework.api.LogLevel;
22 |
23 | public final class ShareBundle extends MVCSBundle
24 | {
25 | override public function extend(context:IContext):void
26 | {
27 | context.logLevel = LogLevel.DEBUG;
28 |
29 | context.install(
30 | TraceLoggingExtension,
31 | VigilanceExtension,
32 | InjectableLoggerExtension,
33 | ContextViewExtension,
34 | EventDispatcherExtension,
35 | ModularityExtension,
36 | DirectCommandMapExtension,
37 | EventCommandMapExtension,
38 | LocalEventMapExtension,
39 | ViewManagerExtension,
40 | StageObserverExtension,
41 | MediatorMapExtension,
42 | ViewProcessorMapExtension,
43 | StageCrawlerExtension,
44 | StageSyncExtension);
45 |
46 | context.configure(ContextViewListenerConfig);
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/ShareConfig.as:
--------------------------------------------------------------------------------
1 | package core
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | import core.controller.ControlCommand;
6 | import core.controller.CreateAnimationToFlashCommand;
7 | import core.controller.ExportFileCommand;
8 | import core.controller.ImportFLACommand;
9 | import core.controller.ImportFileCommand;
10 | import core.controller.ModelCommand;
11 | import core.controller.MultipleImportAndExportCommand;
12 | import core.controller.RemoveArmatureCommand;
13 | import core.controller.SettingStartupCommand;
14 | import core.controller.ViewCommand;
15 | import core.events.ControllerEvent;
16 | import core.events.MediatorEvent;
17 | import core.events.ModelEvent;
18 | import core.mediator.AnimationControlViewMediator;
19 | import core.mediator.ArmaturesPanelMediator;
20 | import core.mediator.BoneControlViewMediator;
21 | import core.model.ImportModel;
22 | import core.model.ParsedModel;
23 | import core.service.ImportDataToExportDataService;
24 | import core.service.ImportFLAService;
25 | import core.service.ImportFileService;
26 | import core.service.JSFLService;
27 | import core.service.LoadTextureAtlasBytesService;
28 | import core.view.AnimationControlView;
29 | import core.view.ArmaturesPanel;
30 | import core.view.BoneControlView;
31 |
32 | import light.net.LocalConnectionClientService;
33 | import light.net.LocalConnectionServerService;
34 |
35 | import robotlegs.bender.extensions.eventCommandMap.api.IEventCommandMap;
36 | import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
37 | import robotlegs.bender.framework.api.IConfig;
38 | import robotlegs.bender.framework.api.IInjector;
39 | import robotlegs.bender.mxml.ContextBuilderTag;
40 |
41 | public final class ShareConfig implements IConfig
42 | {
43 | //
44 | public static const HOST:String = "_DragonBonesDesignPanelLocalConnection";
45 |
46 | //
47 | public static const IMPORT_MODEL:String = "importModel";
48 | public static const EXPORT_MODEL:String = "exportModel";
49 |
50 | [Inject]
51 | public var injector:IInjector;
52 |
53 | [Inject]
54 | public var dispatcher:IEventDispatcher;
55 |
56 | [Inject]
57 | public var mediatorMap:IMediatorMap;
58 |
59 | [Inject]
60 | public var commandMap:IEventCommandMap;
61 |
62 | //
63 | public var parsedModel:ParsedModel;
64 |
65 | //
66 | private var _contextBuilderTag:ContextBuilderTag;
67 |
68 |
69 | public function configure():void
70 | {
71 | //model
72 | parsedModel = new ParsedModel();
73 | injector.injectInto(parsedModel);
74 |
75 | injector.map(core.model.ImportModel, IMPORT_MODEL).asSingleton();
76 | injector.map(core.model.ImportModel, EXPORT_MODEL).asSingleton();
77 | injector.map(core.model.ParsedModel).toValue(parsedModel);
78 |
79 |
80 | //view
81 | mediatorMap.map(core.view.AnimationControlView).toMediator(core.mediator.AnimationControlViewMediator);
82 | mediatorMap.map(core.view.BoneControlView).toMediator(core.mediator.BoneControlViewMediator);
83 | mediatorMap.map(core.view.ArmaturesPanel).toMediator(core.mediator.ArmaturesPanelMediator);
84 |
85 |
86 | //controller
87 | commandMap.map(core.events.ControllerEvent.SETTING_STARTUP).toCommand(core.controller.SettingStartupCommand);
88 |
89 | commandMap.map(core.events.ModelEvent.PARSED_MODEL_ANIMATION_DATA_CHANGE).toCommand(core.controller.ModelCommand);
90 | commandMap.map(core.events.ModelEvent.PARSED_MODEL_TIMELINE_DATA_CHANGE).toCommand(core.controller.ModelCommand);
91 | commandMap.map(core.events.ModelEvent.PARSED_MODEL_BONE_PARENT_CHANGE).toCommand(core.controller.ModelCommand);
92 |
93 | commandMap.map(core.events.ControllerEvent.IMPORT_FLA).toCommand(core.controller.ImportFLACommand);
94 | commandMap.map(core.events.ControllerEvent.IMPORT_FILE).toCommand(core.controller.ImportFileCommand);
95 | commandMap.map(core.events.ControllerEvent.EXPORT_FILE).toCommand(core.controller.ExportFileCommand);
96 | commandMap.map(core.events.ControllerEvent.REMOVE_ARMATURE).toCommand(core.controller.RemoveArmatureCommand);
97 |
98 | commandMap.map(core.events.ControllerEvent.MULTIPLE_IMPORT_AND_EXPORT).toCommand(core.controller.MultipleImportAndExportCommand);
99 | commandMap.map(core.events.ControllerEvent.CREATE_ANIMATION_TO_FLASH).toCommand(core.controller.CreateAnimationToFlashCommand);
100 |
101 | commandMap.map(core.events.ControllerEvent.IMPORT_COMPLETE).toCommand(core.controller.ControlCommand);
102 | commandMap.map(core.events.ControllerEvent.EXPORT_COMPLETE).toCommand(core.controller.ControlCommand);
103 |
104 | commandMap.map(core.events.MediatorEvent.UPDATE_FLA_ARMATURE).toCommand(core.controller.ViewCommand);
105 | commandMap.map(core.events.MediatorEvent.REMOVE_ARMATURE).toCommand(core.controller.ViewCommand);
106 |
107 |
108 |
109 | // service
110 | var server:LocalConnectionServerService;
111 | if(JSFLService.isAvailable)
112 | {
113 | server = new LocalConnectionServerService();
114 | }
115 |
116 | var client:LocalConnectionClientService = new LocalConnectionClientService();
117 |
118 | var jsflService:JSFLService = new JSFLService();
119 |
120 | injector.map(LocalConnectionServerService).toValue(server);
121 | injector.map(LocalConnectionClientService).toValue(client);
122 |
123 | injector.map(core.service.LoadTextureAtlasBytesService).asSingleton();
124 | injector.map(core.service.JSFLService).toValue(jsflService);
125 |
126 | injector.map(core.service.ImportFLAService).asSingleton();
127 | injector.map(core.service.ImportFileService).asSingleton();
128 | injector.map(core.service.ImportDataToExportDataService).asSingleton();
129 |
130 | injector.injectInto(jsflService);
131 |
132 |
133 |
134 |
135 | if (server)
136 | {
137 | server.host = HOST;
138 | server.on();
139 | }
140 |
141 | client.host = HOST;
142 | client.on();
143 | jsflService.on();
144 |
145 |
146 | (injector.getInstance(IEventDispatcher) as IEventDispatcher)
147 | .dispatchEvent(
148 | new ControllerEvent(ControllerEvent.SETTING_STARTUP)
149 | );
150 | }
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/ControlCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import core.events.ControllerEvent;
4 | import core.model.ParsedModel;
5 | import core.model.vo.ImportVO;
6 | import core.suppotClass._BaseCommand;
7 |
8 | public final class ControlCommand extends _BaseCommand
9 | {
10 | [Inject]
11 | public var event:ControllerEvent;
12 |
13 | [Inject]
14 | public var parsedModel:ParsedModel;
15 |
16 | override public function execute():void
17 | {
18 | var importVO:ImportVO;
19 |
20 | switch(event.type)
21 | {
22 | case ControllerEvent.IMPORT_COMPLETE:
23 | importVO = event.data;
24 | parsedModel.setDataFromImport(importVO);
25 | break;
26 | }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/CreateAnimationToFlashCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import core.events.ControllerEvent;
4 | import core.events.ServiceEvent;
5 | import core.model.ImportModel;
6 | import core.model.ParsedModel;
7 | import core.service.JSFLService;
8 | import core.suppotClass._BaseCommand;
9 |
10 | import dragonBones.utils.ConstValues;
11 |
12 | public final class CreateAnimationToFlashCommand extends _BaseCommand
13 | {
14 | [Inject]
15 | public var event:ControllerEvent;
16 |
17 | [Inject]
18 | public var jsflService:JSFLService;
19 |
20 | [Inject (name="importModel")]
21 | public var importModel:ImportModel;
22 |
23 | [Inject]
24 | public var parsedModel:ParsedModel;
25 |
26 | private var _createAnimationList:Vector.;
27 | private var _armatureName:String;
28 | private var _armature:XML;
29 | private var _animationList:XMLList;
30 | private var _index:int;
31 | private var _isPassedFirst:Boolean;
32 |
33 | override public function execute():void
34 | {
35 | if (parsedModel.vo.importVO)
36 | {
37 | this.directCommandMap.detain(this);
38 | _armatureName = parsedModel.armatureSelected.name;
39 | if (event.data && event.data[0])
40 | {
41 | _createAnimationList = new Vector.;
42 | _createAnimationList.push(parsedModel.animationSelected.name);
43 | }
44 |
45 | _armature = importModel.getArmatureList(_armatureName)[0].copy();
46 | delete _armature[ConstValues.ANIMATION];
47 | delete _armature[ConstValues.SKIN];
48 | delete _armature[ConstValues.BONE].*;
49 |
50 | _animationList = importModel.getAnimationList(_armatureName);
51 | _index = 0;
52 |
53 | nextAnimation(true);
54 | }
55 | }
56 |
57 | private function nextAnimation(isFirstData:Boolean):void
58 | {
59 | if(_index >= _animationList.length())
60 | {
61 | directCommandMap.release(this);
62 | return;
63 | }
64 |
65 | var animation:XML = _animationList[_index];
66 | var animationName:String = animation.@[ConstValues.A_NAME];
67 | _index ++;
68 |
69 | if (_createAnimationList && _createAnimationList.length > 0)
70 | {
71 | if (_createAnimationList.indexOf(animationName) < 0)
72 | {
73 | nextAnimation(!_isPassedFirst);
74 | return;
75 | }
76 | }
77 | _isPassedFirst = true;
78 | jsflService.runJSFLMethod(null, "dragonBonesExtensions.createArmatureAnimation", _armatureName, animationName, animation, _armature, isFirstData?true:"", jsflServerHandler);
79 | }
80 |
81 | private function jsflServerHandler(e:ServiceEvent):void
82 | {
83 | var result:String = e.data as String;
84 | if(result != "false")
85 | {
86 | _armatureName = result;
87 | nextAnimation(false);
88 | }
89 | else
90 | {
91 | directCommandMap.release(this);
92 | }
93 | }
94 | }
95 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/ExportFileCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import flash.events.Event;
4 | import flash.events.IOErrorEvent;
5 |
6 | import core.events.ControllerEvent;
7 | import core.events.ServiceEvent;
8 | import core.model.vo.ExportVO;
9 | import core.service.ImportDataToExportDataService;
10 | import core.suppotClass._BaseCommand;
11 |
12 | import light.managers.RequestManager;
13 |
14 | public final class ExportFileCommand extends _BaseCommand
15 | {
16 | [Inject]
17 | public var event:ControllerEvent;
18 |
19 | [Inject]
20 | public var importDataToExportDataService:ImportDataToExportDataService;
21 |
22 | override public function execute():void
23 | {
24 | this.directCommandMap.detain(this);
25 |
26 | importDataToExportDataService.addEventListener(ImportDataToExportDataService.IMPORT_TO_EXPORT_COMPLETE, serviceHandler);
27 | importDataToExportDataService.export(event.data[0], event.data[1]);
28 | }
29 |
30 | private function serviceHandler(e:ServiceEvent):void
31 | {
32 | importDataToExportDataService.removeEventListener(ImportDataToExportDataService.IMPORT_TO_EXPORT_COMPLETE, serviceHandler);
33 | switch(e.type)
34 | {
35 | case ImportDataToExportDataService.IMPORT_TO_EXPORT_COMPLETE:
36 | RequestManager.getInstance().save(e.data[0], (e.data[1] as ExportVO).name, saveHandler);
37 | break;
38 | }
39 | }
40 |
41 | private function saveHandler(e:Event):void
42 | {
43 | switch(e.type)
44 | {
45 | case Event.CANCEL:
46 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.EXPORT_CANCEL));
47 | break;
48 |
49 | case IOErrorEvent.IO_ERROR:
50 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.EXPORT_ERROR, e));
51 | break;
52 |
53 | case Event.COMPLETE:
54 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.EXPORT_COMPLETE));
55 | break;
56 | }
57 |
58 | this.directCommandMap.release(this);
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/ImportFLACommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import flash.events.Event;
4 |
5 | import core.events.ControllerEvent;
6 | import core.events.ServiceEvent;
7 | import core.model.ImportModel;
8 | import core.model.ParsedModel;
9 | import core.model.vo.ImportVO;
10 | import core.service.ImportFLAService;
11 | import core.service.LoadTextureAtlasBytesService;
12 | import core.suppotClass._BaseCommand;
13 |
14 | import modifySWF.combine;
15 |
16 | public final class ImportFLACommand extends _BaseCommand
17 | {
18 | [Inject]
19 | public var loadTextureAtlasBytesService:LoadTextureAtlasBytesService;
20 |
21 | [Inject]
22 | public var importFLAService:ImportFLAService;
23 |
24 | [Inject]
25 | public var parsedModel:ParsedModel;
26 |
27 | [Inject (name="importModel")]
28 | public var importModel:ImportModel;
29 |
30 | [Inject]
31 | public var event:ControllerEvent;
32 |
33 | override public function execute():void
34 | {
35 | this.directCommandMap.detain(this);
36 | importFLAService.addEventListener(ImportFLAService.IMPORT_FLA_ERROR, serviceHandler);
37 | importFLAService.addEventListener(ImportFLAService.IMPORT_FLA_COMPLETE, serviceHandler);
38 | importFLAService.startImport(event.data);
39 | }
40 |
41 | private function serviceHandler(e:Event):void
42 | {
43 | importFLAService.removeEventListener(ImportFLAService.IMPORT_FLA_ERROR, serviceHandler);
44 | importFLAService.removeEventListener(ImportFLAService.IMPORT_FLA_COMPLETE, serviceHandler);
45 | switch(e.type)
46 | {
47 | case ImportFLAService.IMPORT_FLA_ERROR:
48 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_ERROR, e));
49 | this.directCommandMap.release(this);
50 | break;
51 |
52 | case ImportFLAService.IMPORT_FLA_COMPLETE:
53 | var importVO:ImportVO = (e as ServiceEvent).data;
54 | if(importVO.isToMerge)
55 | {
56 | //bitmapData 暂不合并
57 | var currentImportModel:ImportModel = new ImportModel();
58 | currentImportModel.vo = new ImportVO();
59 | currentImportModel.vo.skeleton = parsedModel.vo.importVO.skeleton;
60 | currentImportModel.vo.textureAtlasConfig = parsedModel.vo.importVO.textureAtlasConfig;
61 | currentImportModel.merge(importModel);
62 |
63 | importModel.vo.skeleton = currentImportModel.vo.skeleton;
64 | importModel.vo.textureAtlasConfig = currentImportModel.vo.textureAtlasConfig;
65 |
66 | importModel.vo.textureAtlasBytes =
67 | combine(
68 | parsedModel.vo.importVO.textureAtlasBytes,
69 | importModel.vo.textureAtlasBytes,
70 | importModel.getTextureAtlasWithPivot()
71 | );
72 |
73 | loadTextureAtlasBytesService.addEventListener(LoadTextureAtlasBytesService.TEXTURE_ATLAS_BYTES_LOAD_COMPLETE, textureAtlasBytesHandler);
74 | loadTextureAtlasBytesService.load(importModel.vo);
75 | }
76 | else
77 | {
78 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_COMPLETE, importVO));
79 | this.directCommandMap.release(this);
80 | }
81 | break;
82 | }
83 | }
84 |
85 | private function textureAtlasBytesHandler(e:ServiceEvent):void
86 | {
87 | loadTextureAtlasBytesService.removeEventListener(LoadTextureAtlasBytesService.TEXTURE_ATLAS_BYTES_LOAD_COMPLETE, textureAtlasBytesHandler);
88 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_COMPLETE, e.data));
89 | this.directCommandMap.release(this);
90 | }
91 | }
92 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/ImportFileCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import flash.events.Event;
4 | import flash.events.IOErrorEvent;
5 | import flash.events.ProgressEvent;
6 | import flash.events.SecurityErrorEvent;
7 | import flash.net.URLLoaderDataFormat;
8 |
9 | import core.events.ControllerEvent;
10 | import core.events.ServiceEvent;
11 | import core.model.ImportModel;
12 | import core.model.vo.ImportVO;
13 | import core.service.ImportFileService;
14 | import core.suppotClass._BaseCommand;
15 |
16 | import light.managers.RequestManager;
17 |
18 | public final class ImportFileCommand extends _BaseCommand
19 | {
20 | [Inject]
21 | public var event:ControllerEvent;
22 |
23 | [Inject]
24 | public var importFileService:ImportFileService;
25 |
26 | [Inject (name="importModel")]
27 | public var importModel:ImportModel;
28 |
29 | private var _importVO:ImportVO;
30 |
31 | override public function execute():void
32 | {
33 | this.directCommandMap.detain(this);
34 |
35 | _importVO = event.data;
36 |
37 | if(_importVO.url)
38 | {
39 | RequestManager.getInstance().load(_importVO.url, loadHandler, true, null, null, null, null, URLLoaderDataFormat.BINARY);
40 | }
41 | else if(_importVO.typeFilter)
42 | {
43 | RequestManager.getInstance().browse(_importVO.typeFilter, loadHandler);
44 | }
45 | }
46 |
47 | private function loadHandler(e:Event):void
48 | {
49 | switch(e.type)
50 | {
51 | case Event.CANCEL:
52 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_CANCLE));
53 | this.directCommandMap.release(this);
54 | break;
55 |
56 | case IOErrorEvent.IO_ERROR:
57 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_ERROR, e));
58 | this.directCommandMap.release(this);
59 | break;
60 |
61 | case SecurityErrorEvent.SECURITY_ERROR:
62 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_ERROR, e));
63 | this.directCommandMap.release(this);
64 | break;
65 |
66 | case ProgressEvent.PROGRESS:
67 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_PROGRESS, e));
68 | break;
69 |
70 | case Event.COMPLETE:
71 | importFileService.addEventListener(ImportFileService.IMPORT_FILE_ERROR, serviceHandler);
72 | importFileService.addEventListener(ImportFileService.IMPORT_FILE_COMPLETE, serviceHandler);
73 | _importVO.data = e.target.data;
74 | importFileService.startImport(_importVO);
75 | break;
76 | }
77 | }
78 |
79 | private function serviceHandler(e:Event):void
80 | {
81 | importFileService.removeEventListener(ImportFileService.IMPORT_FILE_ERROR, serviceHandler);
82 | importFileService.removeEventListener(ImportFileService.IMPORT_FILE_COMPLETE, serviceHandler);
83 | switch(e.type)
84 | {
85 | case ImportFileService.IMPORT_FILE_ERROR:
86 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_ERROR, e));
87 | break;
88 |
89 | case ImportFileService.IMPORT_FILE_COMPLETE:
90 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_COMPLETE, (e as ServiceEvent).data));
91 | break;
92 | }
93 |
94 | this.directCommandMap.release(this);
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/ModelCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import core.events.ModelEvent;
4 | import core.model.ImportModel;
5 | import core.model.ParsedModel;
6 | import core.service.JSFLService;
7 | import core.suppotClass._BaseCommand;
8 |
9 | import dragonBones.utils.ConstValues;
10 |
11 | public final class ModelCommand extends _BaseCommand
12 | {
13 | [Inject]
14 | public var event:ModelEvent;
15 |
16 | [Inject]
17 | public var jsflService:JSFLService;
18 |
19 | [Inject (name="importModel")]
20 | public var importModel:ImportModel;
21 |
22 | [Inject]
23 | public var parsedModel:ParsedModel;
24 |
25 | override public function execute():void
26 | {
27 | var armatureName:String = parsedModel.armatureSelected.name;
28 | var animationName:String = parsedModel.animationSelected.name;
29 | var animation:XML;
30 |
31 | switch(event.type)
32 | {
33 | case ModelEvent.PARSED_MODEL_ANIMATION_DATA_CHANGE:
34 | armatureName = parsedModel.armatureSelected.name;
35 | animationName = parsedModel.animationSelected.name;
36 |
37 | importModel.updateAnimationFromData(armatureName, parsedModel.animationSelected);
38 |
39 | if(importModel.vo.isImportFromFLA)
40 | {
41 | animation = importModel.getAnimationList(armatureName, animationName)[0].copy();
42 | delete animation[ConstValues.TIMELINE].*;
43 | delete animation[ConstValues.FRAME];
44 |
45 | jsflService.runJSFLMethod(null, "dragonBones.DragonBones.changeAnimation", parsedModel.vo.importVO.id, armatureName, animationName, animation);
46 | }
47 |
48 | break;
49 |
50 | case ModelEvent.PARSED_MODEL_TIMELINE_DATA_CHANGE:
51 | armatureName = parsedModel.armatureSelected.name;
52 | animationName = parsedModel.animationSelected.name;
53 |
54 | importModel.updateTransformTimelineFromData(armatureName, animationName, parsedModel.animationSelected.getTimeline(parsedModel.boneSelected.name));
55 |
56 | if(importModel.vo.isImportFromFLA)
57 | {
58 | animation = importModel.getAnimationList(armatureName, animationName)[0].copy();
59 | delete animation[ConstValues.TIMELINE].*;
60 | delete animation[ConstValues.FRAME];
61 |
62 | jsflService.runJSFLMethod(null, "dragonBones.DragonBones.changeAnimation", parsedModel.vo.importVO.id, armatureName, animationName, animation);
63 | }
64 | break;
65 |
66 | case ModelEvent.PARSED_MODEL_BONE_PARENT_CHANGE:
67 | armatureName = parsedModel.armatureSelected.name;
68 |
69 | importModel.changeBoneParent(armatureName, event.data[0], event.data[1]);
70 |
71 | if(importModel.vo.isImportFromFLA)
72 | {
73 | var armature:XML = importModel.getArmatureList(armatureName)[0].copy();
74 | delete armature[ConstValues.ANIMATION];
75 | delete armature[ConstValues.SKIN];
76 | delete armature[ConstValues.BONE].*;
77 |
78 | jsflService.runJSFLMethod(null, "dragonBones.DragonBones.changeArmatureConnection", parsedModel.vo.importVO.id, armatureName, armature);
79 | }
80 | break;
81 | }
82 | }
83 | }
84 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/RemoveArmatureCommand.as:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelLib/src/core/controller/RemoveArmatureCommand.as
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/SettingStartupCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import core.events.ControllerEvent;
4 | import core.events.ServiceEvent;
5 | import core.SettingManager;
6 | import core.service.JSFLService;
7 | import core.suppotClass._BaseCommand;
8 |
9 | public final class SettingStartupCommand extends _BaseCommand
10 | {
11 | [Inject]
12 | public var event:ControllerEvent
13 |
14 | [Inject]
15 | public var jsflService:JSFLService;
16 |
17 | private var _settingManager:SettingManager;
18 |
19 | override public function execute():void
20 | {
21 | _settingManager = SettingManager.getInstance();
22 | var languageID:int = _settingManager.languageIndex;
23 | if(languageID >= 0)
24 | {
25 | // flash setter bug
26 | _settingManager.languageIndex = 1;
27 | _settingManager.languageIndex = 0;
28 | _settingManager.languageIndex = languageID;
29 | }
30 | else if (JSFLService.isAvailable)
31 | {
32 | jsflService.runJSFLCode(null, "fl.languageCode;", jsflProxyHandler);
33 | function jsflProxyHandler(e:ServiceEvent):void
34 | {
35 | var languageCode:String = e.data;
36 | var length:int = _settingManager.languageAC.length;
37 | for(var i:int = 0; i < length; i++)
38 | {
39 | if(_settingManager.languageAC[i].value == languageCode)
40 | {
41 | // flash setter bug
42 | _settingManager.languageIndex = 1;
43 | _settingManager.languageIndex = 0;
44 | _settingManager.languageIndex = i;
45 | return;
46 | }
47 | }
48 | // flash setter bug
49 | _settingManager.languageIndex = 1;
50 | _settingManager.languageIndex = 0;
51 | }
52 | }
53 | else
54 | {
55 | // flash setter bug
56 | _settingManager.languageIndex = 1;
57 | _settingManager.languageIndex = 0;
58 | }
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/controller/ViewCommand.as:
--------------------------------------------------------------------------------
1 | package core.controller
2 | {
3 | import core.SettingManager;
4 | import core.events.ControllerEvent;
5 | import core.events.MediatorEvent;
6 | import core.model.ParsedModel;
7 | import core.model.vo.ImportVO;
8 | import core.suppotClass._BaseCommand;
9 | import core.utils.GlobalConstValues;
10 |
11 | public final class ViewCommand extends _BaseCommand
12 | {
13 | [Inject]
14 | public var parsedModel:ParsedModel;
15 |
16 | [Inject]
17 | public var event:MediatorEvent;
18 |
19 | private var _settingManager:SettingManager;
20 |
21 | override public function execute():void
22 | {
23 | _settingManager = SettingManager.getInstance();
24 |
25 | switch(event.type)
26 | {
27 | case MediatorEvent.UPDATE_FLA_ARMATURE:
28 | if(parsedModel.vo.importVO)
29 | {
30 | var importVO:ImportVO = new ImportVO();
31 | _settingManager.setImportVOValues(importVO);
32 | importVO.importType = GlobalConstValues.IMPORT_TYPE_FLA_ALL_LIBRARY_ITEMS;
33 | importVO.isToMerge = true;
34 | importVO.id = parsedModel.vo.importVO.id;
35 | importVO.flaItems = new Vector.;
36 | importVO.flaItems.push(event.data);
37 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.IMPORT_FLA, importVO));
38 | }
39 |
40 | break;
41 |
42 | case MediatorEvent.REMOVE_ARMATURE:
43 | this.dispatcher.dispatchEvent(new ControllerEvent(ControllerEvent.REMOVE_ARMATURE, event.data));
44 | break;
45 |
46 | }
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/events/ControllerEvent.as:
--------------------------------------------------------------------------------
1 | package core.events
2 | {
3 | import flash.events.Event;
4 |
5 | public final class ControllerEvent extends Event
6 | {
7 | public static const STARTUP:String = "startup";
8 |
9 | public static const SETTING_STARTUP:String = "settingStartup";
10 |
11 | public static const IMPORT_FLA:String = "importFLA";
12 | public static const IMPORT_FILE:String = "importFile";
13 | public static const EXPORT_FILE:String = "exportFile";
14 |
15 | public static const IMPORT_CANCLE:String = "importCancle";
16 | public static const IMPORT_ERROR:String = "importError";
17 | public static const IMPORT_PROGRESS:String = "importProgress";
18 | public static const IMPORT_COMPLETE:String = "importComplete";
19 |
20 | public static const EXPORT_CANCEL:String = "exportCancle";
21 | public static const EXPORT_ERROR:String = "exportError";
22 | public static const EXPORT_COMPLETE:String = "exportComplete";
23 |
24 | public static const REMOVE_ARMATURE:String = "removeArmature";
25 |
26 | public static const CREATE_ANIMATION_TO_FLASH:String = "createAnimationToFlash";
27 | public static const MULTIPLE_IMPORT_AND_EXPORT:String = "multipleImportAndExport";
28 |
29 | public var data:*;
30 |
31 | public function ControllerEvent(type:String, data:* = null, bubbles:Boolean = false, cancelable:Boolean = false)
32 | {
33 | super(type, bubbles, cancelable);
34 |
35 | this.data = data;
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/events/MediatorEvent.as:
--------------------------------------------------------------------------------
1 | package core.events
2 | {
3 | import flash.events.Event;
4 |
5 | public final class MediatorEvent extends Event
6 | {
7 | public static const UPDATE_FLA_ARMATURE:String = "v_updateFlaArmature";
8 | public static const REMOVE_ARMATURE:String = "v_removeArmature";
9 |
10 | public static const ROLL_OVER_BONE:String = "v_rollOverBone";
11 | public static const ROLL_OUT_BONE:String = "v_rollOutBone";
12 |
13 | public var mediator:Object;
14 | public var data:*;
15 |
16 | public function MediatorEvent(type:String, mediator:Object = null, data:* = null, bubbles:Boolean=false, cancelable:Boolean=false)
17 | {
18 | super(type, bubbles, cancelable);
19 | this.mediator = mediator;
20 | this.data = data;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/events/ModelEvent.as:
--------------------------------------------------------------------------------
1 | package core.events
2 | {
3 | import flash.events.Event;
4 |
5 | import core.suppotClass._BaseModel;
6 |
7 | public final class ModelEvent extends Event
8 | {
9 | //parsed model event
10 | public static const PARSED_MODEL_DATA_CHANGE:String = "PARSED_MODEL_DATA_CHANGE";
11 | public static const PARSED_MODEL_ARMATURE_CHANGE:String = "PARSED_MODEL_ARMATURE_CHANGE";
12 | public static const PARSED_MODEL_SKIN_CHANGE:String = "PARSED_MODEL_SKIN_CHANGE";
13 | public static const PARSED_MODEL_ANIMATION_CHANGE:String = "PARSED_MODEL_ANIMATION_CHANGE";
14 | public static const PARSED_MODEL_BONE_CHANGE:String = "PARSED_MODEL_BONE_CHANGE";
15 | public static const PARSED_MODEL_ANIMATION_DATA_CHANGE:String = "PARSED_MODEL_ANIMATION_DATA_CHANG";
16 | public static const PARSED_MODEL_BONE_PARENT_CHANGE:String = "PARSED_MODEL_BONE_PARENT_CHANGE";
17 | public static const PARSED_MODEL_TIMELINE_DATA_CHANGE:String = "PARSED_MODEL_TIMELINE_DATA_CHANG";
18 |
19 | public var model:_BaseModel;
20 | public var data:*;
21 |
22 | public function ModelEvent(type:String, model:_BaseModel, data:* = null, bubbles:Boolean=false, cancelable:Boolean=false)
23 | {
24 | super(type, bubbles, cancelable);
25 |
26 | this.model = model;
27 | this.data = data;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/events/ServiceEvent.as:
--------------------------------------------------------------------------------
1 | package core.events
2 | {
3 | import flash.events.Event;
4 |
5 | public final class ServiceEvent extends Event
6 | {
7 | public var data:*;
8 | public function ServiceEvent(type:String, data:* = null, bubbles:Boolean=false, cancelable:Boolean=false)
9 | {
10 | super(type, bubbles, cancelable);
11 | this.data = data;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/events/ViewEvent.as:
--------------------------------------------------------------------------------
1 | package core.events
2 | {
3 | import flash.events.Event;
4 |
5 | public final class ViewEvent extends Event
6 | {
7 | public static const BONE_SELECTED_CHANGE:String = "BONE_SELECTED_CHANGE";
8 | public static const BONE_PARENT_CHANGE:String = "BONE_PARENT_CHANGE";
9 | public static const ARMATURE_ANIMATION_CHANGE:String = "ARMATURE_ANIMATION_CHANGE";
10 |
11 | public var data:*;
12 |
13 | public function ViewEvent(type:String, data:* = null, bubbles:Boolean=false, cancelable:Boolean=false)
14 | {
15 | super(type, bubbles, cancelable);
16 |
17 | this.data = data;
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/mediator/AnimationControlViewMediator.as:
--------------------------------------------------------------------------------
1 | package core.mediator
2 | {
3 | import core.events.ModelEvent;
4 | import core.model.ParsedModel;
5 | import core.suppotClass._BaseMediator;
6 | import core.view.AnimationControlView;
7 |
8 | import flash.events.Event;
9 | import flash.events.MouseEvent;
10 |
11 | import mx.binding.utils.BindingUtils;
12 |
13 | public final class AnimationControlViewMediator extends _BaseMediator
14 | {
15 | [Inject]
16 | public var parsedModel:ParsedModel;
17 |
18 | [Inject]
19 | public var view:AnimationControlView;
20 |
21 | override public function initialize():void
22 | {
23 | super.initialize();
24 |
25 | this.addContextListener(ModelEvent.PARSED_MODEL_DATA_CHANGE, modelHandler);
26 | this.addContextListener(ModelEvent.PARSED_MODEL_ARMATURE_CHANGE, modelHandler);
27 | this.addContextListener(ModelEvent.PARSED_MODEL_ANIMATION_CHANGE, modelHandler);
28 |
29 | resetUI();
30 |
31 | BindingUtils.bindProperty(view.animationList, "selectedItem", parsedModel, "animationSelected", false);
32 | BindingUtils.bindProperty(parsedModel, "animationSelected", view.animationList, "selectedItem", false);
33 |
34 | view.numFadeInTime.addEventListener(Event.CHANGE, animationControlHandler);
35 | view.numAnimationScale.addEventListener(Event.CHANGE, animationControlHandler);
36 | view.numLoop.addEventListener(Event.CHANGE, animationControlHandler);
37 | view.checkAutoTween.addEventListener(Event.CHANGE, animationControlHandler);
38 | //view.numTweenEasing.addEventListener(Event.CHANGE, animationControlHandler);
39 | //view.checkTweenEasing.addEventListener(Event.CHANGE, animationControlHandler);
40 | }
41 |
42 | override public function destroy():void
43 | {
44 | super.destroy();
45 |
46 | this.removeContextListener(ModelEvent.PARSED_MODEL_DATA_CHANGE, modelHandler);
47 | this.removeContextListener(ModelEvent.PARSED_MODEL_ANIMATION_CHANGE, modelHandler)
48 |
49 | view.numFadeInTime.removeEventListener(Event.CHANGE, animationControlHandler);
50 | view.numAnimationScale.removeEventListener(Event.CHANGE, animationControlHandler);
51 | view.numLoop.removeEventListener(Event.CHANGE, animationControlHandler);
52 | view.checkAutoTween.removeEventListener(Event.CHANGE, animationControlHandler);
53 | //view.numTweenEasing.addEventListener(Event.CHANGE, animationControlHandler);
54 | //view.checkTweenEasing.addEventListener(Event.CHANGE, animationControlHandler);
55 | }
56 |
57 | private function resetUI():void
58 | {
59 | view.enabled = false;
60 | view.animationList.dataProvider = parsedModel.animationsAC;
61 | view.animationList.selectedItem = null;
62 | }
63 |
64 | private function modelHandler(e:ModelEvent):void
65 | {
66 | if(parsedModel != e.model)
67 | {
68 | return;
69 | }
70 |
71 | switch(e.type)
72 | {
73 | case ModelEvent.PARSED_MODEL_DATA_CHANGE:
74 | break;
75 | case ModelEvent.PARSED_MODEL_ARMATURE_CHANGE:
76 | if(!parsedModel.armatureSelected)
77 | {
78 | resetUI();
79 | }
80 | break;
81 | case ModelEvent.PARSED_MODEL_ANIMATION_CHANGE:
82 | if(parsedModel.animationSelected)
83 | {
84 | view.enabled = true;
85 |
86 | var isMultipleFrameAnimation:Boolean = parsedModel.isMultipleFrameAnimation;
87 |
88 | view.numFadeInTime.value = parsedModel.fadeInTime;
89 |
90 | if(isMultipleFrameAnimation)
91 | {
92 | view.numAnimationScale.value = parsedModel.animationScale * 100;
93 | view.numAnimationScale.enabled = true;
94 | view.numAnimationTotalTime.text = parsedModel.durationScaled.toString();
95 | view.numLoop.enabled = true;
96 | view.numLoop.value = parsedModel.playTimes;
97 |
98 | view.checkAutoTween.enabled = true;
99 | view.checkAutoTween.selected = parsedModel.autoTween;
100 |
101 | /*view.checkTweenEasing.enabled = true;
102 | if(isNaN(tweenEasing))
103 | {
104 | view.checkTweenEasing.selected = false;
105 | view.numTweenEasing.enabled = false;
106 | view.numTweenEasing.value = 0;
107 | }
108 | else
109 | {
110 | view.checkTweenEasing.selected = true;
111 | view.numTweenEasing.enabled = true;
112 | view.numTweenEasing.value = tweenEasing;
113 | }*/
114 | }
115 | else
116 | {
117 | view.numAnimationScale.enabled = false;
118 | view.numAnimationScale.value = 100;
119 | view.numAnimationTotalTime.text = "0";
120 | view.numLoop.enabled = false;
121 | view.numLoop.value = 1;
122 | view.checkAutoTween.enabled = false;
123 | view.checkAutoTween.selected = false;
124 | //view.checkTweenEasing.enabled = false;
125 | //view.numTweenEasing.enabled = false;
126 | }
127 | }
128 | else
129 | {
130 | view.enabled = false;
131 | }
132 | break;
133 | }
134 | }
135 |
136 | private function animationControlHandler(e:Event):void
137 | {
138 | switch(e.target)
139 | {
140 | case view.numFadeInTime:
141 | parsedModel.fadeInTime = view.numFadeInTime.value;
142 | view.numFadeInTime.value = parsedModel.fadeInTime;
143 | break;
144 |
145 | case view.numAnimationScale:
146 | parsedModel.animationScale = view.numAnimationScale.value * 0.01;
147 | view.numAnimationScale.value = parsedModel.animationScale * 100;
148 | view.numAnimationTotalTime.text = parsedModel.durationScaled.toString();;
149 | break;
150 |
151 | case view.numLoop:
152 | parsedModel.playTimes = view.numLoop.value;
153 | view.numLoop.value = parsedModel.playTimes;
154 | break;
155 |
156 | case view.checkAutoTween:
157 | parsedModel.autoTween = view.checkAutoTween.selected;
158 | break;
159 |
160 | /*
161 | case view.numTweenEasing:
162 | model.tweenEasing = view.numTweenEasing.value;
163 | break;
164 |
165 | case view.checkTweenEasing:
166 | if(view.checkTweenEasing.selected)
167 | {
168 | model.tweenEasing = 0;
169 | }
170 | else
171 | {
172 | model.tweenEasing = NaN;
173 | }
174 | break;
175 | */
176 | }
177 | }
178 | }
179 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/mediator/BoneControlViewMediator.as:
--------------------------------------------------------------------------------
1 | package core.mediator
2 | {
3 | import flash.events.Event;
4 |
5 | import mx.events.DragEvent;
6 | import mx.events.ListEvent;
7 |
8 | import core.events.MediatorEvent;
9 | import core.events.ModelEvent;
10 | import core.model.ParsedModel;
11 | import core.suppotClass._BaseMediator;
12 | import core.view.BoneControlView;
13 |
14 | public final class BoneControlViewMediator extends _BaseMediator
15 | {
16 | [Inject]
17 | public var parsedModel:ParsedModel;
18 |
19 | [Inject]
20 | public var view:BoneControlView;
21 |
22 | override public function initialize():void
23 | {
24 | super.initialize();
25 |
26 | this.addContextListener(ModelEvent.PARSED_MODEL_DATA_CHANGE, modelHandler);
27 | this.addContextListener(ModelEvent.PARSED_MODEL_ARMATURE_CHANGE, modelHandler);
28 | this.addContextListener(ModelEvent.PARSED_MODEL_ANIMATION_CHANGE, modelHandler);
29 | this.addContextListener(ModelEvent.PARSED_MODEL_BONE_CHANGE, modelHandler);
30 | this.addContextListener(ModelEvent.PARSED_MODEL_BONE_PARENT_CHANGE, modelHandler);
31 |
32 | resetUI();
33 |
34 | view.boneTree.addEventListener(ListEvent.CHANGE, boneTreeHandler);
35 | view.boneTree.addEventListener(DragEvent.DRAG_COMPLETE, boneTreeHandler);
36 | view.boneTree.addEventListener(ListEvent.ITEM_ROLL_OVER, boneTreeHandler);
37 | view.boneTree.addEventListener(ListEvent.ITEM_ROLL_OUT, boneTreeHandler);
38 | view.numOffset.addEventListener(Event.CHANGE, timelineControlHandler);
39 | view.numScale.addEventListener(Event.CHANGE, timelineControlHandler);
40 | }
41 |
42 | override public function destroy():void
43 | {
44 | super.destroy();
45 |
46 | this.removeContextListener(ModelEvent.PARSED_MODEL_DATA_CHANGE, modelHandler);
47 | this.removeContextListener(ModelEvent.PARSED_MODEL_ANIMATION_CHANGE, modelHandler);
48 | this.removeContextListener(ModelEvent.PARSED_MODEL_BONE_CHANGE, modelHandler);
49 | this.removeContextListener(ModelEvent.PARSED_MODEL_BONE_PARENT_CHANGE, modelHandler);
50 |
51 | view.boneTree.removeEventListener(ListEvent.CHANGE, boneTreeHandler);
52 | view.boneTree.removeEventListener(DragEvent.DRAG_COMPLETE, boneTreeHandler);
53 | view.boneTree.removeEventListener(ListEvent.ITEM_ROLL_OVER, boneTreeHandler);
54 | view.boneTree.removeEventListener(ListEvent.ITEM_ROLL_OUT, boneTreeHandler);
55 | view.numOffset.removeEventListener(Event.CHANGE, timelineControlHandler);
56 | view.numScale.removeEventListener(Event.CHANGE, timelineControlHandler);
57 | }
58 |
59 | private function resetUI():void
60 | {
61 | view.enabled = false;
62 | view.boneTree.dataProvider = parsedModel.bonesMC;
63 | }
64 |
65 | private function modelHandler(e:ModelEvent):void
66 | {
67 | switch(e.type)
68 | {
69 | case ModelEvent.PARSED_MODEL_DATA_CHANGE:
70 | break;
71 | case ModelEvent.PARSED_MODEL_ARMATURE_CHANGE:
72 | if(!parsedModel.armatureSelected)
73 | {
74 | resetUI();
75 | }
76 | break;
77 | case ModelEvent.PARSED_MODEL_ANIMATION_CHANGE:
78 | updateTimelineControl();
79 | break;
80 |
81 | case ModelEvent.PARSED_MODEL_BONE_CHANGE:
82 | updateTimelineControl();
83 | view.boneTree.selectItemByName(parsedModel.boneSelected?parsedModel.boneSelected.name:null);
84 | break;
85 |
86 | case ModelEvent.PARSED_MODEL_BONE_PARENT_CHANGE:
87 | view.boneTree.selectItemByName(parsedModel.boneSelected?parsedModel.boneSelected.name:null);
88 | break;
89 |
90 | }
91 | }
92 |
93 | private function boneTreeHandler(e:Event):void
94 | {
95 | var boneName:String;
96 | switch(e.type)
97 | {
98 | case ListEvent.CHANGE:
99 | var bone:XML = view.boneTree.selectedItem as XML;
100 | boneName = bone?bone.@name:"";
101 | parsedModel.boneSelected = parsedModel.armatureSelected.getBoneData(boneName);
102 | break;
103 |
104 | case DragEvent.DRAG_COMPLETE:
105 | if(view.boneTree.lastMoveNode)
106 | {
107 | boneName = view.boneTree.lastMoveNode.@name;
108 | var boenParent:XML = view.boneTree.lastMoveNode.parent();
109 | var parentName:String = boenParent.@name;
110 | if(boenParent.localName() != view.boneTree.lastMoveNode.localName())
111 | {
112 | parentName = null;
113 | }
114 |
115 | parsedModel.changeBoneParent(boneName, parentName);
116 | }
117 | break;
118 |
119 | case ListEvent.ITEM_ROLL_OVER:
120 | boneName = (e as ListEvent).itemRenderer.data.@name;
121 |
122 | this.dispatch(new MediatorEvent(MediatorEvent.ROLL_OVER_BONE, this, boneName));
123 | break;
124 |
125 | case ListEvent.ITEM_ROLL_OUT:
126 | boneName = (e as ListEvent).itemRenderer.data.@name;
127 |
128 | this.dispatch(new MediatorEvent(MediatorEvent.ROLL_OUT_BONE, this, boneName));
129 | break;
130 | }
131 | }
132 |
133 | private function timelineControlHandler(e:Event):void
134 | {
135 | switch(e.target)
136 | {
137 | case view.numScale:
138 | parsedModel.timelineScale = isNaN(view.numScale.value)?0:view.numScale.value;
139 | break;
140 |
141 | case view.numOffset:
142 | parsedModel.timelineOffset = isNaN(view.numOffset.value)?0:view.numOffset.value;
143 | break;
144 | }
145 | }
146 |
147 | private function updateTimelineControl():void
148 | {
149 | view.enabled = true;
150 | var isMultipleFrameAnimation:Boolean = parsedModel.isMultipleFrameAnimation;
151 | if(parsedModel.animationSelected && parsedModel.boneSelected && isMultipleFrameAnimation)
152 | {
153 | var timelineScale:Number = parsedModel.timelineScale;
154 | var timelineOffset:Number = parsedModel.timelineOffset;
155 | view.numScale.enabled = true;
156 | view.numScale.value = timelineScale;
157 |
158 | view.numOffset.enabled = true;
159 | view.numOffset.value = timelineOffset;
160 | }
161 | else
162 | {
163 | view.numScale.enabled = false;
164 | view.numScale.value = 100;
165 | view.numOffset.enabled = false;
166 | view.numOffset.value = 0;
167 | }
168 | }
169 | }
170 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/model/vo/ExportVO.as:
--------------------------------------------------------------------------------
1 | package core.model.vo
2 | {
3 | public final class ExportVO
4 | {
5 | public var textureAtlasType:String = null;
6 | public var configType:String = null;
7 | public var dataType:String = null;
8 | public var enableDataOptimization:Boolean = false;
9 | public var scale:Number = 1;
10 | public var enableBackgroundColor:Boolean = false;
11 | public var backgroundColor:uint = 0xff00ff;
12 |
13 |
14 | public var name:String = null;
15 | public var dragonBonesFileName:String = null;
16 | public var textureAtlasConfigFileName:String = null;
17 | public var textureAtlasFileName:String = null;
18 | public var subTextureFolderName:String = null;
19 |
20 | //
21 | public var exportPath:String = null;
22 |
23 | private var _textureAtlasPath:String = null;
24 | public function get textureAtlasPath():String
25 | {
26 | return _textureAtlasPath || "";
27 | }
28 | public function set textureAtlasPath(value:String):void
29 | {
30 | if (value)
31 | {
32 | _textureAtlasPath = value
33 | .replace(/\\/g,"/")
34 | .replace(/\/+$/,"")
35 | +"/";
36 | }
37 | else
38 | {
39 | _textureAtlasPath = null;
40 | }
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/model/vo/ImportVO.as:
--------------------------------------------------------------------------------
1 | package core.model.vo
2 | {
3 | import flash.display.BitmapData;
4 | import flash.display.DisplayObjectContainer;
5 | import flash.utils.ByteArray;
6 |
7 | import core.utils.GlobalConstValues;
8 |
9 | public final class ImportVO
10 | {
11 | //导入数据的唯一标识
12 | public var id:String = null;
13 |
14 | //数据的名称
15 | public var name:String = null;
16 |
17 | //数据的url
18 | public var url:String = null;
19 |
20 | //
21 | public var typeFilter:Array = null;
22 |
23 | //数据的导入类型,allLibraryItemsselected, LibraryItems, exportedData
24 | public var importType:String = null;
25 |
26 | //配置文件类型,amf3,json,xml
27 | public var configType:String = null;
28 |
29 | //资源贴图类型,swf,png,pngs
30 | public var textureAtlasType:String = null;
31 |
32 | //数据类型,相对数据,绝对数据
33 | public var dataType:String = null;
34 |
35 | //只导入数组中存在的
36 | public var flaItems:Vector. = null;
37 |
38 | //是否在倒入完成后合并
39 | public var isToMerge:Boolean = false;
40 |
41 | //加载的原始数据
42 | public var data:ByteArray = null;
43 |
44 | //
45 | public var textureAtlasWidth:uint = 0;
46 | public var textureAtlasPadding:uint = 0;
47 | public var fadeInTime:Number = 0;
48 |
49 | public var skeleton:XML = null;
50 | public var textureAtlasConfig:XML = null;
51 | public var textureAtlasBytes:ByteArray = null;
52 |
53 | public var textureAtlasSWF:DisplayObjectContainer = null
54 | public var textureAtlas:BitmapData = null;
55 |
56 | public function get isImportFromFLA():Boolean
57 | {
58 | return importType == GlobalConstValues.IMPORT_TYPE_FLA_ALL_LIBRARY_ITEMS || importType == GlobalConstValues.IMPORT_TYPE_FLA_SELECTED_LIBRARY_ITEMS;
59 | }
60 |
61 | public function ImportVO()
62 | {
63 | textureAtlasWidth = 0;
64 | textureAtlasPadding = 2;
65 | }
66 |
67 | public function dispose():void
68 | {
69 | data = null;
70 | skeleton = null;
71 | textureAtlasConfig = null;
72 | textureAtlasSWF = null;
73 |
74 | if(textureAtlasBytes)
75 | {
76 | textureAtlasBytes.clear();
77 | textureAtlasBytes = null;
78 | }
79 |
80 | if(textureAtlas)
81 | {
82 | textureAtlas.dispose();
83 | textureAtlas = null;
84 | }
85 | }
86 |
87 | public function clone():ImportVO
88 | {
89 | var importVO:ImportVO = new ImportVO();
90 |
91 | importVO.id = id;
92 | importVO.name = name;
93 | importVO.url = url;
94 | importVO.importType = importType;
95 | importVO.configType = configType;
96 | importVO.textureAtlasType = textureAtlasType;
97 | importVO.dataType = dataType;
98 | importVO.typeFilter = typeFilter;
99 | importVO.flaItems = flaItems;
100 | importVO.isToMerge = isToMerge;
101 | importVO.textureAtlasWidth = textureAtlasWidth;
102 | importVO.textureAtlasPadding = textureAtlasPadding;
103 | importVO.fadeInTime = fadeInTime;
104 |
105 | if(skeleton)
106 | {
107 | importVO.skeleton = skeleton.copy();
108 | }
109 | if(textureAtlasConfig)
110 | {
111 | importVO.textureAtlasConfig = textureAtlasConfig.copy();
112 | }
113 |
114 |
115 | // 是否需要深度拷贝
116 | importVO.data = data;
117 | importVO.textureAtlasBytes = textureAtlasBytes;
118 | importVO.textureAtlasSWF = textureAtlasSWF;
119 | importVO.textureAtlas = textureAtlas;
120 |
121 | return importVO;
122 | }
123 | }
124 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/model/vo/ParsedVO.as:
--------------------------------------------------------------------------------
1 | package core.model.vo
2 | {
3 | import dragonBones.objects.SkeletonData;
4 | import dragonBones.textures.NativeTextureAtlas;
5 |
6 | public final class ParsedVO
7 | {
8 | public var importVO:ImportVO = null;
9 |
10 | public var skeleton:SkeletonData = null;
11 | public var textureAtlas:NativeTextureAtlas = null;
12 |
13 | public function ParsedVO()
14 | {
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/service/JSFLService.as:
--------------------------------------------------------------------------------
1 | package core.service
2 | {
3 | import flash.events.Event;
4 | import flash.events.TimerEvent;
5 | import flash.utils.Timer;
6 |
7 | import adobe.utils.MMExecute;
8 |
9 | import core.events.ServiceEvent;
10 | import core.suppotClass._BaseService;
11 |
12 | import light.events.LDataEvent;
13 | import light.managers.ErrorManager;
14 | import light.net.LocalConnectionClientService;
15 | import light.net.LocalConnectionServerService;
16 | import light.net.RequestGroup;
17 | import light.net.vo.LCVO;
18 |
19 | /**
20 | * Delegate of communicate between UI panel and JSFL
21 | */
22 | public class JSFLService extends _BaseService
23 | {
24 | public static const LOAD_JSFL_FILE_ERROR:String = "LOAD_JSFL_FILE_ERROR";
25 | public static const JSFL_CONNECTION_ERROR:String = "JSFL_CONNECTION_ERROR";
26 |
27 | public static const JSFLs:Vector. = new [
28 | "DragonBonesDesignPanel/utils.jsfl",
29 | "DragonBonesDesignPanel/events.jsfl",
30 | "DragonBonesDesignPanel/dragonBones.jsfl",
31 | "DragonBonesDesignPanel/createAnimation.jsfl",
32 | "DragonBonesDesignPanel/import3DTextures.jsfl"
33 | ];
34 |
35 | private static const PORT_JSFL:String = "portJSFL";
36 |
37 | /**
38 | * Determine if JSFLAPI isAvailable
39 | */
40 | public static function get isAvailable():Boolean
41 | {
42 | try
43 | {
44 | MMExecute("fl;");
45 | return true;
46 | }
47 | catch(e:Error)
48 | {
49 | }
50 | return false;
51 | }
52 |
53 | public static function jsflTrace(...arg):void
54 | {
55 | if(isAvailable)
56 | {
57 | var str:String = "var xml = ;";
58 | str += "fl.trace(xml.text());";
59 | MMExecute(str);
60 | }
61 | else
62 | {
63 | trace.apply(null, arg);
64 | }
65 | }
66 |
67 | [Inject]
68 | public var server:LocalConnectionServerService;
69 |
70 | [Inject]
71 | public var client:LocalConnectionClientService;
72 |
73 | private var _requestGroup:RequestGroup;
74 | private var _timer:Timer;
75 |
76 | private var _prevPort:String;
77 |
78 | private var _callbackMap:Object;
79 |
80 | public function JSFLService()
81 | {
82 | init();
83 | }
84 |
85 | private function init():void
86 | {
87 | _requestGroup = new RequestGroup();
88 | _requestGroup.loadingMaxCount = 1;
89 | _timer = new Timer(2000);
90 |
91 | _callbackMap = {};
92 | }
93 |
94 | public function on():void
95 | {
96 | if(server)
97 | {
98 | server.addPort(PORT_JSFL);
99 | server.addEventListener(LocalConnectionServerService.SERVER_RECEIIVED, serverHandler);
100 | }
101 | else
102 | {
103 | _timer.addEventListener(TimerEvent.TIMER, timerHandler);
104 | _timer.start();
105 | }
106 |
107 | if(client)
108 | {
109 | client.addEventListener(LocalConnectionClientService.CLIENT_RECEIIVED, clientHandler);
110 | client.addEventListener(LocalConnectionClientService.SEND_ERROR, clientErrorHandler);
111 | }
112 |
113 | loadJSFLFile();
114 | }
115 |
116 | public function off():void
117 | {
118 | if(server)
119 | {
120 | server.removePort(PORT_JSFL);
121 | server.removeEventListener(LocalConnectionServerService.SERVER_RECEIIVED, serverHandler);
122 | }
123 | else
124 | {
125 | _timer.removeEventListener(TimerEvent.TIMER, timerHandler);
126 | _timer.stop();
127 | }
128 |
129 | if(client)
130 | {
131 | client.removeEventListener(LocalConnectionClientService.CLIENT_RECEIIVED, clientHandler);
132 | client.removeEventListener(LocalConnectionClientService.SEND_ERROR, clientErrorHandler);
133 | }
134 |
135 | for (var type:String in _callbackMap)
136 | {
137 | this.removeEventListener(type, _callbackMap[type]);
138 | }
139 | _callbackMap = {};
140 | }
141 |
142 | public function loadJSFLFile():void
143 | {
144 | if(isAvailable)
145 | {
146 | for each(var jsflURL:String in JSFLs)
147 | {
148 | _requestGroup.load(jsflURL, jsflLoadHandler);
149 | }
150 | }
151 | }
152 |
153 | public function runJSFLCode(type:String, code:String, callback:Function = null, ...args):void
154 | {
155 | if(client)
156 | {
157 | _prevPort = PORT_JSFL;
158 |
159 | if (callback != null)
160 | {
161 | while (!type || _callbackMap[type])
162 | {
163 | type = "_type_" + Math.random();
164 | }
165 | _callbackMap[type] = {callback:callback, args:args || []};
166 | }
167 | client.send(PORT_JSFL, type, code);
168 | }
169 | }
170 |
171 | public function runJSFLMethod(type:String, method:String, ...args):void
172 | {
173 | var code:String = method + "(";
174 | var callback:Function = null;
175 | var callbackArgs:Array = [];
176 |
177 | for (var i:int = 0, l:int = args.length; i < l; ++i)
178 | {
179 | var arg:* = args[i];
180 |
181 | if(arg is Function)
182 | {
183 | callback = arg;
184 | if (i < l - 1)
185 | {
186 | callbackArgs = args.slice(i + 1);
187 | }
188 | break;
189 | }
190 |
191 | if (i != 0)
192 | {
193 | code += ",";
194 | }
195 |
196 | if(arg is Number || arg is Boolean || arg is RegExp)
197 | {
198 | code += arg;
199 | }
200 | else if(arg is XML)
201 | {
202 | XML.prettyIndent = -1;
203 | code += (arg as XML).toXMLString();
204 | XML.prettyIndent = 1;
205 | }
206 | else
207 | {
208 | code += '"' + arg + '"';
209 | }
210 | }
211 |
212 | code += ');';
213 |
214 | callbackArgs.unshift(type, code, callback);
215 | runJSFLCode.apply(this, callbackArgs);
216 | }
217 |
218 | private function jsflLoadHandler(e:Event):void
219 | {
220 | switch(e.type)
221 | {
222 | case Event.COMPLETE:
223 | MMExecute(e.target.data);
224 | break;
225 |
226 | default:
227 | //light.managers.ErrorManager.getInstance().dispatchErrorEvent(this, LOAD_JSFL_FILE_ERROR, "JSFL文件读取失败!");
228 | break;
229 | }
230 | }
231 |
232 | private function timerHandler(e:Event):void
233 | {
234 | if (client)
235 | {
236 |
237 | }
238 | }
239 |
240 | private function serverHandler(e:LDataEvent):void
241 | {
242 | switch(e.type)
243 | {
244 | case LocalConnectionServerService.SERVER_RECEIIVED:
245 | var vo:LCVO = e.data as LCVO;
246 | var sendVO:LCVO;
247 | if(vo.port == PORT_JSFL)
248 | {
249 | sendVO = vo.clone();
250 | sendVO.data = MMExecute(vo.data.toString());
251 | server.send(sendVO);
252 | }
253 | break;
254 | }
255 | }
256 |
257 | private function clientHandler(e:LDataEvent):void
258 | {
259 | switch(e.type)
260 | {
261 | case LocalConnectionClientService.CLIENT_RECEIIVED:
262 | var vo:LCVO = e.data as LCVO;
263 | if(vo.port == PORT_JSFL)
264 | {
265 | if (vo.type)
266 | {
267 | var serveiceEvent:ServiceEvent = new ServiceEvent(vo.type, vo.data);
268 | this.dispatchEvent(serveiceEvent);
269 |
270 | var callbackData:Object = _callbackMap[vo.type];
271 | if (callbackData != null)
272 | {
273 | callbackData.args.unshift(serveiceEvent);
274 | callbackData.callback.apply(null, callbackData.args);
275 | delete _callbackMap[vo.type];
276 | }
277 | }
278 | }
279 | break;
280 | }
281 | }
282 |
283 | private function clientErrorHandler(e:Event):void
284 | {
285 | light.managers.ErrorManager.getInstance().dispatchErrorEvent(this, JSFL_CONNECTION_ERROR, e.toString());
286 |
287 | client.connectToServer();
288 | }
289 | }
290 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/service/LoadTextureAtlasBytesService.as:
--------------------------------------------------------------------------------
1 | package core.service
2 | {
3 | import flash.display.Bitmap;
4 | import flash.display.BitmapData;
5 | import flash.display.DisplayObjectContainer;
6 | import flash.display.Loader;
7 | import flash.display.LoaderInfo;
8 | import flash.display.MovieClip;
9 | import flash.events.Event;
10 | import flash.system.LoaderContext;
11 |
12 | import core.events.ServiceEvent;
13 | import core.model.vo.ImportVO;
14 | import core.suppotClass._BaseService;
15 | import core.utils.GlobalConstValues;
16 |
17 | public final class LoadTextureAtlasBytesService extends _BaseService
18 | {
19 | public static const TEXTURE_ATLAS_BYTES_LOAD_COMPLETE:String = "TEXTURE_ATLAS_BYTES_LOAD_COMPLETE";
20 | public static const TEXTURE_ATLAS_BYTES_LOAD_ERROR:String = "TEXTURE_ATLAS_BYTES_LOAD_ERROR";
21 |
22 | private var _loaderContext:LoaderContext;
23 | private var _loader:Loader;
24 | private var _importVO:ImportVO;
25 |
26 | public function LoadTextureAtlasBytesService()
27 | {
28 | _loaderContext = new LoaderContext(false);
29 | _loaderContext.allowCodeImport = true;
30 | }
31 |
32 | public function load(importVO:ImportVO):void
33 | {
34 | _importVO = importVO;
35 | _loader = new Loader();
36 |
37 | _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
38 | _loader.loadBytes(_importVO.textureAtlasBytes, _loaderContext);
39 | }
40 |
41 | private function loaderCompleteHandler(e:Event):void
42 | {
43 | var loaderInfo:LoaderInfo = e.target as LoaderInfo;
44 | loaderInfo.removeEventListener(Event.COMPLETE, loaderCompleteHandler);
45 |
46 | if (loaderInfo.content is Bitmap)
47 | {
48 | _importVO.textureAtlasType = GlobalConstValues.TEXTURE_ATLAS_TYPE_PNG;
49 | _importVO.textureAtlas = (loaderInfo.content as Bitmap).bitmapData;
50 | (loaderInfo.content as Bitmap).bitmapData = null;
51 | }
52 | else
53 | {
54 | _importVO.textureAtlasType = GlobalConstValues.TEXTURE_ATLAS_TYPE_SWF;
55 | _importVO.textureAtlasSWF = (loaderInfo.content as DisplayObjectContainer).getChildAt(0) as DisplayObjectContainer;
56 | if(_importVO.textureAtlasSWF is MovieClip)
57 | {
58 | (_importVO.textureAtlasSWF as MovieClip).gotoAndStop(1);
59 | }
60 |
61 | _importVO.textureAtlas = new BitmapData(getNearest2N(_importVO.textureAtlasSWF.width), getNearest2N(_importVO.textureAtlasSWF.height), true, 0xFF00FF);
62 | _importVO.textureAtlas.draw(_importVO.textureAtlasSWF);
63 | }
64 |
65 | this.dispatchEvent(new ServiceEvent(TEXTURE_ATLAS_BYTES_LOAD_COMPLETE, _importVO));
66 | }
67 |
68 | private function getNearest2N(_n:uint):uint
69 | {
70 | return _n & _n - 1?1 << _n.toString(2).length:_n;
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/suppotClass/_BaseCommand.as:
--------------------------------------------------------------------------------
1 | package core.suppotClass
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | import robotlegs.bender.bundles.mvcs.Command;
6 | import robotlegs.bender.extensions.contextView.ContextView;
7 | import robotlegs.bender.extensions.directCommandMap.api.IDirectCommandMap;
8 | import robotlegs.bender.extensions.eventCommandMap.api.IEventCommandMap;
9 | import robotlegs.bender.framework.api.IInjector;
10 |
11 | public class _BaseCommand extends Command
12 | {
13 | [Inject]
14 | public var injector:IInjector;
15 |
16 | [Inject]
17 | public var dispatcher:IEventDispatcher;
18 |
19 | [Inject]
20 | public var commandMap:IEventCommandMap;
21 |
22 | [Inject]
23 | public var directCommandMap:IDirectCommandMap;
24 |
25 | [Inject]
26 | public var contextView:ContextView;
27 | }
28 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/suppotClass/_BaseMediator.as:
--------------------------------------------------------------------------------
1 | package core.suppotClass
2 | {
3 | import robotlegs.bender.bundles.mvcs.Mediator;
4 |
5 | public class _BaseMediator extends Mediator
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/suppotClass/_BaseModel.as:
--------------------------------------------------------------------------------
1 | package core.suppotClass
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | import robotlegs.bender.framework.api.IInjector;
6 |
7 | public class _BaseModel
8 | {
9 | [Inject]
10 | public var injector:IInjector;
11 |
12 | [Inject]
13 | public var dispatcher:IEventDispatcher;
14 | }
15 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/suppotClass/_BaseService.as:
--------------------------------------------------------------------------------
1 | package core.suppotClass
2 | {
3 | import flash.events.EventDispatcher;
4 | import flash.events.IEventDispatcher;
5 |
6 | import robotlegs.bender.framework.api.IInjector;
7 |
8 | public class _BaseService extends EventDispatcher
9 | {
10 | [Inject]
11 | public var injector:IInjector;
12 |
13 | [Inject]
14 | public var dispatcher:IEventDispatcher;
15 | }
16 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/BitmapDataUtil.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | import flash.display.BitmapData;
4 | import flash.display.DisplayObject;
5 | import flash.display.IBitmapDrawable;
6 | import flash.display.Sprite;
7 | import flash.geom.Matrix;
8 | import flash.geom.Rectangle;
9 |
10 | public class BitmapDataUtil
11 | {
12 | public static function getSubBitmapDataDic(bitmapData:BitmapData, rectDic:Object):Object
13 | {
14 | var subBitmapDataDic:Object = {};
15 | for(var subTextureName:String in rectDic)
16 | {
17 | var rect:Rectangle = rectDic[subTextureName];
18 | if(rect.width && rect.height)
19 | {
20 | var matrix:Matrix = new Matrix();
21 | matrix.tx = -rect.x;
22 | matrix.ty = -rect.y;
23 | var subBitmapData:BitmapData = new BitmapData(rect.width, rect.height, true, 0xFF00FF);
24 | subBitmapData.draw(bitmapData, matrix);
25 | subBitmapDataDic[subTextureName] = subBitmapData;
26 | }
27 | }
28 | return subBitmapDataDic;
29 | }
30 |
31 | public static function getMergeBitmapData(subBitmapDataDic:Object, rectDic:Object, width:uint, height:uint, scale:Number = 1):BitmapData
32 | {
33 | var bitmapData:BitmapData = new BitmapData(
34 | width,
35 | height,
36 | true,
37 | 0xFF00FF
38 | );
39 |
40 | var smoothing:Boolean = scale != 1;
41 |
42 | for(var subTextureName:String in subBitmapDataDic)
43 | {
44 | var drawableDisplay:IBitmapDrawable = subBitmapDataDic[subTextureName];
45 | var rect:Rectangle = rectDic[subTextureName];
46 | var matrix:Matrix = new Matrix();
47 | matrix.scale(scale, scale);
48 | matrix.tx = rect.x;
49 | matrix.ty = rect.y;
50 |
51 | if(drawableDisplay is Sprite)
52 | {
53 | var display:DisplayObject = drawableDisplay as DisplayObject;
54 | var rectOffSet:Rectangle = display.getBounds(display);
55 | matrix.tx -= rectOffSet.x * scale;
56 | matrix.ty -= rectOffSet.y * scale;
57 | }
58 |
59 | bitmapData.draw(drawableDisplay, matrix, null, null, rect, smoothing);
60 | if(drawableDisplay is BitmapData)
61 | {
62 | (drawableDisplay as BitmapData).dispose();
63 | }
64 | }
65 | return bitmapData;
66 | }
67 |
68 | public static function byteArrayMapToBitmapDataMap(byteArrayMap:Object, callBack:Function):void
69 | {
70 | new ByteArrayMapToBitmapDataMap(byteArrayMap, callBack);
71 | }
72 | }
73 | }
74 |
75 |
76 |
77 | import flash.display.Bitmap;
78 | import flash.display.BitmapData;
79 | import flash.display.DisplayObject;
80 | import flash.display.IBitmapDrawable;
81 | import flash.display.Loader;
82 | import flash.display.LoaderInfo;
83 | import flash.events.Event;
84 | import flash.geom.Matrix;
85 | import flash.geom.Rectangle;
86 | import flash.system.LoaderContext;
87 | import flash.utils.ByteArray;
88 |
89 | class ByteArrayMapToBitmapDataMap
90 | {
91 | private static var _loaderContext:LoaderContext = new LoaderContext(false);
92 | private static var _holdPool:Vector. = new Vector.;
93 |
94 | _loaderContext.allowCodeImport = true;
95 |
96 | private var _bitmapDataMap:Object;
97 | private var _callback:Function;
98 |
99 | public function ByteArrayMapToBitmapDataMap(byteArrayMap:Object, callBack:Function)
100 | {
101 | _bitmapDataMap = {};
102 | _callback = callBack;
103 |
104 | for(var name:String in byteArrayMap)
105 | {
106 | var byteArray:ByteArray = byteArrayMap[name] as ByteArray;
107 | if(byteArray)
108 | {
109 | var loader:Loader = new Loader();
110 | loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadBitmapDataHandler);
111 | loader.loadBytes(byteArray, _loaderContext);
112 | _bitmapDataMap[name] = loader;
113 | }
114 | }
115 |
116 | _holdPool.push(this);
117 | }
118 |
119 | private function loadBitmapDataHandler(e:Event):void
120 | {
121 | var loaderInfo:LoaderInfo = e.target as LoaderInfo;
122 | loaderInfo.removeEventListener(Event.COMPLETE, loadBitmapDataHandler);
123 |
124 | var notComplete:Boolean;
125 | var loader:Loader = loaderInfo.loader;
126 | for(var name:String in _bitmapDataMap)
127 | {
128 | var content:Object = _bitmapDataMap[name];
129 | if(content == loader)
130 | {
131 | _bitmapDataMap[name] = (loaderInfo.content as Bitmap).bitmapData;
132 | }
133 | else if(content is Loader)
134 | {
135 | notComplete = true;
136 | }
137 | }
138 |
139 | if(!notComplete)
140 | {
141 | if(_callback != null)
142 | {
143 | _callback(_bitmapDataMap);
144 | }
145 |
146 | _bitmapDataMap = null;
147 | _callback = null;
148 |
149 | _holdPool.splice(_holdPool.indexOf(this), 1);
150 | }
151 | }
152 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/DataFormatUtils.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | public class DataFormatUtils
4 | {
5 | public static function xmlToObject(xml:XML, listNames:Vector. = null):Object
6 | {
7 | if (xml == null)
8 | {
9 | return null;
10 | }
11 |
12 | var result:Object;
13 | var isSimpleType:Boolean = false;
14 | if (xml.children().length() > 0 && xml.hasSimpleContent())
15 | {
16 | isSimpleType = true;
17 | result = ComplexString.simpleType(xml.toString());
18 | }
19 | else if (xml.hasComplexContent())
20 | {
21 | result = {};
22 | for each(var childXML:XML in xml.elements())
23 | {
24 | var objectName:String = childXML.localName();
25 | var object:Object = xmlToObject(childXML, listNames);
26 | var existing:Object = result[objectName];
27 | if (existing != null)
28 | {
29 | if (existing is Array)
30 | {
31 | existing.push(object);
32 | }
33 | else
34 | {
35 | existing = [existing];
36 | existing.push(object);
37 | result[objectName] = existing;
38 | }
39 | }
40 | else if(listNames && listNames.indexOf(objectName) >= 0)
41 | {
42 | result[objectName] = [object];
43 | }
44 | else
45 | {
46 | result[objectName] = object;
47 | }
48 | }
49 | }
50 |
51 | for each(var attributeXML:XML in xml.attributes())
52 | {
53 | /*if (attribute == "xmlns" || attribute.indexOf("xmlns:") != -1)
54 | {
55 | continue;
56 | }*/
57 | if (result == null)
58 | {
59 | result = {};
60 | }
61 | if (isSimpleType && !(result is ComplexString))
62 | {
63 | result = new ComplexString(result.toString());
64 | isSimpleType = false;
65 | }
66 | var attributeName:String = attributeXML.localName();
67 | result[attributeName] = ComplexString.simpleType(attributeXML.toString());
68 | }
69 | return result;
70 | }
71 |
72 | public static function objectToXML(object:*, rootName:String = "root"):XML
73 | {
74 | var xml:XML = ;
75 | _objectToXML(xml, rootName, object);
76 | return xml.children()[0];
77 | }
78 |
79 | private static function _objectToXML(xml:XML, name:String, value:*):void
80 | {
81 |
82 | switch(value)
83 | {
84 | case true:
85 | case false:
86 | case null:
87 | case undefined:
88 | xml.@[name]=value;
89 | break;
90 | default:
91 | if(
92 | value is Number ||
93 | value is String
94 | )
95 | {
96 | xml.@[name]=value;
97 | }
98 | else
99 | {
100 | if(value is Array)
101 | {
102 | for each(var subValue:* in value)
103 | {
104 | switch(subValue)
105 | {
106 | case true:
107 | case false:
108 | case null:
109 | case undefined:
110 | xml.appendChild(<{name}>{subValue}{name}>);
111 | break;
112 | default:
113 | if(
114 | subValue is Number ||
115 | subValue is String
116 | )
117 | {
118 | xml.appendChild(<{name}>{subValue}{name}>);
119 | }
120 | else
121 | {
122 | if(subValue is Array)
123 | {
124 | var node:XML = <{name}/>;
125 | xml.appendChild(node);
126 | _objectToXML(node,name,subValue);
127 | }
128 | else
129 | {
130 | _objectToXML(xml,name,subValue);
131 | }
132 | }
133 | break;
134 | }
135 | }
136 | }
137 | else
138 | {
139 | node = <{name}/>;
140 | xml.appendChild(node);
141 | for(name in value)
142 | {
143 | _objectToXML(node, name, value[name]);
144 | }
145 | }
146 | }
147 | break;
148 | }
149 | }
150 | }
151 | }
152 |
153 | dynamic class ComplexString
154 | {
155 | public var value:String;
156 |
157 | public function ComplexString(val:String)
158 | {
159 | value = val;
160 | }
161 |
162 | public function toString():String
163 | {
164 | return value;
165 | }
166 |
167 | public function valueOf():Object
168 | {
169 | return simpleType(value);
170 | }
171 |
172 | public static function simpleType(value:Object):Object
173 | {
174 | switch(value)
175 | {
176 | case "NaN":
177 | return NaN;
178 | case "true":
179 | return true;
180 | case "false":
181 | return false;
182 | case "null":
183 | return null;
184 | case "undefined":
185 | return undefined;
186 | }
187 | if (isNaN(Number(value)))
188 | {
189 | return value;
190 | }
191 | return Number(value);
192 | }
193 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/GlobalConstValues.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | import dragonBones.core.DragonBones;
4 | import dragonBones.utils.ConstValues;
5 |
6 | import flash.net.FileFilter;
7 | import flash.utils.ByteArray;
8 |
9 | public class GlobalConstValues
10 | {
11 | // import type
12 | public static const IMPORT_TYPE_NONE:String = "none";
13 | public static const IMPORT_TYPE_FLA_ALL_LIBRARY_ITEMS:String = "allLibraryItems";
14 | public static const IMPORT_TYPE_FLA_SELECTED_LIBRARY_ITEMS:String = "selectedItems";
15 | public static const IMPORT_TYPE_EXPORTED:String = "exportedData";
16 |
17 | //configType
18 | public static const CONFIG_TYPE_MERGED:String = "dataMerged";
19 | public static const CONFIG_TYPE_AMF3:String = "dataAmf3";
20 | public static const CONFIG_TYPE_XML:String = "dataXml";
21 | public static const CONFIG_TYPE_JSON:String = "dataJson";
22 |
23 | // texture atlas type
24 | public static const TEXTURE_ATLAS_TYPE_SWF:String = "textureSwf";
25 | public static const TEXTURE_ATLAS_TYPE_PNG:String = "texturePng";
26 | public static const TEXTURE_ATLAS_TYPE_PNGS:String = "texturePngs";
27 |
28 | //dataType
29 | public static const DATA_TYPE_GLOBAL:String = "dataTypeGlobal";
30 | public static const DATA_TYPE_PARENT:String = "dataTypeParent";
31 |
32 | // suffix
33 | public static const XML_SUFFIX:String = "xml";
34 | public static const JSON_SUFFIX:String = "json";
35 | public static const AMF3_SUFFIX:String = "amf3";
36 | public static const SWF_SUFFIX:String = "swf";
37 | public static const PNG_SUFFIX:String = "png";
38 | public static const DBSWF_SUFFIX:String = "dbswf";
39 | public static const ZIP_SUFFIX:String = "zip";
40 | public static const JPG_SUFFIX:String = "jpg";
41 | public static const ATF_SUFFIX:String = "atf";
42 |
43 | // file name
44 | public static const DRAGON_BONES_DATA_NAME:String = "skeleton";
45 | public static const TEXTURE_ATLAS_DATA_NAME:String = "texture";
46 |
47 | public static const SPINE_FOLDER:String = "spine";
48 |
49 | //
50 | public static const A_MATRIX3D:String = "matrix3D";
51 |
52 | // file filter
53 | public static const FILE_FILTER_ARRAY:Array = [new FileFilter("Exported Data", "*." + String([XML_SUFFIX, JSON_SUFFIX, AMF3_SUFFIX, SWF_SUFFIX, PNG_SUFFIX, DBSWF_SUFFIX, ZIP_SUFFIX]).replace(/\,/g, ";*."))];
54 |
55 | //
56 | public static const XML_LIST_NAMES:Vector. =
57 | new [
58 | ConstValues.ARMATURE,
59 | ConstValues.BONE,
60 | ConstValues.SKIN,
61 | ConstValues.SLOT,
62 | ConstValues.DISPLAY,
63 | ConstValues.ANIMATION,
64 | ConstValues.TIMELINE,
65 | ConstValues.FRAME,
66 | ConstValues.SUB_TEXTURE,
67 | ConstValues.ELLIPSE,
68 | ConstValues.RECTANGLE
69 | ];
70 |
71 |
72 | public static function getFileType(bytes:ByteArray):String
73 | {
74 | var type:String = null;
75 | var b1:uint = bytes[0];
76 | var b2:uint = bytes[1];
77 | var b3:uint = bytes[2];
78 | var b4:uint = bytes[3];
79 |
80 | if ((b1 == 0x46 || b1 == 0x43 || b1 == 0x5A) && b2 == 0x57 && b3 == 0x53)
81 | {
82 | //CWS FWS ZWS
83 | type = SWF_SUFFIX;
84 | }
85 | else if (b1 == 0x89 && b2 == 0x50 && b3 == 0x4E && b4 == 0x47)
86 | {
87 | //89 50 4e 47 0d 0a 1a 0a
88 | type = PNG_SUFFIX;
89 | }
90 | else if (b1 == 0xFF)
91 | {
92 | type = JPG_SUFFIX;
93 | }
94 | else if (b1 == 0x41 && b2 == 0x54 && b3 == 0x46)
95 | {
96 | type = ATF_SUFFIX;
97 | }
98 | else if (b1 == 0x50 && b2 == 0x4B)
99 | {
100 | type = ZIP_SUFFIX;
101 | }
102 |
103 | return type;
104 | }
105 |
106 | private static var _versionNumber:int = -1;
107 | public static function get versionNumber():Number
108 | {
109 | if(_versionNumber == -1)
110 | {
111 | _versionNumber = 0;
112 | var versionArray:Array = DragonBones.VERSION.split(".");
113 |
114 | for(var i:int=0; i < versionArray.length; i++)
115 | {
116 | _versionNumber += versionArray[i] * Math.pow(100, versionArray.length - i - 1);
117 | }
118 | }
119 |
120 | return _versionNumber;
121 | }
122 | }
123 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/OptimizeDataUtils.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | import dragonBones.utils.ConstValues;
4 |
5 | public class OptimizeDataUtils
6 | {
7 | private static var animationPropertyArray:Array = [ConstValues.A_FADE_IN_TIME, ConstValues.A_SCALE, ConstValues.A_LOOP];
8 | private static var animationValueArray:Array = [0,1,1];
9 |
10 | private static var timelinePropertyArray:Array = [ConstValues.A_SCALE, ConstValues.A_OFFSET, ConstValues.A_PIVOT_X, ConstValues.A_PIVOT_Y];
11 | private static var timelineValueArray:Array = [1,0,0,0];
12 |
13 | private static var framePropertyArray:Array = [ConstValues.A_TWEEN_SCALE, ConstValues.A_TWEEN_ROTATE, ConstValues.A_HIDE, ConstValues.A_DISPLAY_INDEX, ConstValues.A_SCALE_X_OFFSET, ConstValues.A_SCALE_Y_OFFSET];
14 | private static var frameValueArray:Array = [1,0,0,0,0,0];
15 |
16 | private static var transformPropertyArray:Array = [ConstValues.A_X, ConstValues.A_Y, ConstValues.A_SKEW_X, ConstValues.A_SKEW_Y, ConstValues.A_SCALE_X, ConstValues.A_SCALE_Y, ConstValues.A_PIVOT_X, ConstValues.A_PIVOT_Y];
17 | private static var transformValueArray:Array = [0,0,0,0,1,1,0,0];
18 |
19 | private static var colorTransformPropertyArray:Array = [ConstValues.A_ALPHA_OFFSET, ConstValues.A_RED_OFFSET, ConstValues.A_GREEN_OFFSET, ConstValues.A_BLUE_OFFSET, ConstValues.A_ALPHA_MULTIPLIER, ConstValues.A_RED_MULTIPLIER, ConstValues.A_GREEN_MULTIPLIER, ConstValues.A_BLUE_MULTIPLIER];
20 | private static var colorTransformValueArray:Array = [0,0,0,0,100,100,100,100];
21 |
22 | public static function optimizeData(dragonBonesData:Object):void
23 | {
24 | for each(var armatureData:Object in dragonBonesData.armature)
25 | {
26 | var boneDataList:Array = armatureData.bone;
27 |
28 | for each(var boneData:Object in boneDataList)
29 | {
30 | optimizeTransform(boneData.transform);
31 | }
32 |
33 | var skinList:Array = armatureData.skin;
34 | var slotList:Array;
35 | var displayList:Array;
36 | for each(var skinData:Object in skinList)
37 | {
38 | slotList = skinData.slot;
39 | for each(var slotData:Object in slotList)
40 | {
41 | displayList = slotData.display;
42 | for each(var displayData:Object in displayList)
43 | {
44 | optimizeTransform(displayData.transform);
45 | }
46 | }
47 | }
48 |
49 | var animationList:Array = armatureData.animation;
50 | var timelineList:Array;
51 | var frameList:Array;
52 | for each(var animationData:Object in animationList)
53 | {
54 | optimizeAnimation(animationData);
55 |
56 | timelineList = animationData.timeline;
57 | for each(var timelineData:Object in timelineList)
58 | {
59 | optimizeTimeline(timelineData);
60 |
61 | frameList = timelineData.frame;
62 | for each(var frameData:Object in frameList)
63 | {
64 | optimizeFrame(frameData);
65 | optimizeTransform(frameData.transform);
66 | optimizeColorTransform(frameData.colorTransform);
67 | }
68 | }
69 | }
70 | }
71 | }
72 |
73 | private static function optimizeAnimation(animationData:Object):void
74 | {
75 | optimizeItem(animationData, animationPropertyArray, animationValueArray, 4);
76 | }
77 |
78 | private static function optimizeTimeline(timelineData:Object):void
79 | {
80 | optimizeItem(timelineData, timelinePropertyArray, timelineValueArray, 4);
81 | }
82 |
83 | private static function optimizeFrame(frameData:Object):void
84 | {
85 | optimizeItem(frameData, framePropertyArray, frameValueArray, 4);
86 | }
87 |
88 | private static function optimizeTransform(transform:Object):void
89 | {
90 | optimizeItem(transform, transformPropertyArray, transformValueArray, 4);
91 | }
92 |
93 | private static function optimizeColorTransform(colorTransform:Object):void
94 | {
95 | optimizeItem(colorTransform, transformPropertyArray, transformValueArray, 4);
96 | }
97 |
98 | private static function optimizeItem(item:Object, propertyArray:Array, valueArray:Array, prec:uint = 4):void
99 | {
100 | if(!item)
101 | {
102 | return;
103 | }
104 |
105 | var i:int = propertyArray.length;
106 | var property:String;
107 | var value:Number;
108 | while(i--)
109 | {
110 | property = propertyArray[i];
111 | value = valueArray[i];
112 | if(!item.hasOwnProperty(property))
113 | {
114 | continue;
115 | }
116 | if(compareWith(item[property], value, prec))
117 | {
118 | delete item[property];
119 | }
120 | else
121 | {
122 | item[property] = Number(Number(item[property]).toFixed(prec));
123 | }
124 | }
125 | }
126 |
127 | private static function compareWith(source:Number, target:Number, prec:uint):Boolean
128 | {
129 | var delta:Number = 1 / Math.pow(10, prec);
130 | if(source >= target - delta && source <= target + delta)
131 | {
132 | return true;
133 | }
134 | return false;
135 | }
136 | }
137 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/TextureUtil.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | import flash.geom.Rectangle;
4 |
5 | /**
6 | * For place texture
7 | */
8 | public final class TextureUtil
9 | {
10 | private static const HIGHEST:uint = 0xFFFFFFFF;
11 |
12 | /**
13 | * Place textures by textureAtlasXML data
14 | */
15 | public static function packTextures(widthDefault:uint, padding:uint, rectMap:Object, verticalSide:Boolean = false, isNearest2N:Boolean = true):Rectangle
16 | {
17 | for each(var rect:Rectangle in rectMap)
18 | {
19 | break;
20 | }
21 | if(!rect)
22 | {
23 | return null;
24 | }
25 |
26 | var dimensions:uint = 0;
27 | var maxWidth:Number = 0;
28 | var rectList:Vector. = new Vector.;
29 | for each(rect in rectMap)
30 | {
31 | dimensions += rect.width * rect.height;
32 | rectList.push(rect);
33 |
34 | maxWidth = Math.max(rect.width, maxWidth);
35 | }
36 |
37 | //sort texture by size
38 | rectList.sort(sortRectList);
39 |
40 | if(widthDefault == 0)
41 | {
42 | //calculate width for Auto size
43 | widthDefault = Math.sqrt(dimensions);
44 | }
45 |
46 | widthDefault = Math.max(maxWidth + padding, widthDefault);
47 | if (isNearest2N)
48 | {
49 | widthDefault = getNearest2N(widthDefault);
50 | }
51 |
52 | var heightMax:uint = HIGHEST;
53 | var remainAreaList:Vector. = new Vector.;
54 | remainAreaList.push(new Rectangle(0, 0, widthDefault, heightMax));
55 |
56 | var isFit:Boolean;
57 | var width:int;
58 | var height:int;
59 |
60 | var area:Rectangle;
61 | var areaPrev:Rectangle;
62 | var areaNext:Rectangle;
63 | var areaID:int;
64 | var rectID:int;
65 | do
66 | {
67 | //Find highest blank area
68 | area = getHighestArea(remainAreaList);
69 | areaID = remainAreaList.indexOf(area);
70 | isFit = false;
71 | rectID = 0;
72 | for each(rect in rectList)
73 | {
74 | //check if the area is fit
75 | width = int(rect.width) + padding;
76 | height = int(rect.height) + padding;
77 | if (area.width >= width && area.height >= height)
78 | {
79 | //place portrait texture
80 | if(
81 | verticalSide?
82 | (
83 | height > width * 4?
84 | (
85 | areaID > 0?
86 | (area.height - height >= remainAreaList[areaID - 1].height):
87 | true
88 | ):
89 | true
90 | ):
91 | true
92 | )
93 | {
94 | isFit = true;
95 | break;
96 | }
97 | }
98 | rectID ++;
99 | }
100 |
101 | if(isFit)
102 | {
103 | //place texture if size is fit
104 | rect.x = area.x;
105 | rect.y = area.y;
106 | rectList.splice(rectID, 1);
107 | remainAreaList.splice(
108 | areaID + 1,
109 | 0,
110 | new Rectangle(area.x + width, area.y, area.width - width, area.height)
111 | );
112 | area.y += height;
113 | area.width = width;
114 | area.height -= height;
115 | }
116 | else
117 | {
118 | //not fit, don't place it, merge blank area to others toghther
119 | if(areaID == 0)
120 | {
121 | areaNext = remainAreaList[areaID + 1];
122 | }
123 | else if(areaID == remainAreaList.length - 1)
124 | {
125 | areaNext = remainAreaList[areaID - 1];
126 | }
127 | else
128 | {
129 | areaPrev = remainAreaList[areaID - 1];
130 | areaNext = remainAreaList[areaID + 1];
131 | areaNext = areaPrev.height <= areaNext.height?areaNext:areaPrev;
132 | }
133 | if(area.x < areaNext.x)
134 | {
135 | areaNext.x = area.x;
136 | }
137 | areaNext.width = area.width + areaNext.width;
138 | remainAreaList.splice(areaID, 1);
139 | }
140 | }
141 | while (rectList.length > 0);
142 |
143 | heightMax = heightMax - (getLowestArea(remainAreaList).height + padding);
144 |
145 | if (isNearest2N)
146 | {
147 | heightMax = getNearest2N(heightMax);
148 | }
149 |
150 | return new Rectangle(0, 0, widthDefault, heightMax);
151 | }
152 |
153 | private static function sortRectList(rect1:Rectangle, rect2:Rectangle):int
154 | {
155 | var v1:uint = rect1.width + rect1.height;
156 | var v2:uint = rect2.width + rect2.height;
157 | if (v1 == v2)
158 | {
159 | return rect1.width > rect2.width?-1:1;
160 | }
161 | return v1 > v2?-1:1;
162 | }
163 |
164 | private static function getNearest2N(_n:uint):uint
165 | {
166 | return _n & _n - 1?1 << _n.toString(2).length:_n;
167 | }
168 |
169 | private static function getHighestArea(areaList:Vector.):Rectangle
170 | {
171 | var height:uint = 0;
172 | var areaHighest:Rectangle;
173 | for each(var area:Rectangle in areaList)
174 | {
175 | if (area.height > height)
176 | {
177 | height = area.height;
178 | areaHighest = area;
179 | }
180 | }
181 | return areaHighest;
182 | }
183 |
184 | private static function getLowestArea(areaList:Vector.):Rectangle
185 | {
186 | var height:uint = HIGHEST;
187 | var areaLowest:Rectangle;
188 | for each(var area:Rectangle in areaList)
189 | {
190 | if (area.height < height)
191 | {
192 | height = area.height;
193 | areaLowest = area;
194 | }
195 | }
196 | return areaLowest;
197 | }
198 | }
199 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/checkBytesTailisXML.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | public function checkBytesTailisXML(bytes:ByteArray):Boolean
6 | {
7 | var offset:int = bytes.length;
8 |
9 | var count1:int = 20;
10 | while(count1 --)
11 | {
12 | if(offset --)
13 | {
14 | switch(bytes[offset])
15 | {
16 | case charCodes[" "]:
17 | case charCodes["\t"]:
18 | case charCodes["\r"]:
19 | case charCodes["\n"]:
20 | //
21 | break;
22 | case charCodes[">"]:
23 | var count2:int = 20;
24 | while(count2 --)
25 | {
26 | if(offset --)
27 | {
28 | if(bytes[offset] == charCodes["<"])
29 | {
30 | return true;
31 | }
32 | }
33 | else
34 | {
35 | break;
36 | }
37 | }
38 | return false;
39 | break;
40 | }
41 | }
42 | }
43 | return false;
44 | }
45 | }
46 |
47 | const charCodes:Object = new Object();
48 | for each(var c:String in " \t\r\n<>".split(""))
49 | {
50 | charCodes[c] = c.charCodeAt(0);
51 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/decompressData.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | import dragonBones.objects.DecompressedData;
6 | import dragonBones.utils.BytesType;
7 |
8 | public function decompressData(bytes:ByteArray):DecompressedData
9 | {
10 | var dataType:String = BytesType.getType(bytes);
11 | switch (dataType)
12 | {
13 | case BytesType.SWF:
14 | case BytesType.PNG:
15 | case BytesType.JPG:
16 | case BytesType.ATF:
17 | try
18 | {
19 | var bytesCopy:ByteArray = new ByteArray();
20 | bytesCopy.writeBytes(bytes);
21 | bytes = bytesCopy;
22 |
23 | bytes.position = bytes.length - 4;
24 | var strSize:int = bytes.readInt();
25 | var position:uint = bytes.length - 4 - strSize;
26 |
27 | var dataBytes:ByteArray = new ByteArray();
28 | dataBytes.writeBytes(bytes, position, strSize);
29 | dataBytes.uncompress();
30 | bytes.length = position;
31 |
32 | var dragonBonesData:Object;
33 | if(checkBytesTailisXML(dataBytes))
34 | {
35 | dragonBonesData = XML(dataBytes.readUTFBytes(dataBytes.length));
36 | }
37 | else
38 | {
39 | dragonBonesData = dataBytes.readObject();
40 | }
41 |
42 | bytes.position = bytes.length - 4;
43 | strSize = bytes.readInt();
44 | position = bytes.length - 4 - strSize;
45 |
46 | dataBytes.length = 0;
47 | dataBytes.writeBytes(bytes, position, strSize);
48 | dataBytes.uncompress();
49 | bytes.length = position;
50 |
51 | var textureAtlasData:Object;
52 | if(checkBytesTailisXML(dataBytes))
53 | {
54 | textureAtlasData = XML(dataBytes.readUTFBytes(dataBytes.length));
55 | }
56 | else
57 | {
58 | textureAtlasData = dataBytes.readObject();
59 | }
60 | }
61 | catch (e:Error)
62 | {
63 | throw new Error("Data error!");
64 | }
65 |
66 | var decompressedData:DecompressedData = new DecompressedData(dragonBonesData, textureAtlasData, bytes);
67 | decompressedData.textureBytesDataType = dataType;
68 | return decompressedData;
69 |
70 | case BytesType.ZIP:
71 | throw new Error("Can not decompress zip!");
72 |
73 | default:
74 | throw new Error("Nonsupport data!");
75 | }
76 | return null;
77 | }
78 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/getPointTarget.as:
--------------------------------------------------------------------------------
1 | package core.utils{
2 | import flash.display.Bitmap;
3 | import flash.display.BitmapData;
4 | import flash.display.DisplayObject;
5 | import flash.display.DisplayObjectContainer;
6 | import flash.display.Sprite;
7 | import flash.geom.Matrix;
8 | import flash.geom.Point;
9 |
10 | /**
11 | * @param _container container
12 | * @param _point point
13 | * @param _size size
14 | * @param _maxAlpha alpha data(0~1)
15 | */
16 |
17 | public function getPointTarget(container:DisplayObjectContainer, point:Point, size:int = 1, maxAlpha:Number = 0):DisplayObject
18 | {
19 | var filtersBackup:Array = [];
20 | var numChildren:uint = container.numChildren;
21 |
22 | for(var i:int = 0;i < numChildren;i ++)
23 | {
24 | var childDisplay:DisplayObject = container.getChildAt(i);
25 | if(childDisplay.filters && childDisplay.filters.length > 0)
26 | {
27 | filtersBackup[i] = childDisplay.filters;
28 | childDisplay.filters = null;
29 | }
30 | }
31 |
32 | var bmd:BitmapData = bmdArr[size];
33 | if(bmd)
34 | {
35 |
36 | }
37 | else
38 | {
39 |
40 | bmdArr[size] = bmd =new BitmapData(size * 2 - 1, size * 2 - 1, true, 0x00000000);
41 | }
42 |
43 | i = numChildren;
44 | var alpha:int = int(maxAlpha * 0xff);
45 | while (--i >= 0)
46 | {
47 | bmd.fillRect(bmd.rect, 0x00000000);
48 | var child:DisplayObject = container.getChildAt(i);
49 | var m:Matrix = child.transform.matrix;
50 | m.tx -= point.x - (size * 2 - 1)/2;
51 | m.ty -= point.y - (size * 2 - 1)/2;
52 | bmd.draw(child, m);
53 | var y:int = bmd.height;
54 | var ok:Boolean = true;
55 | loop:while (--y >= 0)
56 | {
57 | var x:int = y + 1 > size?(y + 1) - size:size-(y + 1);
58 | var xMax:int = bmd.width - 1 - x;
59 | while (x <= xMax)
60 | {
61 | if ((bmd.getPixel32(x, y) >>> 24) > alpha)
62 | {
63 | //bmd.setPixel32(x,y,0xffff0000);
64 | }
65 | else
66 | {
67 | ok = false;
68 | break loop;
69 | }
70 | x++;
71 | }
72 | }
73 | if(ok)
74 | {
75 | break;
76 | }
77 | child = null;
78 | }
79 |
80 | for(i = 0;i < numChildren;i ++)
81 | {
82 | childDisplay = container.getChildAt(i);
83 | if(filtersBackup[i])
84 | {
85 | childDisplay.filters = filtersBackup[i];
86 | }
87 | }
88 |
89 | return child;
90 | }
91 | }
92 | const bmdArr:Array=new Array();
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/utils/objectToXML.as:
--------------------------------------------------------------------------------
1 | package core.utils
2 | {
3 | public function objectToXML(object:*, rootName:String = "root"):XML
4 | {
5 | var xml:XML = ;
6 | _objectToXML(xml, rootName, object);
7 | return xml.children()[0];
8 | }
9 | }
10 |
11 | function _objectToXML(xml:XML, name:String, value:*):void
12 | {
13 |
14 | switch(value)
15 | {
16 | case true:
17 | case false:
18 | case null:
19 | case undefined:
20 | xml.@[name]=value;
21 | break;
22 | default:
23 | if(
24 | value is Number ||
25 | value is String
26 | )
27 | {
28 | xml.@[name]=value;
29 | }
30 | else
31 | {
32 | if(value is Array)
33 | {
34 | for each(var subValue:* in value)
35 | {
36 | switch(subValue)
37 | {
38 | case true:
39 | case false:
40 | case null:
41 | case undefined:
42 | xml.appendChild(<{name}>{subValue}{name}>);
43 | break;
44 | default:
45 | if(
46 | subValue is Number ||
47 | subValue is String
48 | )
49 | {
50 | xml.appendChild(<{name}>{subValue}{name}>);
51 | }
52 | else
53 | {
54 | if(subValue is Array)
55 | {
56 | var node:XML = <{name}/>;
57 | xml.appendChild(node);
58 | _objectToXML(node,name,subValue);
59 | }
60 | else
61 | {
62 | _objectToXML(xml,name,subValue);
63 | }
64 | }
65 | break;
66 | }
67 | }
68 | }
69 | else
70 | {
71 | node = <{name}/>;
72 | xml.appendChild(node);
73 | for(name in value)
74 | {
75 | _objectToXML(node, name, value[name]);
76 | }
77 | }
78 | }
79 | break;
80 | }
81 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/AnimationControlView.mxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
48 |
49 |
52 |
53 |
55 |
56 |
57 |
58 |
61 |
62 |
63 |
67 |
68 |
69 |
70 |
73 |
74 |
75 |
79 |
80 |
81 |
82 |
85 |
86 |
87 |
91 |
92 |
93 |
94 |
95 |
98 |
99 |
100 |
101 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/ArmatureSymbols.as:
--------------------------------------------------------------------------------
1 | package core.view
2 | {
3 | import flash.display.BlendMode;
4 | import flash.display.Sprite;
5 | import flash.filters.GlowFilter;
6 | import flash.geom.Matrix;
7 |
8 | import dragonBones.Armature;
9 | import dragonBones.Bone;
10 | import dragonBones.objects.EllipseData;
11 | import dragonBones.objects.IAreaData;
12 | import dragonBones.objects.RectangleData;
13 | import dragonBones.utils.TransformUtil;
14 |
15 | import light.managers.ElementManager;
16 |
17 | public final class ArmatureSymbols extends Sprite
18 | {
19 | private static const BONE_SYMBOL:String = "bone";
20 |
21 | private var _bonesContainer:Sprite;
22 |
23 | private var _armature:Armature;
24 | public function get armature():Armature
25 | {
26 | return _armature;
27 | }
28 | public function set armature(value:Armature):void
29 | {
30 | if(_armature == value)
31 | {
32 | return;
33 | }
34 | _armature = value;
35 |
36 | clearBones();
37 | if(_armature)
38 | {
39 | createBones();
40 | }
41 | }
42 |
43 | public function ArmatureSymbols()
44 | {
45 | super();
46 |
47 | _bonesContainer = new Sprite();
48 | _bonesContainer.alpha = 0.6;
49 | this.addChild(_bonesContainer);
50 |
51 | light.managers.ElementManager.getInstance().registerElement(BONE_SYMBOL, BoneSymbol);
52 | }
53 |
54 | private function clearBones():void
55 | {
56 | var i:int = _bonesContainer.numChildren;
57 | while(i --)
58 | {
59 | var boneSymbol:BoneSymbol = _bonesContainer.removeChildAt(i) as BoneSymbol;
60 | if(boneSymbol)
61 | {
62 | clearAreaContainer(boneSymbol);
63 | light.managers.ElementManager.getInstance().recycle(boneSymbol);
64 | }
65 | }
66 | }
67 |
68 | private function createBones():void
69 | {
70 | var areaContainer:Sprite = null;
71 |
72 | for each(var bone:Bone in _armature.getBones(false))
73 | {
74 | var boneSymbol:BoneSymbol = light.managers.ElementManager.getInstance().getElement(BONE_SYMBOL) as BoneSymbol;
75 | boneSymbol.blendMode = BlendMode.LAYER;
76 | boneSymbol.filters =[new GlowFilter(0x000000, 1, 4, 4, 2)];
77 | boneSymbol.name = bone.name;
78 | _bonesContainer.addChild(boneSymbol);
79 |
80 | boneSymbol.line.visible = false;
81 |
82 | addAreaShape(boneSymbol, _armature.armatureData.getBoneData(bone.name).areaDataList);
83 | }
84 |
85 | addAreaShape(_bonesContainer, _armature.armatureData.areaDataList);
86 | }
87 |
88 | private function addAreaShape(container:Sprite, areaDataList:Vector.):void
89 | {
90 | var areaContainer:Sprite = null;
91 | var helpMatrix:Matrix = new Matrix();
92 | for each(var areaData:IAreaData in areaDataList)
93 | {
94 | var areaShape:Sprite;
95 | if(areaData is RectangleData)
96 | {
97 | if(!areaContainer)
98 | {
99 | areaContainer = createAreaContainer(container);
100 | }
101 | var rectangleData:RectangleData = areaData as RectangleData;
102 |
103 | areaShape = new Sprite();
104 | areaShape.name = rectangleData.name;
105 | areaShape.graphics.beginFill(0xFF00FF, 0.3);
106 | areaShape.graphics.drawRect(-rectangleData.pivot.x, -rectangleData.pivot.y, rectangleData.width, rectangleData.height);
107 | TransformUtil.transformToMatrix(rectangleData.transform, helpMatrix, true);
108 | areaShape.transform.matrix = helpMatrix;
109 | areaContainer.addChild(areaShape);
110 | }
111 | else if(areaData is EllipseData)
112 | {
113 | if(!areaContainer)
114 | {
115 | areaContainer = createAreaContainer(container);
116 | }
117 | var ellipseData:EllipseData = areaData as EllipseData;
118 |
119 | areaShape = new Sprite();
120 | areaShape.name = ellipseData.name;
121 | areaShape.graphics.beginFill(0xFF00FF, 0.3);
122 | areaShape.graphics.drawEllipse(-ellipseData.pivot.x, -ellipseData.pivot.y, ellipseData.width, ellipseData.height);
123 | TransformUtil.transformToMatrix(ellipseData.transform, helpMatrix, true);
124 | areaShape.transform.matrix = helpMatrix;
125 | areaContainer.addChild(areaShape);
126 | }
127 | }
128 | }
129 |
130 | private function getAreaContainer(container:Sprite):Sprite
131 | {
132 | return container.getChildByName("areaContainer") as Sprite;
133 | }
134 |
135 | private function createAreaContainer(container:Sprite):Sprite
136 | {
137 | var areaContainer:Sprite = getAreaContainer(container);
138 | if(!areaContainer)
139 | {
140 | areaContainer = new Sprite();
141 | areaContainer.name = "areaContainer";
142 | container.addChild(areaContainer);
143 | }
144 | return areaContainer;
145 | }
146 |
147 | private function clearAreaContainer(container:Sprite):void
148 | {
149 | var areaContainer:Sprite = getAreaContainer(container);
150 | if(areaContainer)
151 | {
152 | var i:int = areaContainer.numChildren;
153 | while(i --)
154 | {
155 | light.managers.ElementManager.getInstance().recycle(areaContainer.removeChildAt(i));
156 | }
157 | }
158 | }
159 |
160 | public function update(scale:Number = 1, selectedBone:Bone = null, isDragBone:Boolean = false):void
161 | {
162 | var i:int = 0;
163 | for each(var bone:Bone in _armature.getBones(false))
164 | {
165 | var boneSymbol:BoneSymbol = _bonesContainer.getChildAt(i) as BoneSymbol;
166 |
167 | if(!boneSymbol)
168 | {
169 | continue;
170 | }
171 |
172 | boneSymbol.x = bone.global.x;
173 | boneSymbol.y = bone.global.y;
174 | boneSymbol.rotation = bone.global.rotation * 180 / Math.PI;
175 | boneSymbol.scaleX = boneSymbol.scaleY = 1 / scale;
176 |
177 | if(selectedBone == bone)
178 | {
179 | boneSymbol.halo.scaleX = boneSymbol.halo.scaleY = 2;
180 | }
181 | else
182 | {
183 | boneSymbol.halo.scaleX = boneSymbol.halo.scaleY = 1;
184 | }
185 |
186 | var dX:Number;
187 | var dY:Number;
188 |
189 | if(isDragBone && selectedBone == bone)
190 | {
191 | dX = this.mouseX - boneSymbol.x;
192 | dY = this.mouseY - boneSymbol.y;
193 | boneSymbol.line.scaleX = Math.sqrt(dX * dX + dY * dY) * scale / 100;
194 | boneSymbol.line.rotation = Math.atan2(dY, dX) * 180 / Math.PI - boneSymbol.rotation;
195 | boneSymbol.line.visible = true;
196 | boneSymbol.visible = true;
197 | }
198 | else
199 | {
200 | boneSymbol.line.visible = false;
201 |
202 | if(bone.parent || bone.getBones().length > 0)
203 | {
204 | boneSymbol.visible = true;
205 | }
206 | else
207 | {
208 | boneSymbol.visible = false;
209 | }
210 | }
211 |
212 | if(bone.parent)
213 | {
214 | dX = bone.parent.global.x - boneSymbol.x;
215 | dY = bone.parent.global.y - boneSymbol.y;
216 | boneSymbol.parentLine.line.scaleX = Math.max(Math.sqrt(dX * dX + dY * dY) * scale - 10, 0) / 100;
217 | boneSymbol.parentLine.rotation = Math.atan2(dY, dX) * 180 / Math.PI - boneSymbol.rotation;
218 | boneSymbol.parentLine.visible = true;
219 | }
220 | else
221 | {
222 | boneSymbol.parentLine.visible = false;
223 | }
224 |
225 | var areaContainer:Sprite = getAreaContainer(boneSymbol);
226 | if(areaContainer)
227 | {
228 | areaContainer.scaleX = areaContainer.scaleY = scale;
229 | }
230 |
231 | i ++;
232 | }
233 | }
234 | }
235 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/ArmaturesPanel.mxml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
30 |
31 |
35 |
36 |
43 |
44 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/BoneControlView.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
46 |
47 |
48 |
49 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/components/DragTree.mxml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 | =10;
181 | }
182 | ]]>
183 |
184 |
185 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/components/PlayButton.mxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
15 |
17 |
18 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/skin/BottomBarButtonSkin.mxml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | [HostComponent("spark.components.Button")]
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/skin/BottomContextMenuButtonSkin.mxml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | [HostComponent("spark.components.Button")]
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
38 |
40 |
41 |
42 |
43 |
44 |
45 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/skin/HighlightIconButtonSkin.mxml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | [HostComponent("spark.components.Button")]
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
38 |
40 |
41 |
42 |
43 |
44 |
45 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelLib/src/core/view/skin/IconButtonSkin.mxml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | [HostComponent("spark.components.Button")]
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/build/DragonBonesDesignPanel.mxi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/build/DragonBonesDesignPanel/events.jsfl:
--------------------------------------------------------------------------------
1 | var events;
2 | (function (events)
3 | {
4 |
5 |
6 | var Event = (function ()
7 | {
8 | function Event(type, data)
9 | {
10 | this.target = null;
11 | this.type = type;
12 | this.data = data;
13 | }
14 | return Event;
15 | })();
16 | events.Event = Event;
17 |
18 |
19 | var EventDispatcher = (function ()
20 | {
21 | function EventDispatcher()
22 | {
23 | }
24 |
25 | EventDispatcher.prototype.hasEventListener = function (type)
26 | {
27 | assert(type);
28 |
29 | if (this._listenersMap && this._listenersMap[type])
30 | {
31 | return true;
32 | }
33 | return false;
34 | };
35 |
36 | EventDispatcher.prototype.addEventListener = function (type, listener)
37 | {
38 | assert(type && typeof listener === "function");
39 |
40 | if (!this._listenersMap)
41 | {
42 | this._listenersMap = {};
43 | }
44 |
45 | var listeners = this._listenersMap[type];
46 |
47 | if (listeners)
48 | {
49 | this.removeEventListener(type, listener);
50 | }
51 |
52 | if (listeners)
53 | {
54 | listeners.push(listener);
55 | }
56 | else
57 | {
58 | this._listenersMap[type] = [listener];
59 | }
60 | };
61 |
62 | EventDispatcher.prototype.removeEventListener = function (type, listener)
63 | {
64 | assert(type && typeof listener === "function");
65 |
66 | var listeners = this._listenersMap[type];
67 | if (listeners)
68 | {
69 | for (var i = 0, l = listeners.length; i < l; i++)
70 | {
71 | if (listeners[i] == listener)
72 | {
73 | if (l == 1)
74 | {
75 | listeners.length = 0;
76 | delete this._listenersMap[type];
77 | }
78 | else
79 | {
80 | listeners.splice(i, 1);
81 | }
82 | }
83 | }
84 | }
85 | };
86 |
87 | EventDispatcher.prototype.removeAllEventListeners = function (type)
88 | {
89 | if (type)
90 | {
91 | delete this._listenersMap[type];
92 | }
93 | else
94 | {
95 | this._listenersMap = null;
96 | }
97 | };
98 |
99 | EventDispatcher.prototype.dispatchEvent = function (event)
100 | {
101 | assert(event);
102 |
103 | if (this._listenersMap)
104 | {
105 | var listeners = this._listenersMap[event.type];
106 | if (listeners)
107 | {
108 | event.target = this;
109 | var listenersCopy = listeners.concat();
110 | for (var i = 0, l = listenersCopy.length; i < l; i++)
111 | {
112 | listenersCopy[i](event);
113 | }
114 | }
115 | }
116 | };
117 | return EventDispatcher;
118 | })();
119 | events.EventDispatcher = EventDispatcher;
120 |
121 | }
122 | )(events || (events = {}));
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/libs/DBGATracker.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelPlugin/libs/DBGATracker.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/libs/DragonBonesCloud.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/DragonBonesDesignPanelPlugin/libs/DragonBonesCloud.swc
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/DragonBonesDesignPanel.mxml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | [ResourceBundle("resources")]
31 |
32 |
33 |
34 | GlobalConstValues.versionNumber)
104 | {
105 | DBCloud.instance.ifNeedUpdate = 1;
106 | upgradeBtn.visible = true;
107 | }
108 | else
109 | {
110 | DBCloud.instance.ifNeedUpdate = -1;
111 | upgradeBtn.visible = false;
112 | }
113 | }
114 |
115 | private function menuClickHandler(e:Event):void
116 | {
117 | switch (e.target)
118 | {
119 | case buttonImport:
120 | var importWindow:ImportWindow = new ImportWindow();
121 | importWindow.shareConfig = shareConfig;
122 | importWindow.showWindow(this);
123 | break;
124 |
125 | case buttonExport:
126 | var exportWindow:ExportWindow = new ExportWindow();
127 | exportWindow.shareConfig = shareConfig;
128 | exportWindow.showWindow(this);
129 | break;
130 |
131 | case buttonTextureAtlas:
132 | var textureAtlasWindow:TextureAtlasWindow = new TextureAtlasWindow();
133 | textureAtlasWindow.shareConfig = shareConfig;
134 | textureAtlasWindow.showWindow(this, true);
135 | break;
136 |
137 | case buttonXML:
138 | var xmlWindow:XMLWindow = new XMLWindow();
139 | xmlWindow.shareConfig = shareConfig;
140 | xmlWindow.showWindow(this, true);
141 | break;
142 |
143 | case buttonAbout:
144 | var aboutWindow:AboutWindow = new AboutWindow();
145 | aboutWindow.showWindow(this, true);
146 | break;
147 | }
148 | }
149 |
150 | private function armaturesPanelDispatchEvent(e:Event):void
151 | {
152 | shareConfig.dispatcher.dispatchEvent(e);
153 | }
154 |
155 | private function checkOnlineStatus():void
156 | {
157 | DBNetworkUtils.instance.testNetwork();
158 | }
159 |
160 | private function downloadNewVersion():void
161 | {
162 | DBGATrackerManager.trackEvent("/:DownloadNewVersion", "/:DownloadNewVersion. CurrentVersion:" + String(DragonBones.VERSION));
163 | navigateToURL(new URLRequest("http://dragonbones.github.io/download.html"));
164 | }
165 |
166 | ]]>
167 |
168 |
169 |
170 |
171 |
175 |
179 |
183 |
187 |
191 |
192 |
193 |
194 |
195 |
196 |
199 |
200 |
201 |
204 |
205 |
206 |
207 |
211 |
212 |
213 |
216 |
217 |
218 |
219 |
220 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/plugin/PluginConfig.as:
--------------------------------------------------------------------------------
1 | package plugin
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | import robotlegs.bender.extensions.eventCommandMap.api.IEventCommandMap;
6 | import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
7 | import robotlegs.bender.framework.api.IConfig;
8 | import robotlegs.bender.framework.api.IInjector;
9 |
10 | public final class PluginConfig implements IConfig
11 | {
12 | [Inject]
13 | public var injector:IInjector;
14 |
15 | [Inject]
16 | public var dispatcher:IEventDispatcher;
17 |
18 | [Inject]
19 | public var mediatorMap:IMediatorMap;
20 |
21 | [Inject]
22 | public var commandMap:IEventCommandMap;
23 |
24 | public function configure():void
25 | {
26 | //model
27 |
28 | //view
29 |
30 | //controller
31 |
32 | /*
33 | (injector.getInstance(IEventDispatcher) as IEventDispatcher)
34 | .dispatchEvent(
35 | new ControllerEvent(ControllerEvent.STARTUP)
36 | );
37 | */
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/plugin/view/AboutWindow.mxml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
62 |
63 |
64 |
65 |
67 |
68 |
69 |
70 |
71 |
72 |
75 |
76 |
77 |
78 |
79 |
80 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/plugin/view/BaseWindow.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/plugin/view/ImportWindow.mxml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
65 |
66 |
67 |
68 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
91 |
95 |
99 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
113 |
114 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/plugin/view/TextureAtlasWindow.mxml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/DragonBonesDesignPanelPlugin/src/plugin/view/XMLWindow.mxml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012-2013 DragonBones team and other contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | SkeletonAnimationDesignPanel
2 | ======================
3 | http://dragonbones.github.com/
4 |
5 | In this project you can find the source code of DragonBones' Flash Pro based design panel, which is a visual editer for skeleton animation editing. With the design panel, designers can easily convert flash timeline based animation to skeleton animation, edit it and export it to texture file for developers.
6 |
7 | Following steps show you how to use the source code:
8 | 1. Make sure you have installed Flash Builder with Flex SDK 4.0 or later version.
9 | 2. Make sure you have got [SeletonAnimationLibrary](https://github.com/DragonBones/SkeletonAnimationLibrary) project.
10 | 3. Open Flash Builder and create a Flex project named SkeletonAnimationDesignPanel.
11 | 4. Change project location to SkeletonAnimationDesignPanel's location to make sure the IDE can find the source code.
12 | 5 Change complie parameters to -locale en_US zh_CN ja_JP fr_FR -source-path ./locale/{locale} -allow-source-path-overlap=true
13 | 6. Import SeletonAnimationLibrary project.
14 | 7. (Optional) Change project theme to "Graphite".
15 | 8. Test and have fun.
16 |
17 | **Debug**
18 | Want to debug the design panel in Flash Pro? It's very easy. Just to open the SkeletonAnimationDesignPanel in your Flash Pro and debug the project in Flash Builder. Now the debug version of the design panel in Flash Builder is connected with your Flash Pro. You can use it and debug it just like it is inside of the Flash Pro. Don't wait to try this amazing feature!
19 |
20 | There are some demos in [SkeletonAnimationDemos](https://github.com/DragonBones/SkeletonAnimationDemos) project shows how to use the design panel
21 |
22 | **All things you need to download can be found [here](http://dragonbones.github.com/download.html)**
23 |
24 | Copyright 2012-2013 the DragonBones Team
--------------------------------------------------------------------------------
/docs/DB4.0数据格式前瞻.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DragonBones/DesignPanel/40a66416edc4a4a3cba93e0827ba4a4a99bf6f80/docs/DB4.0数据格式前瞻.pdf
--------------------------------------------------------------------------------
/docs/Design Panel 3.0.0 Release Notes.md:
--------------------------------------------------------------------------------
1 | DragonBones DesignPanel V3.0.0 Release Notes
2 | ======================
3 | 中文版往后看
4 |
5 | Dec 15th, 2014
6 |
7 | DragonBones DesignPanel V3.0.0 is a big version after V2.4.1. In this version, we primary focused on customer experience improvement and bug fixing.
8 | All new features and improvements are based on customer feedback. If you have any ideas or suggestions, please email us dragonbonesteam@gmail.com.
9 |
10 | ### New Features and Improvements
11 | ##### Add Animation Blending Time Settings in Import Panel.
12 | * Animation blending time means: When armature switch animations, DragonBones can automatic generate tweens between animations.
13 | * This setting item will work only if the original blending time haven't been set. If designer have set the blending time value before, the value will not be overrided.
14 | * In previous version, the default blending time is 0.3 seconds. If you want it be 0 second, you need to manually set it for every animations one by one. In this version, you can conveniently set it in import panel with one time.
15 |
16 | ##### Separate the data format and texture format setting to two items in export panel
17 | * In previous version, export format is one setting item. Along with the increase of supported data format and texture format, the list will blow up. So we separate it to two.
18 | * Suggest user set these two items from up to down. Data format first, then texture format.
19 |
20 | ##### Support export AMF data format
21 | * AMF(Action Message Format)is a Binary data format based on Flash technology. Because DragonBones can not encode or decode AMF itself, only Flash app makers are suggested use this format.
22 |
23 | ##### Add advanced setting items in export panel.
24 | * The purpose of add advanced setting items is to provide more flexible configure for export. Usually the advanced settings are not necessary to be modified, because the default value can also ensure export successful.
25 | * Add 5 advanced setting items as following
26 | 1) Skeleton Data Name
27 | Skeleton data name is used as the default key to index skeleton data when it is added to factory. By default skeleton data name equals to FLA file name.
28 | 2) Skeleton Data File Name
29 | The exported skeleton data file name. The default value is "skeleton". This setting item is available only if the data format is not Data Merged.
30 | 3) Texture Data File Name
31 | The exported texture data file name. The default value is "texture". This setting item is available only if the data format is not Data Merged.
32 | 4) Texture File Name
33 | The exported texture file name. The default value is "texture" This setting item is available only if the data format is not Data Merged.
34 | 5) Texture Atlas Path
35 | The texture atlas path is used to record the texture atlas' relative path. The default value is null. This setting item is useful only if there are a lot of texture atlas need to be dynamically load and they are located in different folder.
36 |
37 | ##### Armature view support drag to modify skeleton hierarchy.
38 | * Click character in armature view to review the skeleton hierarchy.
39 | * Click a bone in armature and drag to another bone to set its child.
40 |
41 | ##### Add Key Frame Auto Tween Switch in Animation Panel
42 | * In previous version, DragonBones generate tweens between key frames automaticly unless there is a ^ in frame label. If you want to remove tweens in the whole animation, you need to add ^ in each key frame.
43 | * Key Frame Auto Tween Switch is open by default. If you close it, all tweens between key frames will be removed.
44 |
45 | ##### Improve Performance of Importing data from Flash Pro about 40%
46 | * Modify the mechanism of importing data from Flash Pro. There will be no Movie Clip generated in Flash Pro Library. 40% time will be reduced compared with previous version.
47 |
48 | ##### Don't support 2.2 or older data format any more
49 | * Design Panel cannot open file with 2.2 or older data format.
50 | * For projects using 2.2 data format, if you want to using DragonBones 3.0, you need to find the fla file and use DesignPanel 3.0 you export them. If your project have lots of assets, please be careful to make the decision.
51 | * For files with 2.3 or later data formate, DesignPanel 3.0 can perfectly support them.
52 |
53 | ##### Pause support spine data format
54 | * Considering the Spine data format has been changed for times. DesignPanel 3.0 cannot support it very well. So we decide to close it temporary. In future, along with DragonBones's upgrade, it may be added back.
55 |
56 |
57 | 最近更新时间:2014年12月15日
58 | ### 概述
59 | DragonBones DesignPanel V3.0.0 是V2.4.1之后的一个大版本。在这个版本中,我们主要聚焦于对用户体验的提升和bug的修复。
60 | 所有的新功能改进都是基于我们收集的用户反馈。如果您对DragonBones有任何意见和建议,欢迎发邮件至dragonbonesteam@gmail.com。
61 |
62 | ### 更新内容
63 | ##### 导入面板增加设置默认动画混合时间项目
64 | * 动画混合时间指:角色在切换动画时,DragonBones自动为角色生成的用于动画间动作过渡的时间。时间越长过度越平滑,时间设为0则没有过度。
65 | * 该设置项只会在混合时间没有设置的情况下起作用。如果设计师在导入前已经设置过某个动作的混合时间,则该设置项目不会在导入时覆盖原有的值。
66 | * 这个改动是基于大量的用户反馈,老版本默认动画混合时间是0.3秒,是不可设置的,很多用户希望动画间混合时间为0,则需要一个个的修改动作的混合时间,很麻烦。新版本就可以很方便的在导入时设置这个值了。
67 |
68 | ##### 导出面板将数据格式和纹理格式的设置分为两个项目
69 | * 老板本的导出格式是一个设置项,包含数据格式和纹理格式的排列组合。随着数据格式和纹理格式支持量的增加,这个列表会变的越来越长,所以新版本将其变为两个项目,希望用户能尽快适应。
70 | * 因为纹理格式列表会随着数据格式的选择而变化,所以在使用时最好从上至下,先设置数据格式,再设置纹理格式。
71 |
72 | ##### 导出面板增加AMF数据格式的支持
73 | * AMF(Action Message Format)是Flash支持的一种二进制编码格式,他的体积会比xml和json小。因为DragonBones 本身不包含这种格式的解析,所以只建议开发Flash应用的用户使用这种格式。
74 |
75 | ##### 导出面板增加高级选项
76 | * 增加高级选项,目的在于为导出功能提供了更灵活的配置,一般情况下是不用修改的,因为默认值已经可以保证导出功能的正常工作。
77 | * 增加如下5个高级设置项目
78 | 1) 骨架数据名
79 | 骨架数据名用于当骨架数据被添加到工厂时提供的用于数据索引的默认名称。该名称也可在数据被添加到工厂的代码中修改。默认情况下,骨架数据名等于FLA文件名。
80 | 2)骨架数据文件名
81 | 导出的骨架数据文件的文件名,默认值为“skeleton”。该选项只有在数据格式不为集成数据时才有效,因为导出集成数据时,骨架数据是集成到纹理文件中的,没有独立的骨架数据文件导出。
82 | 3) 纹理数据文件名
83 | 导出的纹理数据文件名,默认值为“texture”。该选项只有在数据格式不为集成数据时才有效,因为导出集成数据时,纹理数据是集成到纹理文件中的,没有独立的纹理数据文件导出。
84 | 4) 纹理文件名
85 | 导出的纹理文件名,默认值为“texture”。该选项只有在数据格式不为集成数据时才有效,因为导出集成数据时,文件名是在保存对话框中设置的。
86 | 5) 纹理集路径
87 | 纹理集路径可以用于记录纹理文件的相对路径,默认值为空。这个选项只有在纹理集很多,需要动态加载,并且放在不同的目录时才会有用,可以帮助开发者记录纹理集的相对路径。
88 |
89 | ##### 骨架预览区域支持拖拽修改骨架关系
90 | * 点击骨架预览区的角色可以查看骨架关系。
91 | * 骨架预览区域选择父骨头,拖拽将箭头指向子骨头,实现骨架关系的修改。
92 |
93 | ##### 动画面板增加关键帧自动补间开关
94 | * 关键帧自动补间指:属于同一个动画中相邻关键帧是否自动添加补间。
95 | * 老板本中,DragonBones会默认进行关键帧自动补间,除非该关键帧标签上有^存在。如果希望实现整个动作都没有关键帧补间,需要在每个关键帧上加^帧标签。新版本将让这个效果的实现变的很方便。
96 | * 关键帧自动补间开关默认是开启的。如果关闭,则该动画所有关键帧之间都没有补间,相当于每个关键帧上都有^。
97 |
98 | ##### 提升从Flash Pro导入数据的速度约40%
99 | * 修改从FlashPro中导入数据的机制,在FlashPro的Library中将不再生成影片剪辑用于存储纹理,导入时间缩短约40%。
100 |
101 | ##### 不再兼容2.2及更老版本的数据格式
102 | * 考虑到性能问题,以及2.3及以上版本的DragonBones已有较高的覆盖率,3.0版本将不再支持2.2及更老板本的数据格式。DesignPanel将无法打开不支持的数据格式文件。
103 | * 对于已有的使用2.2版本数据格式的项目,需要找到fla源文件使用新版本的DesignPanel重新导出。如果您的项目素材量比较大,并且已经进入稳定期,建议您谨慎升级。
104 | * 对于2.3及以后的版本的数据格式,DesignPanel 3.0可以无缝支持。
105 |
106 | ##### 暂停对Spine数据格式的支持
107 | * 鉴于Spine的数据格式变化比较快,功能也愈加复杂,DesignPanel 3.0已经无法很好的支持Spine的数据格式,所以暂时关闭了这个功能。随着以后DragonBones功能的升级,这个功能有可能会加回来。
108 |
109 | ### 安装步骤
110 | ##### 一般安装方法
111 | * 确定您已经安装相同版本相同语言的Adobe Flash Pro 和Adobe Extension Manager. (例如,您的Flash Pro 版本是CC 2014中文版, 则您的Extension Manager 也必须是CC2014中文版)
112 | * 双击DragonBonesDesignPanel.zxp,启动ExtensionManager完成安装。
113 | * 重启Flash Pro
114 |
115 | 如果使用以上方法安装失败,请检查您Extension Manager 左侧应用栏中能否招到Flash Pro的图标。如果Extension Manager 左侧应用栏中没有Flash Pro的图标,说明您的Flash Pro没有被系统检测到(Flash Pro 绿色版)必须使用终极安装方法。
116 |
117 | ##### 终极安装方法
118 | * 找到下面的目录:_"C:\Users\<用户>\AppData\Local\Adobe\\<语言>\Configuration\WindowSWF"_ (Windows 用户)
119 | * 将DragonBonesDesignPanel.zxp 改名为DragonBonesDesignPanel.zip 并解压缩。
120 | * 将解压缩出来的文件拷贝至第1步找到的目录中,形成如下目录结构:
121 | _"第1步找到的目录\DragonBonesDesignPanel.swf"_
122 | _"第1步找到的目录\DragonBonesDesignPanel\xxx.jsfl"_
123 | * 重启Flash Pro
124 |
125 |
--------------------------------------------------------------------------------
/docs/Design Panel 3.0.1 Release Notes.md:
--------------------------------------------------------------------------------
1 | DragonBones DesignPanel V3.0.1 Release Notes
2 | ======================
3 | 中文版往后看
4 |
5 | Jan 5th, 2015
6 |
7 | DragonBones DesignPanel V3.0.1 is a community experience version (minor version). In this version, we primary focused on data format standard upgrade based on downward compatibility as well as export feature improvement.
8 | All these features will be hold in community experience version for months before merge to stable version based on customer feedback. If you have any ideas or suggestions, please email us dragonbonesteam@gmail.com.
9 |
10 | ### New Features
11 | ##### Data Format Standard Upgrade
12 | * Data format standard upgraded to 3.0. Major changes as following:
13 | 1) Add relative parent data format standard.
14 | 2) Add default value standard
15 | * See details in [DragonBonesDataFormatSpec_V3.0_en.xml](DragonBonesDataFormatSpec_V3.0_en.xml)
16 |
17 | ##### Support export relative parent data format
18 | * Add a “Data Coordinate” option in Export panel. Support global coordinate and parent coordinate.
19 | * Note: Exported parent coordinate data, its skeleton hierarchy cannot be edit after open in DesignPanel again. Also it only can be parsed with 3.0.1 Library or above version.
20 |
21 | ##### Support export compressed data.
22 | * Add a “Compress Data” switch in Export panel. Support compress data before export it.
23 | * Compressed exported data may not be correctly parsed with 3.0.0 or older version library.
24 |
25 | 最近更新时间:2014年1月5日
26 | ### 概述
27 | DragonBones DesignPanel V3.0.1 是V3.0.0之后的一个社区体验版(小版本)。在这个版本中,我们主要做的是,在保持向下兼容的基础上扩展了数据格式,同时强化了导出功能。
28 | 这个部分的功能会在社区体验版中过渡一段时间,之后基于用户反馈决定是否加入正式版。如果您对DragonBones有任何意见和建议,欢迎发邮件至dragonbonesteam@gmail.com。
29 |
30 | ### 更新内容
31 | ##### 升级了数据格式标准
32 | * 数据格式标准升级到3.0版本,主要变化如下:
33 | 1) 增加相对Parent的数据格式标准
34 | DragonBones数据格式起源于FlashPro导出,3.0版本之前数据格式中所有的数据一直都是相对Global的数据。优点是能够最好的描述FlashPro中的动画数据,可以重新打开修改骨架关系甚至导回到FlashPro中再次编辑(考虑到版权保护,该功能还未开放)。缺点是数据量比较大而且不容易和其他骨骼引擎兼容。
35 | 为了解决这些问题,3.0版本数据在原有数据格式标准不变的情况下,在根节点增加属性“isGlobal”作为开关,支持isGlobal=0的情况下,保存相对Parent的数据。这样(结合下面的新特性)数据量能够被更大程度的压缩,同时能够更方便的和Spine,CocosStudio的数据格式之间做转换。
36 | 2) 增加默认值标准
37 | 增加默认值标准的目的是为了最大限度的压缩导出的数据量。当一个属性有默认值时,该属性就是个可选属性,如果该属性不存在,系统会自动将该属性的值视为默认值。这样在做数据导出时,就可以把所有等于默认值的属性从数据文件中删除,最大限度的压缩文件尺寸。
38 | * 详细的数据标准文档参见: [DragonBonesDataFormatSpec_V3.0_cn.xml](DragonBonesDataFormatSpec_V3.0_cn.xml)
39 |
40 | ##### 支持导出相对Parent的数据格式
41 | * 导出面板增加数据坐标系选项,支持Global坐标系和Parent坐标系。选择Global坐标系相当于导出和老板本的数据,选择Parent坐标系可以使骨架数据和动画数据都变为相对数据。
42 | * 注意:导出的Parent数据在被DesignPanel再次打开后,骨架关系是无法被修改的,而且只能被3.0.1或以上版本的Library解析。
43 |
44 | ##### 支持导出压缩数据
45 | * 导出面板增加压缩数据开关,支持通过将所有数值为默认值的属性删除的方式进行数据压缩。压缩后数据体积能减少40%左右。
46 | * 注意:压缩的数据有可能无法被老板本Library正确解析。
47 |
48 |
49 |
--------------------------------------------------------------------------------
/docs/DragonBonesDataFormatSpec_V3.0_cn.xml:
--------------------------------------------------------------------------------
1 |
17 |
23 |
24 |
29 |
32 |
33 |
34 |
46 |
51 |
54 |
62 |
63 |
64 |
65 |
70 |
73 |
74 |
75 |
87 |
93 |
94 |
95 |
102 |
106 |
109 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
143 |
152 |
153 |
154 |
171 |
177 |
197 |
204 |
238 |
249 |
259 |
260 |
263 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
--------------------------------------------------------------------------------
/docs/Install DesignPanel Directly.md:
--------------------------------------------------------------------------------
1 | ## Install DesignPanel Directly
2 | * Rename DragonBonesDesignPanel.zxp to DragonBonesDesignPanel.zip and unzip.
3 | * Windows User, Find following folder: "C:/Users/(username)/AppData/Local/Adobe/(Flash Pro version)/(language)/Configuration/WindowSWF"
4 | * Mac User, Find following folder: "file:///Mac/Users/(username)/Library/Application%20Support/Adobe/(Flash Pro version)/(language)/Configuration/"
5 | * Copy files inside the zip to above folder become following file structure:
6 | _"ABOVE_FOLDER\DragonBonesDesignPanel.swf"_
7 | _"ABOVE_FOLDER\DragonBonesDesignPanel\xxx.jsfl"_
8 | * Restart Flash Pro
--------------------------------------------------------------------------------