瀏覽代碼

Added editor templates

Björn Ritzl 3 年之前
父節點
當前提交
f41016f48b

+ 8 - 4
docs/en/en.json

@@ -539,6 +539,14 @@
                         "path": "/manuals/editor",
                         "name": "Overview"
                     },
+                    {
+                        "path": "/manuals/editor-templates",
+                        "name": "Custom project templates"
+                    },
+                    {
+                        "path": "/manuals/editor-scripts",
+                        "name": "Editor scripts"
+                    },
                     {
                         "path": "/manuals/debugging-game-logic/#running-the-debugger",
                         "name": "Debugger"
@@ -554,10 +562,6 @@
                     {
                         "path": "/manuals/editor-styling",
                         "name": "Styling"
-                    },
-                    {
-                        "path": "/manuals/editor-scripts",
-                        "name": "Editor scripts"
                     }
                 ]
             },

+ 4 - 4
docs/en/manuals/editor-styling.md

@@ -8,10 +8,10 @@ brief: You can modify the colors, typography and other visual aspects of the edi
 You can modify the colors, typography and other visual aspects of the editor using a custom stylesheet:
 
 * Create a folder named `.defold` in your user home directory.
-   * On Windows `C:\Users\**Your Username**\.defold`
-   * On macOS `/Users/**Your Username**/.defold`
-   * On Linux `~/.defold`
- * Create a `editor.css` file in the `.defold` folder
+  * On Windows `C:\Users\**Your Username**\.defold`
+  * On macOS `/Users/**Your Username**/.defold`
+  * On Linux `~/.defold`
+* Create a `editor.css` file in the `.defold` folder
 
 The editor will on startup load your custom stylesheet and apply it on top of the default style. The editor uses JavaFX for the user interface and the stylesheets are almost identical to the CSS files used in a browser to apply style attributes to the elements of a webpage. The default stylesheets for the editor are [available for inspection on GitHub](https://github.com/defold/defold/tree/editor-dev/editor/styling/stylesheets/base).
 

+ 46 - 0
docs/en/manuals/editor-templates.md

@@ -0,0 +1,46 @@
+---
+title: Editor templates
+brief: You can add your own custom project templates to the New Project window.
+---
+
+# Editor templates
+
+You can add your own custom project templates to the New Project window:
+
+![custom project templates](images/editor/custom_project_templates.png)
+
+In order to add one or more new tabs with custom project templates you need to add a `welcome.edn` file in the `.defold` folder in your user home directory:
+
+* Create a folder named `.defold` in your user home directory.
+  * On Windows `C:\Users\**Your Username**\.defold`
+  * On macOS `/Users/**Your Username**/.defold`
+  * On Linux `~/.defold`
+* Create a `welcome.edn` file in the `.defold` folder
+
+The `welcome.edn` file uses the Extensible Data Notation format. Example:
+
+```
+{:new-project
+  {:categories [
+    {:label "My Templates"
+     :templates [
+          {:name "My project"
+           :description "My template with everything set up the way I want it."
+           :image "empty.svg"
+           :zip-url "https://github.com/britzl/template-project/archive/master.zip"
+           :skip-root? true},
+          {:name "My other project"
+           :description "My other template with everything set up the way I want it."
+           :image "empty.svg"
+           :zip-url "https://github.com/britzl/template-other-project/archive/master.zip"
+           :skip-root? true}]
+    }]
+  }
+}
+```
+
+This will create the list of templates seen in the screenshot above.
+
+::: sidenote
+You can only use the template images [bundled with the editor](https://github.com/defold/defold/tree/dev/editor/resources/welcome/images).
+:::

二進制
docs/en/manuals/images/editor/custom_project_templates.png