小编Cod*_*Guy的帖子

godot4游戏启动时如何设置屏幕分辨率

因为我的全屏godot 游戏可以在许多平台上使用(例如 Mac、Windows),所以我必须确保每次我的游戏第一次启动时,它都会检查其所在的操作系统和设备,并为设备设置正确的分辨率。我该怎么做呢?我想要这样的东西:

func _ready():
    device = project.get_device()
    project_settings.set_setting("window_width", device.width)
    project_settings.set_setting("window_height", device.height)
    project_settings.save()
Run Code Online (Sandbox Code Playgroud)

请注意,我编写的代码不是实际的 GDscript,它只是我想要的示例。

fullscreen screen-resolution godot4

2
推荐指数
1
解决办法
3382
查看次数

标签 统计

fullscreen ×1

godot4 ×1

screen-resolution ×1