尧图网站设计 尧图网站设计YAOTU DESIGN
ARTICLE DETAIL

资讯详情

深耕网站设计与一线实操的经验洞察。

Godot引擎自定义图标与命名全攻略

Godot引擎自定义图标与命名全攻略 环境准备安装Python 3.8及以上版本并通过以下命令安装SConspython-mpipinstallscons安装Visual Studio 2022确保勾选“使用C的桌面开发”工作负载。获取源代码从GitHub克隆Godot引擎源代码gitclone https://github.com/godotengine/godot生成编译环境进入源代码目录执行以下命令生成Visual Studio项目文件sconsplatformwindowsvsprojyesdev_buildyes生成的godot.sln文件需用Visual Studio打开。修改功能模块禁用资源库功能在project_manager.cpp中注释以下代码块if(AssetLibraryEditorPlugin::is_available()){asset_librarymemnew(EditorAssetLibrary(true));asset_library-set_name(AssetLibraryTab);_add_main_view(MAIN_VIEW_ASSETLIB,TTR(Asset Library),RefTexture2D(),asset_library);asset_library-connect(install_asset,callable_mp(this,ProjectManager::_install_project));}else{VBoxContainer*asset_library_fillermemnew(VBoxContainer);asset_library_filler-set_name(AssetLibraryTab);Button*asset_library_toggle_add_main_view(MAIN_VIEW_ASSETLIB,TTR(Asset Library),RefTexture2D(),asset_library_filler);asset_library_toggle-set_disabled(true);asset_library_toggle-set_tooltip_text(TTR(Asset Library not available (due to using Web editor, or because SSL support disabled).));}移除社区按钮搜索并注释title_bar_logo相关代码title_bar_logomemnew(Button);title_bar_logo-set_flat(true);left_hbox-add_child(title_bar_logo);title_bar_logo-connect(SceneStringName(pressed),callable_mp(this,ProjectManager::_show_about));title_bar_logo-set_icon(get_editor_theme_icon(SNAME(TitleBarLogo)));禁用设置按钮搜索并注释quick_settings_button相关代码quick_settings_buttonmemnew(Button);quick_settings_button-set_flat(true);quick_settings_button-set_text(TTR(Settings));right_hbox-add_child(quick_settings_button);quick_settings_button-connect(SceneStringName(pressed),callable_mp(this,ProjectManager::_show_quick_settings));quick_settings_button-set_icon(get_editor_theme_icon(SNAME(Tools)));帮助按钮关闭在editor_node.cpp中注释以下代码块搜索并注释help_menu相关代码help_menu-set_item_icon(help_menu-get_item_index(HELP_SEARCH),theme-get_icon(SNAME(HelpSearch),EditorStringName(EditorIcons)));help_menu-set_item_icon(help_menu-get_item_index(HELP_COPY_SYSTEM_INFO),theme-get_icon(SNAME(ActionCopy),EditorStringName(EditorIcons)));help_menu-set_item_icon(help_menu-get_item_index(HELP_ABOUT),theme-get_icon(SNAME(Godot),EditorStringName(EditorIcons)));help_menu-set_item_icon(help_menu-get_item_index(HELP_SUPPORT_GODOT_DEVELOPMENT),theme-get_icon(SNAME(Heart),EditorStringName(EditorIcons)));*/help_menumemnew(PopupMenu);help_menu-set_name(TTR(Help));if(global_menuNativeMenu::get_singleton()-has_system_menu(NativeMenu::HELP_MENU_ID)){help_menu-set_system_menu(NativeMenu::HELP_MENU_ID);}main_menu-add_child(help_menu)help_menu-add_icon_shortcut(theme-get_icon(SNAME(HelpSearch),EditorStringName(EditorIcons)),ED_GET_SHORTCUT(editor/editor_help),HELP_SEARCH);help_menu-add_separator();help_menu-add_shortcut(ED_SHORTCUT_AND_COMMAND(editor/online_docs,TTR(Online Documentation)),HELP_DOCS);help_menu-add_shortcut(ED_SHORTCUT_AND_COMMAND(editor/forum,TTR(Forum)),HELP_FORUM);help_menu-add_shortcut(ED_SHORTCUT_AND_COMMAND(editor/community,TTR(Community)),HELP_COMMUNITY);help_menu-add_separator();help_menu-add_icon_shortcut(theme-get_icon(SNAME(ActionCopy),EditorStringName(EditorIcons)),ED_SHORTCUT_AND_COMMAND(editor/copy_system_info,TTR(Copy System Info)),HELP_COPY_SYSTEM_INFO);help_menu-set_item_tooltip(-1,TTR(Copies the system info as a single-line text into the clipboard.));help_menu-add_shortcut(ED_SHORTCUT_AND_COMMAND(editor/report_a_bug,TTR(Report a Bug)),HELP_REPORT_A_BUG);help_menu-add_shortcut(ED_SHORTCUT_AND_COMMAND(editor/suggest_a_feature,TTR(Suggest a Feature)),HELP_SUGGEST_A_FEATURE);help_menu-add_shortcut(ED_SHORTCUT_AND_COMMAND(editor/send_docs_feedback,TTR(Send Docs Feedback)),HELP_SEND_DOCS_FEEDBACK);help_menu-add_separator();if(!global_menu||!OS::get_singleton()-has_feature(macos)){// On macOS Quit and About options are in the app menu.help_menu-add_icon_shortcut(theme-get_icon(SNAME(Godot),EditorStringName(EditorIcons)),ED_SHORTCUT_AND_COMMAND(editor/about,TTR(About Godot...)),HELP_ABOUT);}help_menu-add_icon_shortcut(theme-get_icon(SNAME(Heart),EditorStringName(EditorIcons)),ED_SHORTCUT_AND_COMMAND(editor/support_development,TTR(Support Godot Development)),HELP_SUPPORT_GODOT_DEVELOPMENT);禁用打开在线文档入口在script_editor_plugin.cpp中注释以下代码块搜索并注释site_search相关代码site_searchmemnew(Button);site_search-set_flat(true);site_search-connect(SceneStringName(pressed),callable_mp(this,ScriptEditor::_menu_option).bind(SEARCH_WEBSITE));menu_hb-add_child(site_search);site_search-set_icon(get_editor_theme_icon(SNAME(ExternalLink)))if(native_class_doc){String nameeh-get_class();String tooltipvformat(TTR(Open %s in Godot online documentation.),name);site_search-set_text(TTR(Open in Online Docs));site_search-set_tooltip_text(tooltip);}else{site_search-set_text(TTR(Online Docs));site_search-set_tooltip_text(TTR(Open Godot online documentation.));}修改引擎名称编辑根目录下的version.py文件修改name字段namemy Engine替换图标资源启动图替换main/splash.png文件。应用图标替换main/app_icon.png、icon.svg文件和editor\icons\DefaultProjectIcon.svg。Windows图标生成包含16×16至256×256尺寸的ICO文件替换platform/Windows/godot.ico和godot_console.ico。编辑器图标替换editor/icons/目录下的相关PNG或SVG文件例如icon_add.png、icon_remove.svg等以自定义编辑器界面图标。编译引擎在源代码根目录执行编译命令sconsplatformwindows-j4编译完成后生成的编辑器可执行文件位于bin/godot.windows.editor.x86_64.exe。参考文档详细编译指南可查阅Godot官方文档。后续计划连接第三方C动态库本系列教程将持续更新下一篇文章将逐步演示如何将一个实际的第三方C库例如一个简单的数学计算库集成到您自定义的Godot引擎中并提供完整的代码示例与构建配置。请持续关注获取最新内容
返回列表