Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

ProjectSettings

继承: Object

存储全局变量。

描述

储存可以从任何地方访问的变量。请使用 get_settingset_settinghas_setting 访问。存储在 project.godot 中的变量也会被加载到 ProjectSettings 中,因此这个对象常用于读取自定义游戏配置选项。

指定“项目设置”的属性时,请使用设置的完整路径,包括类别。例如项目名称应使用 "application/config/name"。类别和属性名称可以在“项目设置”对话框中查看。

特性标签:可以使用特性标签来针对特定的平台和配置(调试、发布……)做项目设置的覆盖。

覆盖:在项目的根目录下创建名为 override.cfg 的文件,就可以对任意项目设置进行覆盖。对于已导出的项目,把这个文件放在与项目二进制文件相同的目录下,也可以达到覆盖的目的。覆盖时仍会考虑基础项目设置的特性标签。因此,如果你想让它们在所有平台和配置上覆盖基础项目设置,请确保也用所需的特性标签覆盖该设置。

教程

属性

Color

application/boot_splash/bg_color

Color(0.14, 0.14, 0.14, 1)

bool

application/boot_splash/fullsize

true

String

application/boot_splash/image

""

int

application/boot_splash/minimum_display_time

0

bool

application/boot_splash/show_image

true

bool

application/boot_splash/use_filter

true

bool

application/config/auto_accept_quit

true

String

application/config/custom_user_dir_name

""

String

application/config/description

""

String

application/config/icon

""

String

application/config/macos_native_icon

""

String

application/config/name

""

Dictionary

application/config/name_localized

{}

String

application/config/project_settings_override

""

bool

application/config/quit_on_go_back

true

bool

application/config/use_custom_user_dir

false

bool

application/config/use_hidden_project_data_directory

true

String

application/config/version

""

String

application/config/windows_native_icon

""

bool

application/run/delta_smoothing

true

bool

application/run/disable_stderr

false

bool

application/run/disable_stdout

false

bool

application/run/flush_stdout_on_print

false

bool

application/run/flush_stdout_on_print.debug

true

int

application/run/frame_delay_msec

0

bool

application/run/low_processor_mode

false

int

application/run/low_processor_mode_sleep_usec

6900

String

application/run/main_loop_type

"SceneTree"

String

application/run/main_scene

""

int

application/run/max_fps

0

float

audio/buses/channel_disable_threshold_db

-60.0

float

audio/buses/channel_disable_time

2.0

String

audio/buses/default_bus_layout

"res://default_bus_layout.tres"

String

audio/driver/driver

bool

audio/driver/enable_input

false

int

audio/driver/mix_rate

44100

int

audio/driver/mix_rate.web

0

int

audio/driver/output_latency

15

int

audio/driver/output_latency.web

50

float

audio/general/2d_panning_strength

0.5

float

audio/general/3d_panning_strength

0.5

bool

audio/general/ios/mix_with_others

false

int

audio/general/ios/session_category

0

bool

audio/general/text_to_speech

false

int

audio/video/video_delay_compensation_ms

0

bool

collada/use_ambient

false

int

compression/formats/gzip/compression_level

-1

int

compression/formats/zlib/compression_level

-1

int

compression/formats/zstd/compression_level

3

bool

compression/formats/zstd/long_distance_matching

false

int

compression/formats/zstd/window_log_size

27

Color

debug/canvas_items/debug_redraw_color

Color(1, 0.2, 0.2, 0.5)

float

debug/canvas_items/debug_redraw_time

1.0

bool

debug/file_logging/enable_file_logging

false

bool

debug/file_logging/enable_file_logging.pc

true

String

debug/file_logging/log_path

"user://logs/godot.log"

int

debug/file_logging/max_log_files

5

int

debug/gdscript/warnings/assert_always_false

1

int

debug/gdscript/warnings/assert_always_true

1

int

debug/gdscript/warnings/confusable_identifier

1

int

debug/gdscript/warnings/confusable_local_declaration

1

int

debug/gdscript/warnings/confusable_local_usage

1

int

debug/gdscript/warnings/constant_used_as_function

1

int

debug/gdscript/warnings/deprecated_keyword

1

int

debug/gdscript/warnings/empty_file

1

bool

debug/gdscript/warnings/enable

true

bool

debug/gdscript/warnings/exclude_addons

true

int

debug/gdscript/warnings/function_used_as_property

1

int

debug/gdscript/warnings/get_node_default_without_onready

2

int

debug/gdscript/warnings/incompatible_ternary

1

int

debug/gdscript/warnings/inference_on_variant

2

int

