Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documents for DragonBones support. #5

Merged
merged 2 commits into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions source/zh/asset-workflow/dragonbones.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 骨骼动画资源(DragonBones)

DragonBones 骨骼动画资源是由 [DragonBones](https://dragonbones.com/) 编辑导出的数据格式。

## 导入 DragonBones 骨骼动画资源

DragonBones 骨骼动画资源有:

- .json 骨骼数据
- .json 图集数据
- .png 图集纹理

![DragonBones](dragonbones/import.png)

## 创建骨骼动画资源

在场景中使用 DragonBones 骨骼动画资源需要两个步骤:

**1. 创建节点并添加 DragonBones 组件,可以通过三种方式实现:**

第一种方式:从 **资源管理器** 里将骨骼动画资源拖动到 **层级管理器** 中:

![DragonBones](dragonbones/create_1.png)

第二种方式:从 **资源管理器** 里将骨骼动画资源拖动到 **场景** 中:

![DragonBones](dragonbones/create_2.png)

第三种方式:从 **资源管理器** 里将骨骼动画资源拖动到已创建 DragonBones 组件的 Dragon Asset 属性中:

![DragonBones](dragonbones/create_3.png)

**2. 为 DragonBones 组件设置图集数据**

从 **资源管理器** 里将图集数据拖动到 DragonBones 组件的 Dragon Atlas Asset 属性中:

![DragonBones](dragonbones/set_atlas.png)

## 在项目中的存放

为了提高资源管理效率,建议将导入的资源文件存放在单独的目录下,不要和其他资源混在一起。

<hr>

返回 [资源工作流程](index.md) 说明文档。<br>
继续前往下一章 [内容创作工作流程](../content-workflow/index.md) 说明文档。
Binary file added source/zh/asset-workflow/dragonbones/create_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/zh/asset-workflow/dragonbones/create_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/zh/asset-workflow/dragonbones/create_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/zh/asset-workflow/dragonbones/import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions source/zh/asset-workflow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
- [预制资源(Prefab)](prefab.md)
- [骨骼动画资源(Spine)](spine.md)
- [瓦片图资源(TiledMap)](tiledmap.md)
- [骨骼动画资源(DragonBones)](dragonbones.md)

---

Expand Down
3 changes: 1 addition & 2 deletions source/zh/asset-workflow/tiledmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@

<hr>

返回 [资源工作流程](index.md) 说明文档。<br>
继续前往下一章 [内容创作工作流程](../content-workflow/index.md) 说明文档。
继续前往下一章 [骨骼动画资源(DragonBones)](dragonbones.md) 说明文档。
27 changes: 27 additions & 0 deletions source/zh/components/dragonbones.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DragonBones 组件参考

DragonBones 组件对骨骼动画(DragonBones)资源,进行渲染和播放。

![dragonbones](./dragonbones/properties.png)

点击**属性检查器**下面的添加组件按钮,然后从添加渲染组件中选择 DragonBones,即可添加 DragonBones 组件到节点上。

DragonBones 组件在脚本中的操作请参考 example cases 中的 DragonBones 测试例。

## DragonBones 属性

| 属性 | 功能说明
| -------------- | ----------- |
|Dragon Asset| DragonBones 导出后的骨骼数据(.json)文件
|Dragon Atlas Asset| DragonBones 导出后的图集数据(.json)文件
|Armature| 当前使用的 Armature 名称
|Animation| 当前播放的动画名称
|Time Scale| 播放速度
|Play Times| 动画播放次数(-1 表示使用配置文件中的默认值;0 表示无限循环;>0 表示循环次数)
|Debug Bones| 显示骨骼

> 注意:当使用 DragonBones 组件时,Node 节点上 `Anchor` 与 `Size` 是无效的。

<hr>

继续前往下一章 [脚本开发工作流程](../scripting/index.md)。
Binary file added source/zh/components/dragonbones/properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion source/zh/components/editbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ EditBox 的脚本接口请参考[EditBox API](../api/classes/EditBox.html)。

<hr>

继续前往 [Collider 组件参考](collider.md) 说明文档。
继续前往 [MotionStreak 组件参考](motion-streak.md) 说明文档。
4 changes: 4 additions & 0 deletions source/zh/components/graphics.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ Graphics 组件提供了一系列绘画接口,这些接口参考了 canvas 的
| [fillColor](../graphics/fillColor.md) | 设置或返回填充绘画的颜色

更多关于 **Graphics** 的信息请前往 [绘画](../graphics/index.md)

<hr>

继续前往 [RichText 组件参考](richtext.md) 说明文档。
6 changes: 6 additions & 0 deletions source/zh/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- [Mask](mask.md)
- [ScrollView](scrollview.md)
- [ScrollBar](scrollbar.md)
- [Slider](slider.md)
- [PageView](pageviwe.md)
- [PageViewIndicator](pageviewindicator.md)
- [Layout](layout.md)
- [TiledMap](tiledmap.md)
- [EditBox](editbox.md)
Expand All @@ -20,6 +23,9 @@
- [WebView](webview.md)
- [Graphics](graphics.md)
- [RichText](richtext.md)
- [Toggle](toggle.md)
- [ToggleGroup](toggleGroup.md)
- [DragonBones](dragonbones.md)

<hr>

Expand Down
2 changes: 1 addition & 1 deletion source/zh/components/mask.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Mask 用于规定子节点可渲染的范围,带有 Mask 的组件的节点会

---

继续前往 [MotionStreak 组件参考](motion-streak.md)。
继续前往 [ScrollView 组件参考](scrollview.md)。
2 changes: 1 addition & 1 deletion source/zh/components/motion-streak.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ MotionStreak(拖尾)是 运动条纹,用于游戏对象的运动轨迹上
| fastMode | 是否启用了快速模式。当启用快速模式,新的点会被更快地添加,但精度较低。|
---

继续前往 [ScrollView 组件参考](scrollview.md)。
继续前往 [Collider 组件参考](collider.md)。
2 changes: 2 additions & 0 deletions source/zh/components/richtext.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ RichText 组件用来显示一段带有不同样式效果的文字,你可以
另外,如果能不使用富文本组件,就尽量使用普通的文本组件,并且 BMFont 的效率是最高的。

---

继续前往 [Toggle 组件参考](toggle.md) 说明文档。
2 changes: 1 addition & 1 deletion source/zh/components/tiledmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ TiledMap(地图)用于在游戏中显示 TMX 格式的地图。在节点上

---

继续前往下一章 [脚本开发工作流程](../scripting/index.md)。
继续前往 [EditBox 组件参考](editbox.md) 说明文档
2 changes: 2 additions & 0 deletions source/zh/components/toggleGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ ToggleGroup 的脚本接口请参考[ToggleGroup API](../api/classes/toggleGroup
ToggleGroup 一般不会单独使用,它需要与 `Toggle` 配合使用来实现 RadioButton 的单选效果。

---

继续前往 [DragonBones 组件参考](dragonbones.md) 说明文档。
2 changes: 1 addition & 1 deletion source/zh/components/videoplayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ VideoPlayer 的脚本接口请参考 [VideoPlayer API](../api/classes/VideoPlaye

<hr>

继续前往 [Graphics 组件参考](graphics.md) 说明文档。
继续前往 [WebView 组件参考](webview.md) 说明文档。
2 changes: 2 additions & 0 deletions source/zh/components/webview.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ WebView 的脚本接口请参考 [WebView API](../api/classes/WebView.html)。
此控件暂时不支持加载指定 HTML 文件或者执行 Javascript 脚本。

<hr>

继续前往 [Graphics 组件参考](graphics.md) 说明文档。