目前DesignPanel v3.01版本在測試新的功能「碰撞範圍」,可以在Flash中直接定義碰撞範圍,輸出到引擎中,讓DragonBones To Engine的流程更加順暢、直覺,不過此功能尚在測試中,所以不確定性非常高,在這邊只是做個紀錄…
實作方法是在Flash中建立導引線圖層並且圖層名稱以@開頭,然後在圖層內用基本形狀工具(矩形或橢圓形皆可)去定義碰撞範圍即可,不過目前的設計是hit area是隸屬於armature,且不具有時間軸,因此限制很大。如果想要不同動作有不同的hit area會不是這麼直覺,如果又想要hit area隨著動作演出而有改變的話,又更是困難了,雖不是完全沒辦法,但會變得頗複雜…很不直覺…
2015年1月8日 星期四
2014年12月15日 星期一
[DragonBones]讓物件隱藏顯示又保有骨架繼承
由於DragonBones的骨架結構是具有繼承效果的(會繼承父骨頭的位置、傾斜),因此當父骨頭(圖層)沒有內容物(空白關鍵影格),而子骨頭又還有內容物時,就會造成子骨頭的位移繼承錯誤,跑出奇怪的動態結果,而這個問題的解決方法就是用隱藏內容物來替代刪除內容物。
隱藏內容物只是將影格中的元件不顯示,元件仍然存在在影格之中,如此可讓內容物不被看到但又不會丟失骨架繼承,但這個技巧只能作用在影片片段元件上,可以透過屬性面板中的顯示頁籤的『可見』參數設定該元件會不會被顯示出來,而DragonBones會把這個參數寫入匯出的資料中,在xml檔案內參數名稱是hide。
參考:
隱藏內容物只是將影格中的元件不顯示,元件仍然存在在影格之中,如此可讓內容物不被看到但又不會丟失骨架繼承,但這個技巧只能作用在影片片段元件上,可以透過屬性面板中的顯示頁籤的『可見』參數設定該元件會不會被顯示出來,而DragonBones會把這個參數寫入匯出的資料中,在xml檔案內參數名稱是hide。
![]() |
| 可見參數可以控制元件的顯示狀態 |
![]() |
| 可見參數會被DragonBones輸出為hide參數 |
- http://dragonbones.effecthub.com/doc/DBSkeletonDataFormatSpec_V2.4_cn.xml
hide: Slot是否隐藏,与把骨骼从时间轴动画删除不同,控制Slot的visible。
2014年12月12日 星期五
[DragonBones]Texture Atlas Packing功能解說
DragonBones本身就具有Texture Atlas Packing的功能,可將所有使用到的圖片素材拼湊成一張貼圖,使用者不需要再使用額外的軟體製作Atlas,相當便利。在此將分享我對此功能的一些小心得…
Texture Atlas Packing規則,打包的對象須符合以下條件…
首先我會建議所有的素材(點陣圖)一定都要先包成元件,原因是…
- 元件才可以做顏色效果(Alpha、進階)
- 元件做補間才不會意外生成額外的點陣圖資源
- 影片片段元件可以使用隱藏顯示功能
- 元件
- 不含動畫(timeline只有一個frame的長度)
- 不含動作名稱label
- (或者是未包成元件的點陣圖或形狀…)
對於符合打包對象條件的元件,需要注意的是
- 打包的對象是元件,而非元件內的點陣圖
- 只要元件的名稱不相同,就會被視為不同的對象並打包起來
例如重製了一個元件,儘管重製的元件與原始元件內容物一模一樣,也會因為其元件名稱不同,而被各自打包一次 - 會直接將該元件Pack到Atlas之中
匯出
其他需注意的事項
- Flash CS6會無法匯入超過4096*2048的貼圖(Flash CC無此問題)
會造成無效的BitmapData錯誤訊息
2014年12月11日 星期四
[DragonBones]變換顯示順序 Changeable Z-Order
在製作角色動畫時,時常會有要變換顯示順序的需求,例如原本在身後的武器要移動到身前來,而在Flash要達成這效果,自然就是新增一個同樣也是武器的圖層在想要的順序上,但此時需要注意的是DragonBones對於這點有提供一項功能:Changeable Z-Order,可將這些因變換顯示順序需求而新增的圖層與原始圖層視為同一個骨頭(圖層),利用這點可以有效減少DragonBones角色的骨頭總數,降低進入引擎後的效能消耗。
而要實現這個功能必須要符合規則:
[DragonBones]事件觸發
DragonBones可利用Flash中所設定的影格標籤來觸發事件,達成Hit frame等目的,而設定的標籤須符合「@事件名稱」的規則,如:@attack。
另外標籤所在的圖層也會造成差異,有以下兩種案例:
![]() |
| 事件Label |
- label圖層
設定在label圖層中的事件,在API中是屬於AnimationEvent,此種事件只能獲取到骨架(armature)
![]() |
| AnimationEvent |
- bone圖層(label圖層之外的圖層都是bone圖層)
設定在bone圖層中的事件,在API中是屬於FrameEvent,此種事件可獲取到所屬的骨頭(bone)
因此將事件設定在bone圖層中時,可以順便獲取所屬影格中的元件位置來做定位,舉例,當事件發生時會呼叫一個分離特效並產生在角色的手上,那就可以把事件種在手的圖層中,或者是額外的定位圖層中。
![]() |
| FrameEvent |
2014年12月9日 星期二
[DragonBones]Design Panel V3.0.0 Release Notes
V3.0.0 Release Notes
V3.0.0 includes High priority bug fixing and improvements.
New Features:
1. The new Export panel support:
1)Separate the data format and texture format drop down list.
2)Export AMF(Binary) data format.
3)Modifiable skeleton data filename, texture data filename, etc.
2. Designpanel support drag bones to create bones in armature view.
3. Animation support gotoAndStop.
4. Looped Animation support play backward.
5. Factory and DataParser support delay parse animation data in parse data process.
6. Improve performance by cache animation and adjust animation sampling rate.
7. Improve performance by optimize handling still bones.
Improvements:
1. Designpanel support switch auto tween between key frames in a animation.
2. Designpanel support quickly play previous and next animation in armature.
3. Remove DisplayBridge. Use Slot to replace it. Each rendering engine need to extend Slot to integrated with DragonBones.
V3.0.0 includes High priority bug fixing and improvements.
New Features:
1. The new Export panel support:
1)Separate the data format and texture format drop down list.
2)Export AMF(Binary) data format.
3)Modifiable skeleton data filename, texture data filename, etc.
2. Designpanel support drag bones to create bones in armature view.
3. Animation support gotoAndStop.
4. Looped Animation support play backward.
5. Factory and DataParser support delay parse animation data in parse data process.
6. Improve performance by cache animation and adjust animation sampling rate.
7. Improve performance by optimize handling still bones.
Improvements:
1. Designpanel support switch auto tween between key frames in a animation.
2. Designpanel support quickly play previous and next animation in armature.
3. Remove DisplayBridge. Use Slot to replace it. Each rendering engine need to extend Slot to integrated with DragonBones.
訂閱:
意見 (Atom)