debug/gdscript/warnings/inferred_declaration

0

int

debug/gdscript/warnings/int_as_enum_without_cast

1

int

debug/gdscript/warnings/int_as_enum_without_match

1

int

debug/gdscript/warnings/integer_division

1

int

debug/gdscript/warnings/narrowing_conversion

1

int

debug/gdscript/warnings/native_method_override

2

int

debug/gdscript/warnings/onready_with_export

2

int

debug/gdscript/warnings/property_used_as_function

1

int

debug/gdscript/warnings/redundant_await

1

int

debug/gdscript/warnings/redundant_static_unload

1

bool

debug/gdscript/warnings/renamed_in_godot_4_hint

1

int

debug/gdscript/warnings/return_value_discarded

0

int

debug/gdscript/warnings/shadowed_global_identifier

1

int

debug/gdscript/warnings/shadowed_variable

1

int

debug/gdscript/warnings/shadowed_variable_base_class

1

int

debug/gdscript/warnings/standalone_expression

1

int

debug/gdscript/warnings/standalone_ternary

1

int

debug/gdscript/warnings/static_called_on_instance

1

int

debug/gdscript/warnings/unassigned_variable

1

int

debug/gdscript/warnings/unassigned_variable_op_assign

1

int

debug/gdscript/warnings/unreachable_code

1

int

debug/gdscript/warnings/unreachable_pattern

1

int

debug/gdscript/warnings/unsafe_call_argument

0

int

debug/gdscript/warnings/unsafe_cast

0

int

debug/gdscript/warnings/unsafe_method_access

0

int

debug/gdscript/warnings/unsafe_property_access

0

int

debug/gdscript/warnings/unsafe_void_return

1

int

debug/gdscript/warnings/untyped_declaration

0

int

debug/gdscript/warnings/unused_local_constant

1

int

debug/gdscript/warnings/unused_parameter

1

int

debug/gdscript/warnings/unused_private_class_variable

1

int

debug/gdscript/warnings/unused_signal

1

int

debug/gdscript/warnings/unused_variable

1

String

debug/settings/crash_handler/message

"Please include this when reporting the bug to the project developer."

String

debug/settings/crash_handler/message.editor

"Please include this when reporting the bug on: https://github.com/godotengine/godot/issues"

int

debug/settings/gdscript/max_call_stack

1024

int

debug/settings/profiler/max_functions

16384

bool

debug/settings/stdout/print_fps

false

bool

debug/settings/stdout/print_gpu_profile

false

bool

debug/settings/stdout/verbose_stdout

false

bool

debug/shader_language/warnings/device_limit_exceeded

true

bool

debug/shader_language/warnings/enable

true

bool

debug/shader_language/warnings/float_comparison

true

bool

debug/shader_language/warnings/formatting_error

true

bool

debug/shader_language/warnings/treat_warnings_as_errors

false

bool

debug/shader_language/warnings/unused_constant

true

bool

debug/shader_language/warnings/unused_function

true

bool

debug/shader_language/warnings/unused_local_variable

true

bool

debug/shader_language/warnings/unused_struct

true

bool

debug/shader_language/warnings/unused_uniform

true

bool

debug/shader_language/warnings/unused_varying

true

Color

debug/shapes/avoidance/agents_radius_color

Color(1, 1, 0, 0.25)

bool

debug/shapes/avoidance/enable_agents_radius

true

bool

debug/shapes/avoidance/enable_obstacles_radius

true

bool

debug/shapes/avoidance/enable_obstacles_static

true

Color

debug/shapes/avoidance/obstacles_radius_color

Color(1, 0.5, 0, 0.25)

Color

debug/shapes/avoidance/obstacles_static_edge_pushin_color

Color(1, 0, 0, 1)

Color

debug/shapes/avoidance/obstacles_static_edge_pushout_color

Color(1, 1, 0, 1)

Color

debug/shapes/avoidance/obstacles_static_face_pushin_color

Color(1, 0, 0, 0)

Color

debug/shapes/avoidance/obstacles_static_face_pushout_color

Color(1, 1, 0, 0.5)

Color

debug/shapes/collision/contact_color

Color(1, 0.2, 0.1, 0.8)

bool

debug/shapes/collision/draw_2d_outlines

true

int

debug/shapes/collision/max_contacts_displayed

10000

Color

debug/shapes/collision/shape_color

Color(0, 0.6, 0.7, 0.42)

Color

debug/shapes/navigation/agent_path_color

Color(1, 0, 0, 1)

float

debug/shapes/navigation/agent_path_point_size

4.0

Color

debug/shapes/navigation/edge_connection_color

