godot游戏引擎自学入门笔记-- 创建hello world,官方文档翻译(二)

版权声明:本文为博主dark_tone暗色调 原创文章,未经博主允许不得转载。 https://blog.csdn.net/dark_tone/article/details/89038915

And finally, create the Label! A lot happens when Create is pressed:

添加节点(ctrl+a),选择label
在这里插入图片描述

First of all, the scene changes to the 2D editor (because Label is a 2D Node type), and the Label appears, selected, at the top left corner of the viewport.

‘首先,场景会转换成2d编辑,因为Label是2d节点类型’,标签出现在视图的左上角
在这里插入图片描述

The node appears in the scene tree editor (box in the top right corner), and the label properties appear in the Inspector (box in the bottom right corner).

‘节点出现在场景树编辑器中(左上角框),标签属性出现在检查器中(右侧)’

The next step will be to change the “Text” Property of the label. Let’s change it to “Hello World”:

‘下一步是改变标签的文本属性,改成hello world
在这里插入图片描述
但是godot 怎么输入中文?
查询了一下,原来是要建立新资源,把windows字体放进去。
在这里插入图片描述
建立一个新的文件夹font。
去windows字体里找一个喜欢的,放进文件夹font
在这里插入图片描述
然后在label属性栏里选择custom fonts

在这里插入图片描述
选择新建dynamic字体
在这里插入图片描述
然后在dynamic栏目下,选择font data
在这里插入图片描述
选择加载font文件夹下的STSONG.TTF
在这里插入图片描述
在这里插入图片描述
中文就可以使用了,另外在dynamic栏目下setting里
在这里插入图片描述
把use mip和usefilter打勾,避免中文放大后产生模糊。

到了这一步,就可以按F6运行场景,看看效果。
在这里插入图片描述
场景必须要保存才能运行。
取个名字叫hello.tscn
在这里插入图片描述
不过我运行后什么都没发生,反而跳出bug

bug 127.0.0.1:6007 --allow_focus_steal_pid 4468 --position 448,240

不懂什么意思。

搞明白了,原来是鼠标拖动的太远,超过了可显示区域。应该在紫线范围内:
在这里插入图片描述
在这里插入图片描述

配置项目

Right now, the only way to run something is to execute the current scene. Projects, however, may have several scenes, so one of them must be set as the main scene. This is the scene that will be loaded any time the project is run.

目前,运行事物的唯一方法是执行当前场景。 项目,不管怎么说,可能会有好几个场景,所以它们中的一个必须被设置为主要场景,主场景就是项目运行时将被加载的场景。

These settings are all stored in a project.godot file, which is a plaintext file in win.ini format (for easy editing). There are dozens of settings that you can change in this file to alter how a project executes. To simplify this process, Godot provides a project settings dialog, which acts as a sort of frontend to editing a project.godot file.

这些设置都存储在一个godot项目文件中,这个项目文件属于win.ini格式(容易编辑).您可以在这个文件中更改许多设置,为了简化这个过程,godot提供了一个项目设置对话框,对话框作为一个前端来编辑一个GoDOT项目文件。
在这里插入图片描述
这个对话框就是“项目设置”

猜你喜欢

转载自blog.csdn.net/dark_tone/article/details/89038915