引擎¶
继承: Object
类别: 核心
简要说明¶
访问基本引擎属性。
属性¶
真 |
||
60 |
||
0.5 |
||
0 |
||
1.0 |
方法¶
get_author_info ( ) const |
|
get_copyright_info ( ) const |
|
get_donor_info ( ) const |
|
get_frames_drawn ( ) |
|
get_frames_per_second ( ) const |
|
get_license_info ( ) const |
|
get_license_text ( ) const |
|
get_main_loop ( ) const |
|
get_physics_interpolation_fraction ( ) const |
|
get_singleton ( String name ) const |
|
get_version_info ( ) const |
|
has_singleton ( String name ) const |
|
is_in_physics_frame ( ) const |
描述¶
这个 Engine
类允许您查询和修改项目的运行时参数,例如每秒帧数、时间刻度等。
属性描述¶
bool editor_hint
违约 |
真 |
设定器 |
设置编辑器提示(值) |
吸气剂 |
是u编辑器u提示() |
如果 true
,它在编辑器中运行。对工具脚本很有用。
int iterations_per_second
违约 |
60 |
设定器 |
设置每秒的迭代次数(值) |
吸气剂 |
获取每秒的迭代次数 |
每秒固定迭代次数(对于固定过程和物理)。
float physics_jitter_fix
违约 |
0.5 |
设定器 |
设置物理抖动固定(值) |
吸气剂 |
获取物理抖动修正值 |
int target_fps
违约 |
0 |
设定器 |
设置目标fps(值) |
吸气剂 |
获取目标fps() |
每秒所需的帧数。如果硬件无法跟上,则可能不遵守此设置。值为0表示没有限制。
float time_scale
违约 |
1.0 |
设定器 |
设置时间刻度(值) |
吸气剂 |
获取时间刻度()。 |
控制游戏中时钟滴答与现实中时钟滴答的速度或速度。默认为1.0。值为2.0意味着游戏的移动速度是现实生活的两倍,而值为0.5意味着游戏的移动速度是正常速度的一半。
方法说明¶
Dictionary get_author_info ( ) const
返回字典中的引擎作者信息。
lead_developers
-字符串数组,主要开发人员名称
founders
-字符串数组,创建者名称
project_managers
-字符串数组,项目管理器名称
developers
-字符串数组,开发人员名称
Array get_copyright_info ( ) const
返回版权信息字典数组。
name
-字符串,组件名称
parts
-字典数组``文件`, copyright
, license
}描述组件的子部分
Dictionary get_donor_info ( ) const
返回捐助者名称数组的字典。
{platinum_sponsors
, gold_sponsors
, mini_sponsors
, gold_donors
, silver_donors
, bronze_donors
}
int get_frames_drawn ( )
返回绘制的帧总数。
float get_frames_per_second ( ) const
返回正在运行的游戏的每秒帧数。
Dictionary get_license_info ( ) const
返回godot使用的许可证字典以及包含的第三方组件。
String get_license_text ( ) const
返回Godot许可证文本。
MainLoop get_main_loop ( ) const
返回主循环对象(请参见 MainLoop 和 SceneTree )
float get_physics_interpolation_fraction ( ) const
返回呈现帧时当前物理标记的分数。这可以用来实现固定的时间步插值。
Dictionary get_version_info ( ) const
返回字典中的当前引擎版本信息。
major
-将主版本号保留为int
minor
-将次要版本号保留为int
patch
-将修补程序版本号保留为int
hex
-保留以十六进制整数编码的完整版本号,每个数字有一个字节(2个位置)(见下面的示例)
status
-保持状态(例如“beta”、“rc1”、“rc2”…)稳定”)作为字符串
build
-将构建名称(例如“自定义构建”)保留为字符串
hash
-将完整的git提交哈希保留为字符串
year
-保留版本作为int发布的年份
string
- major
+ minor
+ patch
+ status
+ build
在单个字符串中
这个 hex
值从左到右按如下方式编码:一个字节表示主要,一个字节表示次要,一个字节表示补丁版本。例如,“3.1.12”是 0x03010C
. 注: 它在内部仍然是一个int,打印它将给您提供它的十进制表示,这并不是特别有意义。使用十六进制文字,以便从代码进行版本比较:
if Engine.get_version_info().hex >= 0x030200:
# Do things specific to version 3.2 or later
else:
# Do things specific to versions before 3.2
bool is_in_physics_frame ( ) const
返回 true
如果游戏处于游戏循环的固定过程和物理阶段。