浏览代码

Added instructions

Björn Ritzl 4 年之前
父节点
当前提交
3b2acf5fc2
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      README.md

+ 19 - 0
README.md

@@ -1,3 +1,22 @@
 # Defold examples
 
 This repository includes the Defold examples application used in the examples section on https://defold.com/examples/basics/simple_move/
+
+## Adding more examples
+Examples are grouped by category, for instance "physics", "sprite" or "collection". Each group of examples has a folder in /examples. Here's how to add a new example named "foobar" to the "sprite" category:
+
+* Create a folder named `foobar` in `examples/sprite`
+* Create `examples/sprite/foobar/foobar.collection` with your example
+* Create `examples/sprite/foobar/foobar.md` with example documentation. The file must start with:
+
+```
+---
+title: Foobar
+brief: This example shows how to use foobar.
+scripts: foobar.script
+---
+```
+
+* List any scripts your example uses in the `scripts` field of the file header
+* Add a new collection proxy in `examples/_main/loader.go`
+* Add a new entry in `examples/_main/menu.gui_script`