Color(1, 0, 1, 1)

bool

debug/shapes/navigation/enable_agent_paths

true

bool

debug/shapes/navigation/enable_agent_paths_xray

true

bool

debug/shapes/navigation/enable_edge_connections

true

bool

debug/shapes/navigation/enable_edge_connections_xray

true

bool

debug/shapes/navigation/enable_edge_lines

true

bool

debug/shapes/navigation/enable_edge_lines_xray

true

bool

debug/shapes/navigation/enable_geometry_face_random_color

true

bool

debug/shapes/navigation/enable_link_connections

true

bool

debug/shapes/navigation/enable_link_connections_xray

true

Color

debug/shapes/navigation/geometry_edge_color

Color(0.5, 1, 1, 1)

Color

debug/shapes/navigation/geometry_edge_disabled_color

Color(0.5, 0.5, 0.5, 1)

Color

debug/shapes/navigation/geometry_face_color

Color(0.5, 1, 1, 0.4)

Color

debug/shapes/navigation/geometry_face_disabled_color

Color(0.5, 0.5, 0.5, 0.4)

Color

debug/shapes/navigation/link_connection_color

Color(1, 0.5, 1, 1)

Color

debug/shapes/navigation/link_connection_disabled_color

Color(0.5, 0.5, 0.5, 1)

Color

debug/shapes/paths/geometry_color

Color(0.1, 1, 0.7, 0.4)

float

debug/shapes/paths/geometry_width

2.0

String

display/mouse_cursor/custom_image

""

Vector2

display/mouse_cursor/custom_image_hotspot

Vector2(0, 0)

Vector2

display/mouse_cursor/tooltip_position_offset

Vector2(10, 10)

bool

display/window/dpi/allow_hidpi

true

bool

display/window/energy_saving/keep_screen_on

true

bool

display/window/energy_saving/keep_screen_on.editor

false

int

display/window/handheld/orientation

0

bool

display/window/ios/allow_high_refresh_rate

true

bool

display/window/ios/hide_home_indicator

true

bool

display/window/ios/hide_status_bar

true

bool

display/window/ios/suppress_ui_gesture

true

bool

display/window/per_pixel_transparency/allowed

false

bool

display/window/size/always_on_top

false

bool

display/window/size/borderless

false

bool

display/window/size/extend_to_title

false

Vector2i

display/window/size/initial_position

Vector2i(0, 0)

int

display/window/size/initial_position_type

1

int

display/window/size/initial_screen

0

int

display/window/size/mode

0

bool

display/window/size/no_focus

false

bool

display/window/size/resizable

true

bool

display/window/size/transparent

false

int

display/window/size/viewport_height

648

int

display/window/size/viewport_width

1152

int

display/window/size/window_height_override

0

int

display/window/size/window_width_override

0

String

display/window/stretch/aspect

"keep"

String

display/window/stretch/mode

"disabled"

float

display/window/stretch/scale

1.0

String

display/window/stretch/scale_mode

"fractional"

bool

display/window/subwindows/embed_subwindows

true

int

display/window/vsync/vsync_mode

1

String

dotnet/project/assembly_name

""

int

dotnet/project/assembly_reload_attempts

3

String

dotnet/project/solution_directory

""

bool

editor/export/convert_text_resources_to_binary

true

bool

editor/import/reimport_missing_imported_files

true

bool

editor/import/use_multiple_threads

true

bool

editor/movie_writer/disable_vsync

false

int

editor/movie_writer/fps

60

int

editor/movie_writer/mix_rate

48000

float

editor/movie_writer/mjpeg_quality

0.75

String

editor/movie_writer/movie_file

""

int

editor/movie_writer/speaker_mode

0

String

editor/naming/default_signal_callback_name

"_on_{node_name}_{signal_name}"

String

editor/naming/default_signal_callback_to_self_name

"_on_{signal_name}"

int

editor/naming/node_name_casing

0

int

editor/naming/node_name_num_separator

0

int

editor/naming/scene_name_casing

2

String

editor/run/main_run_args

""

PackedStringArray

editor/script/search_in_file_extensions

PackedStringArray("gd", "gdshader")

String

editor/script/templates_search_path

"res://script_templates"

bool

editor/version_control/autoload_on_startup

false

String

editor/version_control/plugin_name

""

bool

filesystem/import/blender/enabled

true

bool

filesystem/import/blender/enabled.android

false

bool

filesystem/import/blender/enabled.web

false

bool

filesystem/import/fbx/enabled

true

bool

filesystem/import/fbx/enabled.android

false

bool

filesystem/import/fbx/enabled.web

false