编辑器在布局排版, 切换导航上设计得尽量让游戏开发更有效率. 编辑各个视图里的文件时都会有适当的编辑器自动弹出以方便使用.
打开 Defold 编辑器, 首先呈现的是一个项目选择和新建窗口. 通过点选上面的按钮可以:
新建项目完成后所有项目文件都保存在了本地硬盘上.
详情请见 项目设立教程.
Defold 编辑器被划分为许多面板, 或称视图, 以展示和编辑数据.
中间的视图显示当前打开的文件. 所有可视视图都可以进行如下操作:
场景试图右上角的工具栏里也有这些功能按钮: 平移, 旋转 和 缩放.
如果同时打开了多个文件, 编辑器视图上方就会出现多个标签. 要想两个视图对照着同时进行编辑工作. 右键点击 想要移动的视图标签, 然后选择 Move to Other Tab Pane.
使用视图标签还可以让两个视图交换位置或者把多个面板合为一组.
双击集合文件或者游戏对象文件就会打开 场景编辑器:
大纲中还可以:
按住 Shift 或 ⌘ (Mac) / Ctrl (Win/Linux) 键可以在已选中物体的基础上增选物体.
被选中的物体会显示出坐标轴 (方块和箭头). 拖拽绿方块可以在屏幕空间内任意移动这个物体, 拖拽箭头则是让这个物体在 X, Y 或 Z 轴上进行移动. 拖拽别的方块则可以让这个物体在 X-Y 平面上 (在3D视图中可见) 移动或者在 X-Z , Y-Z 平面上移动.
旋转工具的坐标轴显示为圆形. 拖拽橙色的圆可以在屏幕空间内任意旋转这个物体, 可以沿着 X, Y 和 Z 轴旋转. 因为 X 和 Y 轴的位置关系, 在2D视图上仅显示为穿过物体的两条线.
缩放工具坐标轴显示为一组方块. 拖拽中间的方块可以将物体等比缩放 (包括Z轴). 同样也可以沿着 X, Y 和 Z 轴方向, 以及 X-Y , X-Z 和 Y-Z 平面上进行缩放.
新建资源文件有两种方法, 通过点选菜单栏 File ▸ New... 按钮, 或者使用上下文菜单:
在 资源 浏览器目标位置 右键单击 , 选择 New... ▸ [file type] 按钮:
为新文件取一个有意义的名字. 完整文件名包括类型扩展名会显示在 路径 对话框内:
要向项目添加资源 (图片, 声音, 模型等) 文件, 只需把文件拖放到 资源 浏览器里适当的位置上. 这样做实际上是把文件系统中的资源文件 拷贝 到项目中来. 详情请见 导入资源教程.
Command | Windows | macOS | Linux |
---|---|---|---|
Add | A | A | A |
Add secondary | Shift+A | Shift+A | Shift+A |
Backwards tab trigger | Shift+Tab | Shift+Tab | Shift+Tab |
Beginning of file | Ctrl+Home | Cmd+Up | Ctrl+Home |
Beginning of line | Ctrl+A | ||
Beginning of line text | Home | Home | Home |
Build | Ctrl+B | Cmd+B | Ctrl+B |
Close | Ctrl+W | Cmd+W | Ctrl+W |
Close all | Shift+Ctrl+W | Shift+Cmd+W | Shift+Ctrl+W |
Continue | F5 | F5 | F5 |
Copy | Ctrl+C | Cmd+C | Ctrl+C |
Cut | Ctrl+X | Cmd+X | Ctrl+X |
Delete | Delete | Delete | Delete |
Delete backward | Backspace | Backspace | Backspace |
Delete line | Ctrl+D | ||
Delete next word | Ctrl+Delete | Alt+Delete | Ctrl+Delete |
Delete prev word | Ctrl+Backspace | Alt+Backspace | Ctrl+Backspace |
Delete to end of line | Shift+Ctrl+Delete | Cmd+Delete | Shift+Ctrl+Delete |
Documentation | F1 | F1 | F1 |
Down | Down | Down | Down |
End of file | Ctrl+End | Cmd+Down | Ctrl+End |
End of line | End | Ctrl+E | End |
Enter | Enter | Enter | Enter |
Erase tool | Shift+E | Shift+E | Shift+E |
Escape | Esc | Esc | Esc |
Find next | Ctrl+G | Cmd+G | Ctrl+G |
Find prev | Shift+Ctrl+G | Shift+Cmd+G | Shift+Ctrl+G |
Find text | Ctrl+F | Cmd+F | Ctrl+F |
Frame selection | F | F | F |
Goto line | Ctrl+L | Cmd+L | Ctrl+L |
Hide selected | Ctrl+E | Cmd+E | Ctrl+E |
Hot reload | Ctrl+R | Cmd+R | Ctrl+R |
Left | Left | Left | Left |
Move down | Alt+Down | Alt+Down | Alt+Down |
Move tool | W | W | W |
Move up | Alt+Up | Alt+Up | Alt+Up |
New file | Ctrl+N | Cmd+N | Ctrl+N |
Next word | Ctrl+Right | Alt+Right | Ctrl+Right |
Open | Ctrl+O | Cmd+O | Ctrl+O |
Open asset | Shift+Ctrl+R | Cmd+P | Shift+Ctrl+R |
Page down | Page Down | Page Down | Page Down |
Page up | Page Up | Page Up | Page Up |
Paste | Ctrl+V | Cmd+V | Ctrl+V |
Preferences | Ctrl+Comma | Cmd+Comma | Ctrl+Comma |
Prev word | Ctrl+Left | Alt+Left | Ctrl+Left |
Proposals | Ctrl+Space | Ctrl+Space | Ctrl+Space |
Quit | Ctrl+Q | Cmd+Q | Ctrl+Q |
Realign camera | Period | Period | Period |
Rebuild | Shift+Ctrl+B | Shift+Cmd+B | Shift+Ctrl+B |
Rebundle | Ctrl+U | Cmd+U | Ctrl+U |
Redo | Shift+Ctrl+Z | Shift+Cmd+Z | Shift+Ctrl+Z |
Reindent | Ctrl+I | Ctrl+I | Ctrl+I |
Reload stylesheet | Ctrl+R | ||
Rename | F2 | F2 | F2 |
Replace next | Shift+Ctrl+H | Alt+Cmd+G | Shift+Ctrl+H |
Replace text | Alt+Cmd+F | ||
Right | Right | Right | Right |
Rotate tool | E | E | E |
Save all | Ctrl+S | Cmd+S | Ctrl+S |
Scale tool | R | R | R |
Scene stop | Ctrl+T | Cmd+T | Ctrl+T |
Search in files | Shift+Ctrl+F | Shift+Cmd+F | Shift+Ctrl+F |
Select all | Ctrl+A | Cmd+A | Ctrl+A |
Select beginning of file | Shift+Ctrl+Home | Shift+Cmd+Up | Shift+Ctrl+Home |
Select beginning of line | Shift+Ctrl+A | ||
Select beginning of line text | Shift+Home | Shift+Home | Shift+Home |
Select down | Shift+Down | Shift+Down | Shift+Down |
Select end of file | Shift+Ctrl+End | Shift+Cmd+Down | Shift+Ctrl+End |
Select end of line | Shift+End | Shift+Alt+Down | Shift+End |
Select left | Shift+Left | Shift+Left | Shift+Left |
Select next occurrence | Ctrl+D | Cmd+D | Ctrl+D |
Select next word | Shift+Ctrl+Right | Shift+Alt+Right | Shift+Ctrl+Right |
Select page down | Shift+Page Down | Shift+Page Down | Shift+Page Down |
Select page up | Shift+Page Up | Shift+Page Up | Shift+Page Up |
Select prev word | Shift+Ctrl+Left | Shift+Ctrl+Left | Shift+Ctrl+Left |
Select right | Shift+Right | Shift+Right | Shift+Right |
Show last hidden | Shift+Ctrl+E | Shift+Cmd+E | Shift+Ctrl+E |
Show palette | Space | Space | Space |
Split selection into lines | Shift+Ctrl+L | Shift+Cmd+L | Shift+Ctrl+L |
Step into | F11 | F11 | F11 |
Step out | Shift+F11 | Shift+F11 | Shift+F11 |
Step over | F10 | F10 | F10 |
Stop debugger | Shift+F5 | Shift+F5 | |
Tab | Tab | Tab | Tab |
Toggle breakpoint | F9 | F9 | F9 |
Toggle comment | Ctrl+Slash | Cmd+Slash | Ctrl+Slash |
Toggle component guides | Ctrl+H | Ctrl+Cmd+H | Ctrl+H |
Toggle pane bottom | F7 | F7 | F7 |
Toggle pane left | F6 | F6 | F6 |
Toggle pane right | F8 | F8 | F8 |
Toggle visibility filters | Shift+Ctrl+I | Shift+Cmd+I | Shift+Ctrl+I |
Undo | Ctrl+Z | Cmd+Z | Ctrl+Z |
Up | Up | Up | Up |
Up major | Shift+Up | Shift+Up | Shift+Up |
Zoom in | Ctrl+'+' | Cmd+'+' | Ctrl+'+' |
Zoom out | Ctrl+'-' | Cmd+'-' | Ctrl+'-' |
可以創建配置文件以自定義快捷鍵 (例如 home 文件夾下的 keymap.edn
文件). 然後選擇 File ▸ Preferences, 設置 Path to custom keymap 為自定義的配置文件. 設置好之後重啓 Defold 才會生效, 每次修改都要重啓.
這些配置文件可以用來參考: Windows, MacOS 和 Linux
使用编辑器时如果遇到了麻烦可以 向我们汇报, 并且连同编辑器日志一起上报. 编辑器日志存放路径如下:
C:\Users\ **Your Username** \AppData\Local\Defold
/Users/ **Your Username** /Library/Application Support/
或 ~/Library/Application Support/Defold
~/.Defold
如果用命令行启动编辑器那么日志会显示在控制台上. 例如从 macOS 终端启动 Defold 编辑器:
$ > ./path/to/Defold.app/Contents/MacOS/Defold
A: The editor will use up to 75% of the available memory of the system. On a computer with 4 GB of RAM this should be enough for smaller Defold projects. For mid-sized or large projects it is recommended to use 6 GB or more of RAM.
A: Yes. The Defold beta editor checks for an update at startup, just like the Defold stable version does.
A: This error is related to problems with Java assistive technology such as the NVDA screen reader. You probably have an .accessibility.properties
file in your home folder. Remove the file and try launching the editor again. (Note: If you do use any assistive technology and require that file to be present then please reach out to us at info@defold.se to discuss alternative solutions).
Discussed here on the Defold forum.
A: Check if there are spaces in the path leading up to the Defold application. For instance, if you put the folder Defold-macosx containing the macOS version of the editor in your Applications folder, then you should be ok. If you rename the folder Defold macosx the editor might not start anymore. On Windows, putting Defold under C:\Program Files\ can trigger this problem. This is due to a known bug in the underlying Eclipse framework.
A: This exception occurs when the editor tries to make an https connection but the certificate chain provided by the server cannot be verified.
See this link for details on this error.
Did you spot an error or do you have a suggestion? Please let us know on GitHub!
GITHUB