SceneTree类

SceneTree
继承: MainLoop < Object

Manages the game loop via a hierarchy of nodes.
通过节点层次结构管理游戏循环。

Description描述
As one of the most important classes, the SceneTree manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.
作为最重要的类之一,SceneTree管理场景中节点的层次结构以及场景本身。 可以添加,检索和删除节点。 整个场景树(以及当前场景)都可以暂停。 可以加载,切换和重新加载场景。

You can also use the SceneTree to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. a “enemy” group. You can then iterate these groups or even call methods and set properties on all the group’s members at once.
你也可以使用SceneTree将你的节点组织成组:每个节点都可以按照你想创建的数量分配组,比如一个“敌人”组。然后可以迭代这些组,甚至一次调用方法并设置组的所有成员的属性。

SceneTree is the default MainLoop implementation used by scenes, and is thus in charge of the game loop.
SceneTree是场景使用的默认主循环实现,因此负责游戏循环。

Methods

void set_input_as_handled ( )
Marks the most recent InputEvent as handled.
将最近的InputEvent标记为已处理。

你可能感兴趣的:(Godot,类,游戏,游戏开发)