Godot编辑器介绍

This tutorial will run you through Godot's interface. We're going to look at the Project Manager, docks, workspaces and everything you need to know to get started with the engine.

项目管理器

When you launch Godot, the first window you'll see is the Project Manager. Since you have no projects there will be a popup asking if you want to open the asset library, just click cancel, we'll look at it later.

../../_images/project_manager_first_open.png

当启动Godot,看到的第一个窗口就是项目管理器。它允许创建、移除、导入或运行游戏项目。

../../_images/editor_ui_intro_project_manager_01.png

In the top-right corner you'll find a drop-down menu to change the editor's language.

../../_images/editor_ui_intro_project_manager_02.png

模板 选项卡里,你可以从素材库中下载开源的项目模板和示例来帮助你快速入门。只需选择你想要的模板或示例,然后点击下载。下载完成后,点击安装并选择项目存储路径。更多相关内容我们会在 关于资产库 中学习。

../../_images/editor_ui_intro_project_manager_03.png

创建或导入项目

要创建新项目,点击右侧的 新建项目 按钮。为其命名并在计算机上选择一个空文件夹来保存它,最后选择一个渲染器。

../../_images/editor_ui_intro_project_manager_04.png

Click the Browse button to open Godot's file browser and pick a location or type the folder's path in the Project Path field.

../../_images/editor_ui_intro_project_manager_05.png

当看到右侧出现绿色的勾,表示引擎检测到了一个空文件夹.你也可以点击项目名称旁边的 ``创建``按钮 ,Godot会创建项目并在编辑器打开它。

在这个步骤你可以选择渲染后端(OpenGL ES 3.0 或者 OpenGL ES 2.0)。两者的优缺点已经列出帮助你做出选择,详细内容请参考 GLES2和GLES3之间的一般差异 你也可以在之后任何时候通过项目设置面板来更改渲染后端。对于本样例内容,两者任选其一都是ok的。

当你完成之后,点击``创建 & 编辑``。引擎会帮你创建项目并在编辑器中打开。

The next time you open the project manager, you'll see your new project in the list. Double click on it to open it in the editor.

../../_images/editor_ui_intro_project_manager_06.png

可以用类似方式导入已有项目。点击导入按钮,找到含有项目或 project.godot 文件的目录就可以导入并编辑它了。

../../_images/editor_ui_intro_project_manager_08.png

如果目录路径正确,会看到绿色的对号。

../../_images/editor_ui_intro_project_manager_09.png

Your first look at Godot's editor

Welcome to Godot! With your project open, you should see the editor's interface with menus along the top of the interface and docks along the far extremes of the interface on either side of the viewport.

../../_images/editor_ui_intro_editor_interface_overview.png

在顶部,从左到右,可以看到 主菜单工作区 以及 各调试按钮

The FileSystem dock is where you'll manage your project files and assets.

../../_images/editor_ui_intro_dock_filesystem.png

The Scene dock lists the active scene's content and the Inspector allows for the management of the properties of a scene's content.

../../_images/editor_ui_intro_dock_inspector.png

In the center, you have the Toolbar at the top, where you'll find tools to move, scale or lock your scene's objects. It changes as you jump to different workspaces.

../../_images/editor_ui_intro_editor_02_toolbar.png

The Bottom Panel is the host for the debug console, the animation editor, the audio mixer… They are wide and can take precious space. That's why they're folded by default.

../../_images/editor_ui_intro_editor_03_animation_player.png

工作区

可以在顶部看到有四个工作区按钮:2D、3D、脚本和素材库。

You'll use the 2D workspace for all types of games. In addition to 2D games, the 2D workspace is where you'll build your interfaces. Press F1 (or Alt + 1 on macOS) to access it.

../../_images/editor_ui_intro_editor_04_2d_workspace.png

In the 3D workspace, you can work with meshes, lights, and design levels for 3D games. Press F2 (or Alt + 2 on macOS) to access it.

../../_images/editor_ui_intro_editor_05_3d_workspace.png

注意工具栏下的透视图按钮,它会打开一个与3D视图相关的选项列表。

../../_images/editor_ui_intro_editor_06_3d_workspace.png

注解

更多关于 3D 工作区 的细节,请查看 3D简介

The Script workspace is a complete code editor with a debugger, rich auto-completion, and built-in code reference. Press F3 (or Alt + 3 on macOS) to access it, and Shift + F1 to search the reference.

../../_images/editor_ui_intro_editor_06_script_workspace_expanded.png

To search for information about a class, method, property, constant, or signal in the engine while you are writing a script, press the "Search Help" button at the top right of the Script workspace.

../../_images/editor_ui_intro_script_search_documentation.png

A new window will pop up. Search for the item that you want to find information about.

../../_images/editor_ui_intro_script_search_help_window.png

单击您正在查找的目标,然后点击“打开”。该目标的文档将会在脚本工作区显示出来。

../../_images/editor_ui_intro_script_class_documentation.png

Finally, the AssetLib is a library of free and open source add-ons, scripts and assets to use in your projects.

调整界面

Godot's interface lives in a single window. You cannot split it across multiple screens although you can work with an external code editor like Atom or Visual Studio Code for instance.

移动、重新调整面板尺寸

点击并拖动面板边缘可以水平或垂直地重新调整尺寸。

../../_images/editor_ui_intro_editor_07.png

点击任意停靠面板顶部的三点图标可以改变它的位置。

../../_images/editor_ui_intro_editor_08.png

转到 编辑器(Editor) ‣ 编辑器设置(Editor Settings) 可以微调编辑器的外观。