# Godot Engine Documentation in Vietnamese # Copyright (C) 2014-2020, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0) # This file is distributed under the same license as the Godot Engine package. # # 01lifeleft <01lifeleft@gmail.com>, 2018. # 38569459 , 2018. # Dũng Đinh , 2019. # Hai Long Nguyen Vu , 2020. # Kê Luyện , 2019. # mth2610 , 2018. # Peter Anh , 2019. # Steve Dang , 2019-2020. # Ta Anh , 2020. # TyTYct Hihi , 2019. # msgid "" msgstr "" "Project-Id-Version: Godot Engine latest\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot-docs-l10n\n" "POT-Creation-Date: 2020-05-27 13:49+0200\n" "PO-Revision-Date: 2020-02-02 08:53+0000\n" "Last-Translator: Steve Dang \n" "Language-Team: Vietnamese \n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 3.11-dev\n" #: ../../docs/index.rst:2 #, fuzzy msgid "Godot Docs – *3.2* branch" msgstr "Tài liệu - nhánh *chính*" #: ../../docs/index.rst:6 msgid "" "Godot's documentation is available in various languages and versions. Expand " "the \"Read the Docs\" panel at the bottom of the sidebar to see the list." msgstr "" "Tài liệu của Godot có các ngôn ngữ và phiên bản khác nhau. Mở rộng bảng " "\"Đọc tài liệu\" ở dưới cùng của thanh bên để xem danh sách." #: ../../docs/index.rst:10 #, fuzzy msgid "" "This is the documentation for the stable 3.2 branch. Looking for the " "documentation of the current **development** branch? `Have a look here " "`_. You can also browse the " "documentation for the previous stable `3.1 `_ branch." msgstr "" "Tài liệu này dành cho bản đang phát triển (master). Nếu bạn muốn tìm tài " "liệu cho nhánh ổn định **stable** ? `Nhấn vào đường dẫn sau `_." #: ../../docs/index.rst:18 msgid "" "This documentation is translated from the `original English one `_ by community members on `Weblate `_." msgstr "" "Tài liệu này được dịch từ `bản gốc tiếng Anh ` _ bởi các thành viên cộng đồng trên` WebTable `_." #: ../../docs/index.rst:22 msgid "" "Depending on the translation effort's completion level, you may find " "paragraphs or whole pages which are still in English. You can help the " "community by providing new translations or reviewing existing ones on " "Weblate." msgstr "" "Tùy thuộc vào mức độ hoàn thành của nỗ lực dịch thuật, bạn có thể tìm thấy " "các đoạn hoặc toàn bộ trang vẫn bằng tiếng Anh. Bạn có thể giúp cộng đồng " "bằng cách cung cấp các bản dịch mới hoặc xem xét các bản dịch hiện có trên " "WebTable." #: ../../docs/index.rst:27 msgid "" "For the time being, localized translations are only available for the " "\"latest\" (development) branch, but should be suitable to learn how to use " "stable Godot releases nevertheless." msgstr "" "Hiện tại, các bản dịch được bản địa hóa chỉ có sẵn cho nhánh \"mới nhất" "\" (phát triển), nhưng vẫn phù hợp để tìm hiểu cách sử dụng các bản phát " "hành Godot ổn định." #: ../../docs/index.rst:31 #, fuzzy msgid "" "Welcome to the official documentation of `Godot Engine `__, the free and open source community-driven 2D and 3D game engine! If " "you are new to this documentation, we recommend that you read the :ref:" "`introduction page ` to get an overview of what this " "documentation has to offer." msgstr "" "Chào mừng đến với tài liệu của Godot Engine, một công cụ phát triển game 2D " "và 3D mã nguồn mở, hoàn toàn miễn phí, được tạo ra vì cộng đồng! Nếu đây là " "lần đầu tiên bạn đến với tài liệu này, chúng tôi đề nghị bạn đọc trang giới " "thiệu để có cái nhìn tổng quan về tài liệu này." #: ../../docs/index.rst:37 msgid "" "The table of contents below and in the sidebar should let you easily access " "the documentation for your topic of interest. You can also use the search " "function in the top left corner." msgstr "" "Phần mục lục ở dưới đây và thanh bên cạnh sẽ giúp bạn dễ dàng truy cập đến " "những chủ đề bạn thích. Bạn cũng có thể dùng chức năng tìm kiếm ở góc trên " "bên trái." #: ../../docs/index.rst:41 msgid "" "Godot Engine is an open source project developed by a community of " "volunteers. The documentation team can always use your feedback and help to " "improve the tutorials and class reference. If you don't understand " "something, or cannot find what you are looking for in the docs, help us make " "the documentation better by letting us know!" msgstr "" "Godot Engine là 1 dự án mã nguồn mở được phát triển bởi các tình nguyện " "viên. Những phản hồi của bạn được dùng để giúp cải thiện các bài hướng dẫn " "và các tính năng liên quan. Nếu bạn không hiểu điều gì đó hoặc không tìm " "được thứ bạn muốn, xin hãy cho chúng tôi biết." #: ../../docs/index.rst:48 msgid "" "Submit an issue or pull request on the `GitHub repository `_, help us `translate the documentation " "`_ into your language, or " "talk to us on either the ``#documentation`` channel on `Discord `_, or the ``#godotengine-doc`` channel on `irc.freenode." "net `_!" msgstr "" "Gửi một vấn đề (issue) hoặc kéo yêu cầu (pull request) trên `GitHub " "repository `_, cùng giúp " "`dịch bộ tài liệu `_ thành " "ngôn ngữ của bạn, hoặc thảo luận cùng nhau trên cả kênh ``#documentation`` " "trong `Discord `_, hoặc trên kênh ``#godotengine-" "doc`` ở `irc.freenode.net `_!" #: ../../docs/index.rst:58 #, fuzzy msgid "weblate_widget" msgstr "weblate_widget" #: ../../docs/index.rst:59 msgid "" "The main documentation for the site is organized into the following sections:" msgstr "Phần tài liệu chính của trang được tổ chức như sau:" #: ../../docs/index.rst:61 msgid "General" msgstr "Tổng quan" #: ../../docs/index.rst:69 msgid "Getting started" msgstr "Bắt đầu" #: ../../docs/index.rst:80 msgid "Tutorials" msgstr "Hướng dẫn" #: ../../docs/index.rst:110 msgid "Development" msgstr "Phát triển" #: ../../docs/index.rst:121 msgid "Community" msgstr "Cộng đồng" #: ../../docs/index.rst:131 msgid "Class reference" msgstr "" #: ../../docs/about/index.rst:2 #: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:7 #: ../../docs/tutorials/inputs/mouse_and_input_coordinates.rst:7 #: ../../docs/development/cpp/variant_class.rst:7 msgid "About" msgstr "Thông tin chúng tôi" #: ../../docs/about/introduction.rst:4 #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:7 #: ../../docs/getting_started/step_by_step/instancing.rst:7 #: ../../docs/getting_started/step_by_step/scripting.rst:7 #: ../../docs/getting_started/step_by_step/signals.rst:10 #: ../../docs/getting_started/step_by_step/animations.rst:7 #: ../../docs/getting_started/step_by_step/filesystem.rst:7 #: ../../docs/getting_started/step_by_step/scene_tree.rst:7 #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:7 #: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:7 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_basics.rst:4 #: ../../docs/getting_started/workflow/project_setup/project_organization.rst:7 #: ../../docs/getting_started/workflow/export/feature_tags.rst:7 #: ../../docs/getting_started/workflow/best_practices/introduction_best_practices.rst:4 #: ../../docs/tutorials/2d/2d_transforms.rst:7 #: ../../docs/tutorials/2d/using_tilemaps.rst:7 #: ../../docs/tutorials/2d/2d_movement.rst:7 #: ../../docs/tutorials/2d/2d_lights_and_shadows.rst:7 #: ../../docs/tutorials/2d/2d_meshes.rst:7 #: ../../docs/tutorials/2d/2d_sprite_animation.rst:7 #: ../../docs/tutorials/3d/using_transforms.rst:7 #: ../../docs/tutorials/3d/optimizing_3d_performance.rst:10 #: ../../docs/tutorials/3d/3d_rendering_limitations.rst:7 #: ../../docs/tutorials/3d/spatial_material.rst:7 #: ../../docs/tutorials/3d/lights_and_shadows.rst:7 #: ../../docs/tutorials/3d/reflection_probes.rst:7 #: ../../docs/tutorials/3d/gi_probes.rst:7 #: ../../docs/tutorials/3d/baked_lightmaps.rst:7 #: ../../docs/tutorials/3d/high_dynamic_range.rst:7 #: ../../docs/tutorials/3d/using_gridmaps.rst:7 #: ../../docs/tutorials/3d/using_multi_mesh_instance.rst:7 #: ../../docs/tutorials/audio/audio_buses.rst:7 #: ../../docs/tutorials/audio/audio_streams.rst:7 #: ../../docs/tutorials/audio/sync_with_audio.rst:7 #: ../../docs/tutorials/physics/using_area_2d.rst:7 #: ../../docs/tutorials/physics/using_kinematic_body_2d.rst:7 #: ../../docs/tutorials/physics/ray-casting.rst:7 #: ../../docs/tutorials/physics/ragdoll_system.rst:7 #: ../../docs/tutorials/physics/kinematic_character_2d.rst:7 #: ../../docs/tutorials/math/vector_math.rst:7 #: ../../docs/tutorials/math/matrices_and_transforms.rst:7 #: ../../docs/tutorials/animation/2d_skeletons.rst:7 #: ../../docs/tutorials/animation/animation_tree.rst:7 #: ../../docs/tutorials/inputs/input_examples.rst:7 #: ../../docs/tutorials/io/saving_games.rst:7 #: ../../docs/tutorials/i18n/internationalizing_games.rst:7 #: ../../docs/tutorials/gui/bbcode_in_richtextlabel.rst:7 #: ../../docs/tutorials/viewports/viewports.rst:7 #: ../../docs/tutorials/viewports/using_viewport_as_texture.rst:7 #: ../../docs/tutorials/viewports/custom_postprocessing.rst:7 #: ../../docs/tutorials/shading/shading_reference/shaders.rst:7 #: ../../docs/tutorials/shading/shading_reference/shading_language.rst:7 #: ../../docs/tutorials/shading/your_first_shader/what_are_shaders.rst:7 #: ../../docs/tutorials/shading/your_first_shader/your_first_canvasitem_shader.rst:7 #: ../../docs/tutorials/shading/shader_materials.rst:7 #: ../../docs/tutorials/shading/screen-reading_shaders.rst:7 #: ../../docs/tutorials/shading/migrating_to_godot_shader_language.rst:7 #: ../../docs/tutorials/shading/advanced_postprocessing.rst:7 #: ../../docs/tutorials/networking/ssl_certificates.rst:7 #: ../../docs/tutorials/assetlib/uploading_to_assetlib.rst:7 #: ../../docs/tutorials/vr/vr_starter_tutorial/vr_starter_tutorial_part_one.rst:7 #: ../../docs/tutorials/vr/vr_starter_tutorial/vr_starter_tutorial_part_two.rst:7 #: ../../docs/tutorials/vr/developing_for_oculus_quest.rst:7 #: ../../docs/tutorials/plugins/editor/import_plugins.rst:11 #: ../../docs/tutorials/plugins/editor/spatial_gizmos.rst:7 #: ../../docs/tutorials/plugins/gdnative/gdnative-c-example.rst:7 #: ../../docs/tutorials/plugins/gdnative/gdnative-cpp-example.rst:7 #: ../../docs/tutorials/plugins/android/android_plugin.rst:7 #: ../../docs/tutorials/misc/binary_serialization_api.rst:7 #: ../../docs/tutorials/misc/state_design_pattern.rst:7 #: ../../docs/development/cpp/custom_resource_format_loaders.rst:7 #: ../../docs/development/cpp/custom_audiostreams.rst:7 #: ../../docs/development/cpp/custom_godot_servers.rst:7 #: ../../docs/community/contributing/best_practices_for_engine_contributors.rst:7 msgid "Introduction" msgstr "Giới Thiệu" #: ../../docs/about/introduction.rst:11 msgid "" "Welcome to the official documentation of Godot Engine, the free and open " "source community-driven 2D and 3D game engine! Behind this mouthful, you " "will find a powerful yet user-friendly tool that you can use to develop any " "kind of game, for any platform and with no usage restriction whatsoever." msgstr "" "Chào mừng bạn đến với bộ tài liệu chính thức của Godot Engine, phần mềm phát " "triển game 2D và 3D miễn phí của cộng đồng mã nguồn mở! Đằng sau lời ngọt " "ngào này, bạn sẽ thấy một bộ công cụ mạnh mẽ nhưng thân thiện với người sử " "dụng mà bạn có thể sử dụng để phát triển bất kỳ loại trò chơi nào, cho bất " "kỳ nền tảng nào mà không hề bị hạn chế khi sử dụng." #: ../../docs/about/introduction.rst:16 msgid "" "This page gives a broad presentation of the engine and of the contents of " "this documentation, so that you know where to start if you are a beginner or " "where to look if you need info on a specific feature." msgstr "" "Trang này hướng tới mục đích đưa ra một bài thuyết trình rõ ràng về phần mềm " "và nội dung của bộ tài liệu này, để người mới sử dụng biết nên bắt đầu từ " "đâu, hoặc là nơi để tham khảo nếu đang cần tìm kiếm về một tính năng cụ thể " "nào đó." #: ../../docs/about/introduction.rst:21 msgid "Before you start" msgstr "Trước khi bạn bắt đầu" #: ../../docs/about/introduction.rst:23 msgid "" "The :ref:`Tutorials and resources ` page lists " "video tutorials contributed by the community. If you prefer video to text, " "those may be worth a look." msgstr "" "Trang \"Các hướng dẫn và tài liệu\" có liệt kê các video hướng dẫn được cộng " "đồng thực hiện. Hãy xem thử qua nếu bạn thích xem video hơn là đọc văn bản." #: ../../docs/about/introduction.rst:27 msgid "" "In case you have trouble with one of the tutorials or your project, you can " "find help on the various :ref:`Community channels `, " "especially the Godot Discord community, Q&A, and IRC." msgstr "" "Nếu bạn gặp khó khắn với một trong số các bài hướng dẫn hoặc dự án của bạn, " "bạn có thể tìm kiếm giúp đỡ trên các :ref:`Kênh cộng " "đồng`, đặc biệt là Discord cộng đồng của Godot, Q&A " "và IRC." #: ../../docs/about/introduction.rst:32 msgid "About Godot Engine" msgstr "Về Godot Engine" #: ../../docs/about/introduction.rst:34 msgid "" "A game engine is a complex tool, and it is therefore difficult to present " "Godot in a few words. Here's a quick synopsis, which you are free to reuse " "if you need a quick writeup about Godot Engine." msgstr "" "Phần mềm phát triển game là một công cụ phức tạp, do đó rất khó để miêu tả " "về Godot trong một vài từ. Tuy vậy, đây là bản trình bày trước công chúng " "của chúng tôi, bạn có thể sử dụng lại nó nếu cần viết nhanh về Godot Engine." #: ../../docs/about/introduction.rst:38 msgid "" "Godot Engine is a feature-packed, cross-platform game engine to create 2D " "and 3D games from a unified interface. It provides a comprehensive set of " "common tools, so users can focus on making games without having to reinvent " "the wheel. Games can be exported in one click to a number of platforms, " "including the major desktop platforms (Linux, macOS, Windows) as well as " "mobile (Android, iOS) and web-based (HTML5) platforms." msgstr "" "Godot Engine là một công cụ phát triển game đa nền tảng với đầy đủ tính " "năng, nhằm tạo ra các trò chơi 2D và 3D từ một giao diện thống nhất. Nó cung " "cấp một bộ công cụ chung để người dùng có thể tập trung làm game mà không " "cần phải viết lại những thứ có sẵn. Trò chơi có thể được xuất bản bằng một " "cú nhấn chuột cho một số nền tảng, bao gồm các nền tảng máy tính để bàn " "(Linux, macOS, Windows) cũng như cho điện thoại di động (Android, iOS) và " "nền tảng web (HTML5)." #: ../../docs/about/introduction.rst:45 msgid "" "Godot is completely free and open source under the permissive MIT license. " "No strings attached, no royalties, nothing. Users' games are theirs, down to " "the last line of engine code. Godot's development is fully independent and " "community-driven, empowering users to help shape their engine to match their " "expectations. It is supported by the `Software Freedom Conservancy `_ not-for-profit." msgstr "" "Godot hoàn toàn miễn phí và mã nguồn mở theo giấy phép sử dụng MIT, không có " "bất kỳ ràng buộc hoặc chi phí nào cả. Trò chơi được tạo ra bởi người dùng " "hoàn toàn là của họ, đến tận dòng code cuối cùng. Sự phát triển của Godot là " "hoàn toàn độc lập và được thúc đẩy bởi cộng đồng, giúp người dùng có thể tuỳ " "biến phần mềm cho phù hợp với nhu cầu của họ. Godot được hỗ trợ bởi " "`Software Freedom Conservancy ` tutorial." msgstr "" "Để có cái nhìn chi tiết hơn về Godot Engine, chúng tôi khuyến khích bạn đọc " "thêm bộ tài liệu này, đặc biệt là bài hướng dẫn từng bước một: `Step by step " "` ." #: ../../docs/about/introduction.rst:57 msgid "About the documentation" msgstr "Về bộ tài liệu" #: ../../docs/about/introduction.rst:59 msgid "" "This documentation is continuously written, corrected, edited, and revamped " "by members of the Godot Engine community. It is edited via text files in the " "`reStructuredText `_ markup " "language and then compiled into a static website/offline document using the " "open source `Sphinx `_ and `ReadTheDocs `_ tools." msgstr "" "Bộ tài liệu này được liên tục viết, sửa lỗi, chỉnh sửa và viết lại bởi các " "thành viên của cộng đồng Godot Engine. Nó được biên tập qua các tập tin văn " "bản trong ngôn ngữ đánh dấu `reStructuredText `_ và sau đó được biên soạn lại thành một trang web tĩnh/" "tài liệu ngoại tuyến sử dụng công cụ mã nguồn mở `Sphinx `_ và `ReadTheDocs `_ ." #: ../../docs/about/introduction.rst:66 msgid "" "You can contribute to Godot's documentation by opening issue tickets or " "sending patches via pull requests on its GitHub `source repository `_, or translating it into your language " "on `Hosted Weblate `_." msgstr "" "Bạn có thể đóng góp cho bộ tài liệu của Godot bằng cách gửi các yêu cầu " "(issue tickets) hoặc các bản vá thông qua GitHub của nó `_." #: ../../docs/about/introduction.rst:72 msgid "" "All the contents are under the permissive Creative Commons Attribution 3.0 " "(`CC-BY 3.0 `_) license, with " "attribution to \"Juan Linietsky, Ariel Manzur and the Godot Engine community" "\"." msgstr "" "Tất cả các nội dung đều thuộc giấy phép Creative Commons Attribution 3.0 (CC-" "BY 3.0 _ _), với sự cho phép " "của \"Juan Linietsky, Ariel Manzur và cộng đồng Godot Engine \"." #: ../../docs/about/introduction.rst:77 msgid "Organization of the documentation" msgstr "Cách tổ chức của bộ tài liệu" #: ../../docs/about/introduction.rst:79 #, fuzzy msgid "" "This documentation is organized in five sections with an impressively " "unbalanced distribution of contents – but the way it is split up should be " "relatively intuitive:" msgstr "" "Bộ tài liệu này được tổ chức thành năm phần với sự phân bố không đồng đều " "các nội dung - tuy nhiên cách phân chia này lại tương đối trực quan:" #: ../../docs/about/introduction.rst:83 msgid "" "The :ref:`sec-general` section contains this introduction as well as " "information about the engine, its history, its licensing, authors, etc. It " "also contains the :ref:`doc_faq`." msgstr "" "Phần :ref:`sec-general` chứa thông tin giới thiệu này cũng như thông tin về " "phần mềm, lịch sử, giấy phép, tác giả, vv. Nó cũng chứa :ref:`doc_faq`." #: ../../docs/about/introduction.rst:86 #, fuzzy msgid "" "The :ref:`sec-learn` section is the *raison d'être* of this documentation, " "as it contains all the necessary information on using the engine to make " "games. It starts with the :ref:`Step by step ` " "tutorial which should be the entry point for all new users." msgstr "" "Phần :ref:`sec-learn` là phần chính *raison d'être* của tài liệu này vì nó " "chứa tất cả các thông tin cần thiết về việc sử dụng phần mềm để tạo ra các " "trò chơi. Nó bắt đầu bằng bài :ref:`Step by step ` " "hướng dẫn mà nên là điểm xuất phát cho tất cả người dùng mới." #: ../../docs/about/introduction.rst:91 msgid "" "The :ref:`sec-tutorials` section can be read as needed, in any order. It " "contains feature-specific tutorials and documentation." msgstr "" "Phần :ref:`sec-tutorials` có thể được đọc khi nào cần, theo bất kỳ thứ tự " "nào. Nó chứa nhiều bài hướng dẫn và tài liệu liên quan đến các tính năng cụ " "thể." #: ../../docs/about/introduction.rst:93 #, fuzzy msgid "" "The :ref:`sec-devel` section is intended for advanced users and contributors " "to the engine development, with information on compiling the engine, " "developing C++ modules or editor plugins." msgstr "" "Phần :ref:`sec-devel` chỉ dành cho người dùng nâng cao và người dùng đóng " "góp vào sự phát triển của phần mềm, với thông tin về việc biên dịch phần " "mềm, phát triển các mô đun C ++ hoặc các phần mở rộng." #: ../../docs/about/introduction.rst:96 #, fuzzy msgid "" "The :ref:`sec-community` section gives information related to contributing " "to engine development and the life of its community, e.g. how to report " "bugs, help with the documentation, etc. It also points to various community " "channels like IRC and Discord and contains a list of recommended third-party " "tutorials outside of this documentation." msgstr "" "Phần :ref:`sec-community` cung cấp thông tin liên quan đến đóng góp vào sự " "phát triển của phần mềm và hệ thống cộng đồng của nó, ví dụ: làm thế nào để " "báo lỗi, giúp viết các tài liệu, vv. Nó cũng chỉ đến các kênh cộng đồng khác " "nhau như IRC và Discord và chứa một danh sách các bài hướng dẫn được khuyến " "khích của bên thứ ba ngoài bộ tài liệu này." #: ../../docs/about/introduction.rst:101 #, fuzzy msgid "" "Finally, the :ref:`sec-class-ref` is the documentation of the Godot API, " "which is also available directly within the engine's script editor. It is " "generated automatically from a file in the main source repository, therefore " "the generated files of the documentation are not meant to be modified. See :" "ref:`doc_updating_the_class_reference` for details." msgstr "" "Cuối cùng, phần :ref:`sec-class-ref` là tài liệu về Godot API, nó cũng có " "sẵn bên trong trình soạn thảo (script editor) của engine. Nó được tạo tự " "động từ một tệp trong kho lưu trữ chính, do đó các tệp được tạo ra của tài " "liệu không nên bị thay đổi. Xem :ref:`doc_updating_the_class_reference` để " "biết thêm chi tiết." #: ../../docs/about/introduction.rst:107 msgid "" "In addition to this documentation you may also want to take a look at the " "various `Godot demo projects `_." msgstr "" "Ngoài bộ tài liệu này, bạn cũng có thể xem thử các dự án demo có sẵn của " "Godot `Godot demo projects `_." #: ../../docs/about/introduction.rst:110 msgid "Have fun reading and making games with Godot Engine!" msgstr "Đọc và làm game với Godot Engine vui nhé!" #: ../../docs/about/faq.rst:1 msgid "FAQ" msgstr "FAQ" #: ../../docs/about/faq.rst:7 #: ../../docs/tutorials/assetlib/what_is_assetlib.rst:42 msgid "Frequently asked questions" msgstr "Những câu hỏi thường gặp" #: ../../docs/about/faq.rst:10 msgid "" "What can I do with Godot? How much does it cost? What are the license terms?" msgstr "" "Tôi có thể làm gì với Godot? Nó mất bao nhiêu tiền? Điều kiện ràng buộc là " "gì?" #: ../../docs/about/faq.rst:12 #, fuzzy msgid "" "Godot is `Free and Open-Source Software `_ available under the `OSI-approved `_ MIT license. This means it is free as in " "\"free speech\" as well as in \"free beer.\"" msgstr "" "Godot là 1 phần mềm miễn phí mã nguồn mở có sẵn dưới giấy phép MIT `OSI-" "approved `_" #: ../../docs/about/faq.rst:14 #, fuzzy msgid "In short:" msgstr "Ngắn gọn:" #: ../../docs/about/faq.rst:16 #, fuzzy msgid "" "You are free to download and use Godot for any purpose, personal, non-" "profit, commercial, or otherwise." msgstr "" "Bạn có thể tải và dùng Godot miễn phí cho bất cứ mục đích nào, cá nhân, phi " "lợi nhuận, thương mại, hoặc khác;" #: ../../docs/about/faq.rst:17 #, fuzzy msgid "" "You are free to modify, distribute, redistribute, and remix Godot to your " "heart's content, for any reason, both non-commercially and commercially." msgstr "Bạn có thể sửa đổi, tái phân phối Godot theo ý thích" #: ../../docs/about/faq.rst:19 #, fuzzy msgid "" "All the contents of this accompanying documentation are published under the " "permissive Creative Commons Attribution 3.0 (`CC-BY 3.0 `_) license, with attribution to \"Juan " "Linietsky, Ariel Manzur and the Godot Engine community.\"" msgstr "" "Tất cả nội dung của tài liệu này được cấp phép bởi giấy phép Creative " "Commons Attribution 3.0 (`CC-BY 3.0 `_), với thẩm quyền của \"Juan Linietsky, Ariel Manzur và cộng đồng " "Godot Engine\"." #: ../../docs/about/faq.rst:23 #, fuzzy msgid "" "Logos and icons are generally under the same Creative Commons license. Note " "that some third-party libraries included with Godot's source code may have " "different licenses." msgstr "" "Logos và icons thông thường có chung giấy phép Creative Commons. Lưu ý rằng " "một số thư viện của bên thứ ba được bao gồm trong mã nguồn của Godot có thể " "có giấy phép khác." #: ../../docs/about/faq.rst:27 #, fuzzy msgid "" "For full details, look at the `COPYRIGHT.txt `_ as well as the `LICENSE.txt `_ and `LOGO_LICENSE." "txt `_ " "files in the Godot repository." msgstr "" "Nếu muốn biết chi tiết, đọc tệp `COPYRIGHT.txt `_ và `LICENSE.txt `_và `LOGO_LICENSE.txt " "`_ trong " "thư viện lưu trữ của Godot." #: ../../docs/about/faq.rst:31 #, fuzzy msgid "" "Also, see `the license page on the Godot website `_." msgstr "" "Đồng thời `xem trang giấy phép trên trang web của Godot tại `_." #: ../../docs/about/faq.rst:34 msgid "Which platforms are supported by Godot?" msgstr "Nền tảng nào được hỗ trợ bởi Godot?" #: ../../docs/about/faq.rst:36 msgid "**For the editor:**" msgstr "**Dành cho biên tập viên:**" #: ../../docs/about/faq.rst:38 ../../docs/tutorials/misc/jitter_stutter.rst:59 #: ../../docs/development/compiling/compiling_with_mono.rst:329 msgid "Windows" msgstr "Windows" #: ../../docs/about/faq.rst:39 ../../docs/about/faq.rst:45 #: ../../docs/getting_started/editor/default_key_mapping.rst:24 #: ../../docs/getting_started/editor/default_key_mapping.rst:89 #: ../../docs/getting_started/editor/default_key_mapping.rst:142 #: ../../docs/getting_started/editor/default_key_mapping.rst:217 #: ../../docs/getting_started/editor/default_key_mapping.rst:298 #: ../../docs/getting_started/editor/default_key_mapping.rst:345 #: ../../docs/getting_started/editor/default_key_mapping.rst:370 #: ../../docs/getting_started/editor/default_key_mapping.rst:381 #: ../../docs/getting_started/editor/default_key_mapping.rst:394 #: ../../docs/getting_started/editor/default_key_mapping.rst:425 #: ../../docs/getting_started/editor/default_key_mapping.rst:438 #: ../../docs/getting_started/editor/default_key_mapping.rst:461 #: ../../docs/getting_started/editor/default_key_mapping.rst:478 #: ../../docs/getting_started/editor/default_key_mapping.rst:513 #: ../../docs/tutorials/misc/jitter_stutter.rst:84 #, fuzzy msgid "macOS" msgstr "macOS" #: ../../docs/about/faq.rst:40 ../../docs/about/faq.rst:46 #, fuzzy msgid "X11 (Linux, \\*BSD)" msgstr "X11 (Linux, \\*BSD)" #: ../../docs/about/faq.rst:42 msgid "**For exporting your games:**" msgstr "**Để xuất bản trò chơi của bạn:**" #: ../../docs/about/faq.rst:44 msgid "Windows (and UWP)" msgstr "Windows (và UWP)" #: ../../docs/about/faq.rst:47 #: ../../docs/getting_started/step_by_step/exporting.rst:310 #: ../../docs/tutorials/misc/jitter_stutter.rst:90 #: ../../docs/development/compiling/compiling_with_mono.rst:321 #, fuzzy msgid "Android" msgstr "Android" #: ../../docs/about/faq.rst:48 #: ../../docs/getting_started/step_by_step/exporting.rst:363 #: ../../docs/tutorials/misc/jitter_stutter.rst:96 #: ../../docs/development/compiling/compiling_with_mono.rst:323 #, fuzzy msgid "iOS" msgstr "iOS" #: ../../docs/about/faq.rst:49 #, fuzzy msgid "Web" msgstr "Web" #: ../../docs/about/faq.rst:51 #, fuzzy msgid "" "Both 32- and 64-bit binaries are supported where it makes sense, with 64 " "being the default." msgstr "Cả 2 phiên bản 32 và 64 bit đều được hỗ trợ, với 64 bit là mặc định." #: ../../docs/about/faq.rst:54 msgid "" "Some users also report building and using Godot successfully on ARM-based " "systems with Linux, like the Raspberry Pi." msgstr "" "Vài người dùng được biết đang dựng và sử dụng thành công Godot trên hệ thống " "dựa trên ARM với Linux, như Raspberry Pi." #: ../../docs/about/faq.rst:57 #, fuzzy msgid "" "Additionally, there is some unofficial third-party work being done on " "building for some consoles. However, none of this is included in the default " "build scripts or export templates at this time." msgstr "" "Một vài người dùng cũng báo cáo về việc xây dựng và sử dụng Godot thành công " "trên các hệ thống dựa trên ARM với linux, như Raspberry Pi. Đồng thời cũng " "có 1 số nhóm không chính thức xây dựng cho 1 số consoles. Tuy nhiên, không " "có gì được bao gồm trong build scripts hoặc mô hình xuất bản." #: ../../docs/about/faq.rst:61 #, fuzzy msgid "" "For more on this, see the sections on :ref:`exporting ` and :ref:`compiling Godot yourself `." msgstr "" "Xem mục :ref:`exporting ` và :ref:`compiling " "Godot yourself ` để biết thêm chi tiết." #: ../../docs/about/faq.rst:65 #, fuzzy msgid "Which programming languages are supported in Godot?" msgstr "Ngôn ngữ nào được hỗ trợ bởi Godot?" #: ../../docs/about/faq.rst:67 #, fuzzy msgid "" "The officially supported languages for Godot are GDScript, Visual Scripting, " "C#, and C++. See the subcategories for each language in the :ref:`scripting " "` section." msgstr "" "Ngôn ngữ chính thức được hỗ trợ trong Godot là GDScript, Visual Scripting, " "C# và C++. Xem thêm thể loại con(subcategories) cho mỗi ngôn ngữ tại phần :" "ref:`scripting `." #: ../../docs/about/faq.rst:71 msgid "" "If you are just starting out with either Godot or game development in " "general, GDScript is the recommended language to learn and use since it is " "native to Godot. While scripting languages tend to be less performant than " "lower-level languages in the long run, for prototyping, developing Minimum " "Viable Products (MVPs), and focusing on Time-To-Market (TTM), GDScript will " "provide a fast, friendly, and capable way of developing your games." msgstr "" "Nếu bạn chỉ mới bắt đầu với Godot hoặc phát triển game nói chung, GDScript " "là ngôn ngữ được khuyến khích để học và sử dụng vì nó là đồ cây nhà lá vườn " "của Godot. Dù những ngôn ngữ soạn thảo thường chạy yếu hơn những ngôn ngữ " "bậc thấp về lâu dài, với prototyping, phát triển sản phẩm khả thi tối thiểu " "(MVPs), và tập trung vào Time-To-Market (TTM), GDScript sẽ cung cấp một giải " "pháp thiết kế game nhanh, thân thiện và hiệu quả." #: ../../docs/about/faq.rst:78 msgid "" "Note that C# support is still relatively new, and as such, you may encounter " "some issues along the way. Our friendly and hard-working development " "community is always ready to tackle new problems as they arise, but since " "this is an open-source project, we recommend that you first do some due " "diligence yourself. Searching through discussions on `open issues `_ is a great way to start your " "troubleshooting." msgstr "" "Cần chú ý rằng việc hỗ trợ C# vẫn còn mới, vì vậy bạn có thể sẽ gặp vài vấn " "đề về lâu dài. Cộng đồng phát triển thân thiện và cần cù luôn sẵn sàng để xử " "lí khi phát hiện những vấn đề mới, nhưng vì đây là dự án mã nguồn mở, chúng " "tôi khuyến khích bạn nên tự tìm hiểu về nó trước. Tìm kiếm trong những thảo " "luận trên `những vấn đề mở `_ " "là cách tuyệt vời để bắt đầu tìm hướng giải quyết." #: ../../docs/about/faq.rst:85 #, fuzzy msgid "" "As for new languages, support is possible via third parties using the " "GDNative / NativeScript / PluginScript facilities. (See the question about " "plugins below.) Work is currently underway, for example, on unofficial " "bindings for Godot to `Python `_ " "and `Nim `_." msgstr "" "Với những ngôn ngữ mới, hỗ trợ là khả thi bằng nhóm thứ ba bằng cơ sở " "GDNative / NativeScript / PluginScript. (Xem câu hỏi về plugins bên dưới.) " "Những việc đang được thực hiện, ví dụ, trên phần không chính thức cho Godot " "cho `Python `_ và `Nim `_." #: ../../docs/about/faq.rst:93 msgid "What is GDScript and why should I use it?" msgstr "GDScript là gì và tại sao tôi nên sử dụng nó?" #: ../../docs/about/faq.rst:95 #, fuzzy msgid "" "GDScript is Godot's integrated scripting language. It was built from the " "ground up to maximize Godot's potential in the least amount of code, " "affording both novice and expert developers alike to capitalize on Godot's " "strengths as fast as possible. If you've ever written anything in a language " "like Python before then you'll feel right at home. For examples, history, " "and a complete overview of the power GDScript offers you, check out the :ref:" "`GDScript scripting guide `." msgstr "" "GDScript là một ngôn ngữ kịch bản được tích hợp vào Godot. Nó được dựng từ " "đầu để phát huy tối đa tiềm năng của Godot trong việc sử dụng ít dòng code " "nhất, giúp cả lập trình viên nghiệp dư và thành thạo tận dụng tối đa sức " "mạnh của Godot nhanh nhất có thể. Nếu đã từng viết những ngôn ngữ như Python " "trước đây thì bạn sẽ cảm thấy rất quen thuộc. Nếu muốn có bài ví dụ, lịch " "sử, và một góc nhìn tổng quát về sức mạnh của GDScript, hãy xem thử `hướng " "dẫn sử dụng GDScript `_." #: ../../docs/about/faq.rst:102 msgid "" "There are several reasons to use GDScript--especially when you are " "prototyping, in alpha/beta stages of your project, or are not creating the " "next AAA title--but the most salient reason is the overall **reduction of " "complexity.**" msgstr "" "Có vài lí do để sử dụng GDScript-- đặc biệt khi bạn đang viết bản chạy thử, " "trong quá trình alpha/beta của dự án, hoặc không có ý định tạo ra tựa game " "AAA tiếp theo--nhưng lí do nổi bật nhất đó là **giảm độ phức tạp.**" #: ../../docs/about/faq.rst:106 msgid "" "The original intent of creating a tightly integrated, custom scripting " "language for Godot was two-fold: first, it reduces the amount of time " "necessary to get up and running with Godot, giving developers a rapid way of " "exposing themselves to the engine with a focus on productivity; second, it " "reduces the overall burden of maintenance, attenuates the dimensionality of " "issues, and allows the developers of the engine to focus on squashing bugs " "and improving features related to the engine core--rather than spending a " "lot of time trying to get a small set of incremental features working across " "a large set of languages." msgstr "" #: ../../docs/about/faq.rst:114 #, fuzzy msgid "" "Since Godot is an open-source project, it was imperative from the start to " "prioritize a more integrated and seamless experience over attracting " "additional users by supporting more familiar programming languages--" "especially when supporting those more familiar languages would result in a " "worse experience. We understand if you would rather use another language in " "Godot (see the list of supported options above). That being said, if you " "haven't given GDScript a try, try it for **three days**. Just like Godot, " "once you see how powerful it is and rapid your development becomes, we think " "GDScript will grow on you." msgstr "" "Câu trả lời ngắn là chúng tôi nghĩ những khó khăn cả về phía bạn (khi tìm " "hiểu về Godot và GDScript) và phía chúng tôi (bảo trì) đáng giá hơn việc thu " "hút thêm người dùng mới với ngôn ngữ mà họ quen thuộc và kết quả là một trải " "nghiệm tồi tệ. Chúng tôi thông cảm nếu bạn thích sử dụng ngôn ngữ khác trong " "Godot (xem danh sách các lựa chọn phía trên), nhưng chúng tôi khuyến khích " "bạn thử và trải nghiệm các lợi ích mà nó đem lại." #: ../../docs/about/faq.rst:123 msgid "" "More information about getting comfortable with GDScript or dynamically " "typed languages can be found in the :ref:`doc_gdscript_more_efficiently` " "tutorial." msgstr "" "Nhiều thông tin hơn về việc làm quen với GDScript hoặc ngôn ngữ nhập động có " "thể được tìm thấy trong bài hướng dẫn :ref:`doc_gdscript_more_efficiently`." #: ../../docs/about/faq.rst:127 msgid "What were the motivations behind creating GDScript?" msgstr "Động lực nào thúc đẩy việc tạo ra GDScript?" #: ../../docs/about/faq.rst:129 msgid "" "In the early days, the engine used the `Lua `__ " "scripting language. Lua is fast, but creating bindings to an object oriented " "system (by using fallbacks) was complex and slow and took an enormous amount " "of code. After some experiments with `Python `__, it " "also proved difficult to embed." msgstr "" #: ../../docs/about/faq.rst:135 msgid "" "The main reasons for creating a custom scripting language for Godot were:" msgstr "" "Những lí do chính trong việc tạo ra ngôn ngữ lập trình riêng cho Godot là:" #: ../../docs/about/faq.rst:137 #, fuzzy msgid "" "Poor threading support in most script VMs, and Godot uses threads (Lua, " "Python, Squirrel, JavaScript, ActionScript, etc.)." msgstr "" "Hỗ trợ thread kém trong đa số script VMs, và Godot sử dụng threads (Lua, " "Python, Squirrel, JS, AS, vv...)" #: ../../docs/about/faq.rst:139 #, fuzzy msgid "" "Poor class-extending support in most script VMs, and adapting to the way " "Godot works is highly inefficient (Lua, Python, JavaScript)." msgstr "" "Poor class-extending support in most script VMs, and adapting to the way " "Godot works is highly inefficient (Lua, Python, JS)." #: ../../docs/about/faq.rst:141 #, fuzzy msgid "" "Many existing languages have horrible interfaces for binding to C++, " "resulting in large amount of code, bugs, bottlenecks, and general " "inefficiency (Lua, Python, Squirrel, JavaScript, etc.) We wanted to focus on " "a great engine, not a great amount of integrations." msgstr "" "Giao diện phức tạp để kết nối với C++, kết quả là mã nguồn trở nên cồng " "kềnh, nhiều lỗi và không hiệu quả (Lua, Python, Squirrel, JS, vv.)" #: ../../docs/about/faq.rst:144 msgid "" "No native vector types (vector3, matrix4, etc.), resulting in highly reduced " "performance when using custom types (Lua, Python, Squirrel, JavaScript, " "ActionScript, etc.)." msgstr "" #: ../../docs/about/faq.rst:147 #, fuzzy msgid "" "Garbage collector results in stalls or unnecessarily large memory usage " "(Lua, Python, JavaScript, ActionScript, etc.)." msgstr "" "Thu gom rác thường làm đứng hoặc sử dụng quá nhiều bộ nhớ không cần thiết " "(Lua, Python, JS, AS, vv...)." #: ../../docs/about/faq.rst:149 #, fuzzy msgid "" "Difficulty to integrate with the code editor for providing code completion, " "live editing, etc. (all of them). This is well-supported by GDScript." msgstr "" "Khó khăn để tích hợp với code editor bằng cách cung cấp tính năng tự hoàn " "thành đoạn mã, chỉnh sửa trực tiếp, vv. (tất cả). Điều này được hỗ trợ tốt " "với GDScript." #: ../../docs/about/faq.rst:153 #, fuzzy msgid "GDScript was designed to curtail the issues above, and more." msgstr "GDScript đã được thiết kế để giải quyết những vấn đề và hơn nữa." #: ../../docs/about/faq.rst:156 msgid "What type of 3D model formats does Godot support?" msgstr "Godot hỗ trợ những định dạng mô hình 3D nào?" #: ../../docs/about/faq.rst:158 #, fuzzy msgid "" "Godot supports Collada via the `OpenCollada `_ exporter (Maya, 3DSMax). If you are " "using Blender, take a look at our own `Better Collada Exporter `_." msgstr "" "Godot hỗ trợ Collada qua `OpenCollada `_ exporter (Maya, 3DSMax)." #: ../../docs/about/faq.rst:161 msgid "As of Godot 3.0, glTF is supported." msgstr "Với Godot 3.0, glTF được hỗ trợ." #: ../../docs/about/faq.rst:163 msgid "" "FBX is supported via the Open Asset Import library. However, FBX is " "proprietary so we recommend using other formats listed above, if suitable " "for your workflow." msgstr "" #: ../../docs/about/faq.rst:167 #, fuzzy msgid "" "Will [insert closed SDK such as FMOD, GameWorks, etc.] be supported in Godot?" msgstr "Godot có hỗ trợ SDK đóng như PhysX, GameWorks, vv... không?" #: ../../docs/about/faq.rst:169 msgid "" "The aim of Godot is to create a free and open-source MIT-licensed engine " "that is modular and extendable. There are no plans for the core engine " "development community to support any third-party, closed-source/proprietary " "SDKs, as integrating with these would go against Godot's ethos." msgstr "" "Mục đích của Godot là tạo ra một công cụ được cấp phép MIT miễn phí và nguồn " "mở, có tính mô-đun và có thể mở rộng. Không có kế hoạch nào cho cộng đồng " "phát triển động cơ cốt lõi để hỗ trợ bất kỳ SDK độc quyền, nguồn đóng / độc " "quyền của bên thứ ba nào, vì việc tích hợp với chúng sẽ đi ngược lại các tôn " "chỉ của Godot." #: ../../docs/about/faq.rst:174 msgid "" "That said, because Godot is open-source and modular, nothing prevents you or " "anyone else interested in adding those libraries as a module and shipping " "your game with them--as either open- or closed-source." msgstr "" "Như đã nói, bởi vì Godot là mã nguồn mở và mô-đun, không có gì ngăn cản bạn " "hoặc bất kỳ ai thích thú với việc thêm các thư viện đó dưới dạng mô-đun và " "trao đổi trò chơi của bạn - dưới dạng nguồn mở hoặc nguồn đóng." #: ../../docs/about/faq.rst:178 msgid "" "To see how support for your SDK of choice could still be provided, look at " "the Plugins question below." msgstr "" #: ../../docs/about/faq.rst:181 msgid "" "If you know of a third-party SDK that is not supported by Godot but that " "offers free and open-source integration, consider starting the integration " "work yourself. Godot is not owned by one person; it belongs to the " "community, and it grows along with ambitious community contributors like you." msgstr "" "Nếu bạn biết tới một SDK bên thứ ba nào không được hỗ trợ bởi GOdot nhưng " "được cung cấp dưới dạng mã nguồn mở, hãy xem xét và tự mình tích hợp. Godot " "không được sở hữu bởi một cá nhân mà thuộc về cả cộng đồng, và nó sẽ phát " "triển với tham vọng của công động giống như bạn." #: ../../docs/about/faq.rst:187 msgid "" "How should assets be created to handle multiple resolutions and aspect " "ratios?" msgstr "" "Làm sao để assets được tạo ra và kiểm soát được đúng với nhiều màn hình và " "độ tỉ lệ màn hình khác nhau?" #: ../../docs/about/faq.rst:189 #, fuzzy msgid "" "This question pops up often and it's probably thanks to the misunderstanding " "created by Apple when they originally doubled the resolution of their " "devices. It made people think that having the same assets in different " "resolutions was a good idea, so many continued towards that path. That " "originally worked to a point and only for Apple devices, but then several " "Android and Apple devices with different resolutions and aspect ratios were " "created, with a very wide range of sizes and DPIs." msgstr "" "Câu hỏi này xuất hiện thường xuyên vì sự hiểu lầm mà Apple tạo ra khi họ " "nhân đôi độ phân giải trong các thiết bị của họ. Điều này khiến mọi người " "nghĩ có ảnh(assets) với các độ phân giải khác nhau là một lựa chọn tốt nên " "nhiều người vẫn làm vậy. Nó chỉ làm việc với các thiết bị ban đầu của Apple, " "tuy nhiên sau đó thì các thiết bị Android và Apple với nhiều độ phân giải, " "tỉ lệ màn hình khác nhau được tạo ra, với nhiều kích thước và DPI." #: ../../docs/about/faq.rst:197 #, fuzzy msgid "" "The most common and proper way to achieve this is to, instead, use a single " "base resolution for the game and only handle different screen aspect ratios. " "This is mostly needed for 2D, as in 3D it's just a matter of Camera XFov or " "YFov." msgstr "" "Cách thông dụng nhất để đạt được điều đó là dùng một độ phân giải gốc cho " "trò chơi và chỉ quan tâm đến tỉ lệ màn hình. Điều này chủ yếu quan trọng " "trong 2D, khi mà trong 3D thì đó chỉ là vấn đề của Camera XFov hoặc YFov." #: ../../docs/about/faq.rst:201 #, fuzzy msgid "" "Choose a single base resolution for your game. Even if there are devices " "that go up to 2K and devices that go down to 400p, regular hardware scaling " "in your device will take care of this at little or no performance cost. Most " "common choices are either near 1080p (1920x1080) or 720p (1280x720). Keep in " "mind the higher the resolution, the larger your assets, the more memory they " "will take and the longer the time it will take for loading." msgstr "" "Chọn một độ phân giải gốc cho trò chơi của bạn. Thậm chí khi có thiết bị với " "độ phân giải đến 2K hoặc chỉ 400p, phần cứng trong thiết bị sẽ lo việc còn " "lại với 1 ít hoặc không ảnh hưởng đến hiệu năng. Phần lớn lựa chọn gần 1080p " "(1920x1080) hoặc 720p (1280x720). Lưu ý rằng độ phân giải càng cao thì kích " "thước tài nguyên của bạn càng lớn, chúng sẽ chiếm nhiều bộ nhớ và thời gian " "để nạp hơn." #: ../../docs/about/faq.rst:209 msgid "" "Use the stretch options in Godot; 2D stretching while keeping aspect ratios " "works best. Check the :ref:`doc_multiple_resolutions` tutorial on how to " "achieve this." msgstr "" #: ../../docs/about/faq.rst:213 msgid "" "Determine a minimum resolution and then decide if you want your game to " "stretch vertically or horizontally for different aspect ratios, or if there " "is one aspect ratio and you want black bars to appear instead. This is also " "explained in :ref:`doc_multiple_resolutions`." msgstr "" #: ../../docs/about/faq.rst:218 msgid "" "For user interfaces, use the :ref:`anchoring ` to " "determine where controls should stay and move. If UIs are more complex, " "consider learning about Containers." msgstr "" #: ../../docs/about/faq.rst:222 msgid "And that's it! Your game should work in multiple resolutions." msgstr "Thế là xong! Trò chơi của bạn sẽ hoạt động trên nhiều độ phân giải." #: ../../docs/about/faq.rst:224 msgid "" "If there is a desire to make your game also work on ancient devices with " "tiny screens (fewer than 300 pixels in width), you can use the export option " "to shrink images, and set that build to be used for certain screen sizes in " "the App Store or Google Play." msgstr "" "Nếu muốn trò chơi của bạn chạy được trên những thiết bị cổ đại với màn hình " "nhỏ (chiều rộng nhỏ hơn 300 pixel), bạn có thể sử dụng lựa chọn xuất là thu " "nhỏ hình ảnh, và chỉnh bản dựng đó để có thể sử dụng với một số kích cỡ màn " "hình trên App Store hoặc Google Play." #: ../../docs/about/faq.rst:230 msgid "How can I extend Godot?" msgstr "Làm sao để mở rộng Godot?" #: ../../docs/about/faq.rst:232 #, fuzzy msgid "" "For extending Godot, like creating Godot Editor plugins or adding support " "for additional languages, take a look at :ref:`EditorPlugins " "` and tool scripts." msgstr "" "Để mở rộng Godot, như tạo plugin cho Godot Editor hoặc hỗ trợ thêm ngôn ngữ " "khác, xem thử :ref:`EditorPlugins ` và tool scripts." #: ../../docs/about/faq.rst:236 #, fuzzy msgid "Also, see the official blog posts on these topics:" msgstr "" "Ngoài ra bạn có thể xem thử những bài blog chính thức về những vấn đề này:" #: ../../docs/about/faq.rst:238 msgid "" "`A look at the GDNative architecture `_" msgstr "" "`Xem thử cấu trúc của GDNative `_" #: ../../docs/about/faq.rst:239 msgid "`GDNative is here! `_" msgstr "`GDNative đây! `_" #: ../../docs/about/faq.rst:241 msgid "" "You can also take a look at the GDScript implementation, the Godot modules, " "as well as the `unofficial Python support `_ for Godot. This would be a good starting point to see how " "another third-party library integrates with Godot." msgstr "" "Bạn có thể xem qua cách GDScript được thực thi, đó cũng là 1 Mô-đun của " "Godot, đường dẫn `unofficial Python support `_ for Godot. Đây có lẽ là cách khá tốt để hiểu cách mà một thư " "viện bên thứ ba được tích hợp vào Godot." #: ../../docs/about/faq.rst:247 msgid "I would like to contribute! How can I get started?" msgstr "Tôi muốn đóng góp! Làm sao để bắt đầu?" #: ../../docs/about/faq.rst:249 msgid "" "Awesome! As an open-source project, Godot thrives off of the innovation and " "ambition of developers like you." msgstr "" "Tuyệt vời! Vì là một dự án mã nguồn mở, Godot phát triển hơn là nhờ sự nhiệt " "huyết và sáng kiến của những lập trình viên như bạn." #: ../../docs/about/faq.rst:252 msgid "" "The first place to get started is in the `issues `_. Find an issue that resonates with you, then " "proceed to the `How to Contribute `_ guide to learn how to " "fork, modify, and submit a Pull Request (PR) with your changes." msgstr "" #: ../../docs/about/faq.rst:257 msgid "I have a great idea for Godot. How can I share it?" msgstr "Tôi có một sáng kiến tuyệt vời cho Godot. Làm sao để chia sẻ nó?" #: ../../docs/about/faq.rst:259 msgid "" "It might be tempting to want to bring ideas to Godot, like ones that result " "in massive core changes, some sort of mimicry of what another game engine " "does, or alternative workflows that you'd like built into the editor. These " "are great, and we are thankful to have such motivated people want to " "contribute, but Godot's focus is and always will be the core functionality " "as outlined in the `Roadmap `_, `squashing bugs and addressing issues `_, and conversations between Godot " "community members." msgstr "" #: ../../docs/about/faq.rst:268 msgid "" "Most developers in the Godot community will be more interested to learn " "about things like:" msgstr "" "Đa số lập trình viên ở cộng đồng Godot sẽ thích thú hơn khi biết thêm về " "những điều như:" #: ../../docs/about/faq.rst:271 msgid "" "Your experience using the software and the problems you have (we care about " "this much more than ideas on how to improve it)." msgstr "" "Quá trình trải nghiệm phần mềm và những vấn đề bạn gặp phải (chúng tôi quan " "tâm tới điều này nhiều hơn là ý kiến về việc làm sao để cải thiện nó)." #: ../../docs/about/faq.rst:273 msgid "" "The features you would like to see implemented because you need them for " "your project." msgstr "" "Những tính năng bạn muốn thấy được tích hợp vì đang cần nó cho dự án của bạn." #: ../../docs/about/faq.rst:275 msgid "" "The concepts that were difficult to understand while learning the software." msgstr "Những khái niệm quá mơ hồ khi đang học phần mềm." #: ../../docs/about/faq.rst:276 msgid "The parts of your workflow you would like to see optimized." msgstr "Những phần trong tiến trình công việc mà bạn muốn thấy được tối ưu." #: ../../docs/about/faq.rst:277 msgid "" "Parts where you missed clear tutorials or where the documentation wasn't " "clear." msgstr "Những phần thiếu bài hướng dẫn rõ ràng hoặc tài liệu chưa dễ hiểu." #: ../../docs/about/faq.rst:279 msgid "" "Please don't feel like your ideas for Godot are unwelcome. Instead, try to " "reformulate them as a problem first, so developers and the community have a " "functional foundation to ground your ideas on." msgstr "" "Đừng nghĩ rẳng những ý tưởng của bạn cho Godot là vô ích. Bạn nên thử giải " "quyết nó như một vấn đề trước, sau đó các nhà phát triển và cộng đồng sẽ có " "một chức năng dựa trên ý tưởng đó." #: ../../docs/about/faq.rst:283 msgid "" "A good way to approach sharing your ideas and problems with the community is " "as a set of user stories. Explain what you are trying to do, what behavior " "you expect to happen, and then what behavior actually happened. Framing " "problems and ideas this way will help the whole community stay focused on " "improving developer experiences as a whole." msgstr "" #: ../../docs/about/faq.rst:289 msgid "" "Bonus points for bringing screenshots, concrete numbers, test cases, or " "example projects (if applicable)." msgstr "" "Cộng thêm điểm cho ai có ảnh chụp màn hình, số liệu cụ thể, bài test, hoặc " "project mẫu (nếu được)." #: ../../docs/about/faq.rst:294 msgid "Why does Godot not use STL (Standard Template Library)" msgstr "" #: ../../docs/about/faq.rst:296 msgid "" "Like many other libraries (Qt as an example), Godot does not make use of " "STL. We believe STL is a great general purpose library, but we had special " "requirements for Godot." msgstr "" #: ../../docs/about/faq.rst:300 msgid "" "STL templates create very large symbols, which results in huge debug " "binaries. We use few templates with very short names instead." msgstr "" #: ../../docs/about/faq.rst:301 msgid "" "Most of our containers cater to special needs, like Vector, which uses copy " "on write and we use to pass data around, or the RID system, which requires " "O(1) access time for performance. Likewise, our hash map implementations are " "designed to integrate seamlessly with internal engine types." msgstr "" #: ../../docs/about/faq.rst:302 msgid "" "Our containers have memory tracking built-in, which helps better track " "memory usage." msgstr "" #: ../../docs/about/faq.rst:303 msgid "" "For large arrays, we use pooled memory, which can be mapped to either a " "preallocated buffer or virtual memory." msgstr "" #: ../../docs/about/faq.rst:304 msgid "" "We use our custom String type, as the one provided by STL is too basic and " "lacks proper internationalization support." msgstr "" #: ../../docs/about/faq.rst:307 msgid "Why does Godot not use exceptions?" msgstr "" #: ../../docs/about/faq.rst:309 msgid "" "We believe games should not crash, no matter what. If an unexpected " "situation happens, Godot will print an error (which can be traced even to " "script), but then it will try to recover as gracefully as possible and keep " "going." msgstr "" #: ../../docs/about/faq.rst:314 msgid "" "Additionally, exceptions significantly increase binary size for the " "executable." msgstr "" #: ../../docs/about/faq.rst:318 msgid "Why does Godot not enforce RTTI?" msgstr "" #: ../../docs/about/faq.rst:320 msgid "" "Godot provides its own type-casting system, which can optionally use RTTI " "internally. Disabling RTTI in Godot means considerably smaller binary sizes " "can be achieved, at a little performance cost." msgstr "" #: ../../docs/about/faq.rst:325 msgid "Why does Godot not force users to implement DoD (Data oriented Design)?" msgstr "" #: ../../docs/about/faq.rst:327 msgid "" "While Godot internally for a lot of the heavy performance tasks attempts to " "use cache coherency as well as possible, we believe most users don't really " "need to be forced to use DoD practices." msgstr "" #: ../../docs/about/faq.rst:331 msgid "" "DoD is mostly a cache coherency optimization that can only gain you " "significant performance improvements when dealing with dozens of thousands " "of objects (which are processed every frame with little modification). As " "in, if you are moving a few hundred sprites or enemies per frame, DoD won't " "help you, and you should consider a different approach to optimization." msgstr "" #: ../../docs/about/faq.rst:338 msgid "" "The vast majority of games do not need this and Godot provides handy helpers " "to do the job for most cases when you do." msgstr "" #: ../../docs/about/faq.rst:341 msgid "" "If a game that really needs to process such large amount of objects is " "needed, our recommendation is to use C++ and GDNative for the high " "performance parts and GDScript (or C#) for the rest of the game." msgstr "" #: ../../docs/about/faq.rst:346 msgid "How can I support Godot development or contribute?" msgstr "Làm sao để hỗ trợ hoặc góp sức cho việc phát triển Godot?" #: ../../docs/about/faq.rst:348 msgid "See :ref:`doc_ways_to_contribute`." msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/faq.rst:351 msgid "Who is working on Godot? How can I contact you?" msgstr "Ai đang phát triển Godot? Làm sao để liên hê người đó?" #: ../../docs/about/faq.rst:353 msgid "" "See the corresponding page on the `Godot website `_." msgstr "" #: ../../docs/about/docs_changelog.rst:4 msgid "Documentation changelog" msgstr "" #: ../../docs/about/docs_changelog.rst:6 msgid "" "The documentation is continually being improved. The release of version 3.2 " "includes many new tutorials, many fixes and updates for old tutorials, and " "many updates to the :ref:`class reference `. Below is a list " "of new tutorials added since version 3.1." msgstr "" #: ../../docs/about/docs_changelog.rst:11 msgid "" "This document only contains new tutorials so not all changes are reflected, " "many tutorials have been substantially updated but are not reflected in this " "document." msgstr "" #: ../../docs/about/docs_changelog.rst:15 msgid "New tutorials since version 3.1" msgstr "" #: ../../docs/about/docs_changelog.rst:18 #: ../../docs/about/docs_changelog.rst:118 #: ../../docs/getting_started/workflow/index.rst:2 msgid "Project workflow" msgstr "" #: ../../docs/about/docs_changelog.rst:20 msgid ":ref:`doc_android_custom_build`" msgstr "" #: ../../docs/about/docs_changelog.rst:23 #: ../../docs/about/docs_changelog.rst:134 ../../docs/tutorials/2d/index.rst:2 msgid "2D" msgstr "" #: ../../docs/about/docs_changelog.rst:25 #, fuzzy msgid ":ref:`doc_2d_sprite_animation`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:28 #: ../../docs/tutorials/audio/index.rst:2 msgid "Audio" msgstr "Âm thanh" #: ../../docs/about/docs_changelog.rst:30 #, fuzzy msgid ":ref:`doc_recording_with_microphone`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:31 #, fuzzy msgid ":ref:`doc_sync_with_audio`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:34 ../../docs/tutorials/math/index.rst:2 msgid "Math" msgstr "" #: ../../docs/about/docs_changelog.rst:36 #, fuzzy msgid ":ref:`doc_beziers_and_curves`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:37 #, fuzzy msgid ":ref:`doc_interpolation`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:40 #: ../../docs/tutorials/inputs/index.rst:2 msgid "Inputs" msgstr "" #: ../../docs/about/docs_changelog.rst:42 #, fuzzy msgid ":ref:`doc_input_examples`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:45 ../../docs/tutorials/i18n/index.rst:2 msgid "Internationalization" msgstr "" #: ../../docs/about/docs_changelog.rst:47 msgid ":ref:`doc_localization_using_gettext`" msgstr "" #: ../../docs/about/docs_changelog.rst:50 #: ../../docs/about/docs_changelog.rst:170 #: ../../docs/tutorials/shading/index.rst:2 msgid "Shading" msgstr "" #: ../../docs/about/docs_changelog.rst:55 msgid "Your First Shader Series:" msgstr "" #: ../../docs/about/docs_changelog.rst:53 msgid ":ref:`doc_what_are_shaders`" msgstr "" #: ../../docs/about/docs_changelog.rst:54 msgid ":ref:`doc_your_first_canvasitem_shader`" msgstr "" #: ../../docs/about/docs_changelog.rst:55 msgid ":ref:`doc_your_first_spatial_shader`" msgstr "" #: ../../docs/about/docs_changelog.rst:56 msgid ":ref:`doc_your_second_spatial_shader`" msgstr "" #: ../../docs/about/docs_changelog.rst:57 #, fuzzy msgid ":ref:`doc_visual_shaders`" msgstr "Android" #: ../../docs/about/docs_changelog.rst:60 #: ../../docs/tutorials/networking/index.rst:2 msgid "Networking" msgstr "" #: ../../docs/about/docs_changelog.rst:62 #, fuzzy msgid ":ref:`doc_webrtc`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:65 ../../docs/tutorials/vr/index.rst:2 msgid "VR" msgstr "" #: ../../docs/about/docs_changelog.rst:67 #, fuzzy msgid ":ref:`doc_vr_starter_tutorial_part_one`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:68 #, fuzzy msgid ":ref:`doc_vr_starter_tutorial_part_two`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:71 #: ../../docs/about/docs_changelog.rst:185 #: ../../docs/tutorials/plugins/index.rst:2 msgid "Plugins" msgstr "" #: ../../docs/about/docs_changelog.rst:73 #, fuzzy msgid ":ref:`doc_android_plugin`" msgstr "Android" #: ../../docs/about/docs_changelog.rst:74 #, fuzzy msgid ":ref:`doc_inspector_plugins`" msgstr "Android" #: ../../docs/about/docs_changelog.rst:75 #, fuzzy msgid ":ref:`doc_visual_shader_plugins`" msgstr "Android" #: ../../docs/about/docs_changelog.rst:78 #: ../../docs/about/docs_changelog.rst:196 #: ../../docs/tutorials/threads/index.rst:2 msgid "Multi-threading" msgstr "" #: ../../docs/about/docs_changelog.rst:80 #, fuzzy msgid ":ref:`doc_using_multiple_threads`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:83 #: ../../docs/about/docs_changelog.rst:201 #: ../../docs/tutorials/content/index.rst:2 #, fuzzy msgid "Creating content" msgstr "Tạo nội dung" #: ../../docs/about/docs_changelog.rst:90 msgid "Procedural geometry series:" msgstr "" #: ../../docs/about/docs_changelog.rst:86 msgid ":ref:`Procedural geometry `" msgstr "" #: ../../docs/about/docs_changelog.rst:87 #, fuzzy msgid ":ref:`doc_arraymesh`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:88 #, fuzzy msgid ":ref:`doc_surfacetool`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:89 #, fuzzy msgid ":ref:`doc_meshdatatool`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:90 #, fuzzy msgid ":ref:`doc_immediategeometry`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:93 #: ../../docs/tutorials/optimization/index.rst:2 msgid "Optimization" msgstr "" #: ../../docs/about/docs_changelog.rst:95 msgid ":ref:`doc_using_multimesh`" msgstr "" #: ../../docs/about/docs_changelog.rst:96 msgid ":ref:`doc_using_servers`" msgstr "" #: ../../docs/about/docs_changelog.rst:99 #: ../../docs/tutorials/legal/index.rst:2 msgid "Legal" msgstr "" #: ../../docs/about/docs_changelog.rst:101 msgid ":ref:`doc_complying_with_licenses`" msgstr "" #: ../../docs/about/docs_changelog.rst:104 msgid "New tutorials since version 3.0" msgstr "" #: ../../docs/about/docs_changelog.rst:107 #: ../../docs/getting_started/step_by_step/index.rst:2 #: ../../docs/tutorials/2d/2d_lights_and_shadows.rst:108 #: ../../docs/development/compiling/compiling_with_script_encryption_key.rst:18 msgid "Step by step" msgstr "Từng bước" #: ../../docs/about/docs_changelog.rst:109 msgid ":ref:`doc_signals`" msgstr "" #: ../../docs/about/docs_changelog.rst:110 msgid ":ref:`doc_exporting`" msgstr "" #: ../../docs/about/docs_changelog.rst:113 #: ../../docs/getting_started/step_by_step/scripting.rst:4 #: ../../docs/getting_started/scripting/index.rst:2 #: ../../docs/tutorials/networking/http_request_class.rst:22 msgid "Scripting" msgstr "" #: ../../docs/about/docs_changelog.rst:115 msgid ":ref:`doc_gdscript_static_typing`" msgstr "" #: ../../docs/about/docs_changelog.rst:120 msgid "Best Practices:" msgstr "" #: ../../docs/about/docs_changelog.rst:122 msgid ":ref:`doc_introduction_best_practices`" msgstr "" #: ../../docs/about/docs_changelog.rst:123 msgid ":ref:`doc_what_are_godot_classes`" msgstr "" #: ../../docs/about/docs_changelog.rst:124 msgid ":ref:`doc_scene_organization`" msgstr "" #: ../../docs/about/docs_changelog.rst:125 msgid ":ref:`doc_scenes_versus_scripts`" msgstr "" #: ../../docs/about/docs_changelog.rst:126 msgid ":ref:`doc_autoloads_versus_internal_nodes`" msgstr "" #: ../../docs/about/docs_changelog.rst:127 msgid ":ref:`doc_node_alternatives`" msgstr "" #: ../../docs/about/docs_changelog.rst:128 msgid ":ref:`doc_godot_interfaces`" msgstr "" #: ../../docs/about/docs_changelog.rst:129 msgid ":ref:`doc_godot_notifications`" msgstr "" #: ../../docs/about/docs_changelog.rst:130 msgid ":ref:`doc_data_preferences`" msgstr "" #: ../../docs/about/docs_changelog.rst:131 msgid ":ref:`doc_logic_preferences`" msgstr "" #: ../../docs/about/docs_changelog.rst:136 msgid ":ref:`doc_2d_lights_and_shadows`" msgstr "" #: ../../docs/about/docs_changelog.rst:137 msgid ":ref:`doc_2d_meshes`" msgstr "" #: ../../docs/about/docs_changelog.rst:140 ../../docs/tutorials/3d/index.rst:2 msgid "3D" msgstr "" #: ../../docs/about/docs_changelog.rst:142 msgid ":ref:`doc_csg_tools`" msgstr "" #: ../../docs/about/docs_changelog.rst:143 msgid ":ref:`doc_animating_thousands_of_fish`" msgstr "" #: ../../docs/about/docs_changelog.rst:144 msgid ":ref:`doc_controlling_thousands_of_fish`" msgstr "" #: ../../docs/about/docs_changelog.rst:147 #: ../../docs/tutorials/physics/index.rst:2 msgid "Physics" msgstr "" #: ../../docs/about/docs_changelog.rst:149 msgid ":ref:`doc_ragdoll_system`" msgstr "" #: ../../docs/about/docs_changelog.rst:150 msgid ":ref:`doc_soft_body`" msgstr "" #: ../../docs/about/docs_changelog.rst:153 #: ../../docs/getting_started/workflow/assets/escn_exporter/animation.rst:2 #: ../../docs/tutorials/animation/index.rst:2 #: ../../docs/development/file_formats/tscn.rst:375 msgid "Animation" msgstr "Hoạt ảnh" #: ../../docs/about/docs_changelog.rst:155 msgid ":ref:`doc_2d_skeletons`" msgstr "" #: ../../docs/about/docs_changelog.rst:156 #, fuzzy msgid ":ref:`doc_animation_tree`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:159 ../../docs/tutorials/gui/index.rst:2 msgid "GUI" msgstr "" #: ../../docs/about/docs_changelog.rst:161 #, fuzzy msgid ":ref:`doc_gui_containers`" msgstr "Xem :ref:`doc_ways_to_contribute`." #: ../../docs/about/docs_changelog.rst:164 #: ../../docs/tutorials/viewports/index.rst:2 #: ../../docs/tutorials/viewports/viewports.rst:4 msgid "Viewports" msgstr "" #: ../../docs/about/docs_changelog.rst:166 msgid ":ref:`doc_viewport_as_texture`" msgstr "" #: ../../docs/about/docs_changelog.rst:167 msgid ":ref:`doc_custom_postprocessing`" msgstr "" #: ../../docs/about/docs_changelog.rst:172 msgid ":ref:`doc_intro_to_shaders_water_workshop`" msgstr "" #: ../../docs/about/docs_changelog.rst:173 msgid ":ref:`doc_migrating_to_godot_shader_language`" msgstr "" #: ../../docs/about/docs_changelog.rst:174 msgid ":ref:`doc_advanced_postprocessing`" msgstr "" #: ../../docs/about/docs_changelog.rst:176 msgid "Shading Reference:" msgstr "" #: ../../docs/about/docs_changelog.rst:178 msgid ":ref:`doc_shaders`" msgstr "" #: ../../docs/about/docs_changelog.rst:179 msgid ":ref:`doc_shading_language`" msgstr "" #: ../../docs/about/docs_changelog.rst:180 msgid ":ref:`doc_spatial_shader`" msgstr "" #: ../../docs/about/docs_changelog.rst:181 msgid ":ref:`doc_canvas_item_shader`" msgstr "" #: ../../docs/about/docs_changelog.rst:182 msgid ":ref:`doc_particle_shader`" msgstr "" #: ../../docs/about/docs_changelog.rst:187 #, fuzzy msgid ":ref:`doc_making_main_screen_plugins`" msgstr "Tạo nội dung" #: ../../docs/about/docs_changelog.rst:188 msgid ":ref:`doc_spatial_gizmo_plugins`" msgstr "" #: ../../docs/about/docs_changelog.rst:191 #: ../../docs/tutorials/platform/index.rst:2 msgid "Platform-specific" msgstr "" #: ../../docs/about/docs_changelog.rst:193 msgid ":ref:`doc_customizing_html5_shell`" msgstr "" #: ../../docs/about/docs_changelog.rst:198 msgid ":ref:`doc_thread_safe_apis`" msgstr "" #: ../../docs/about/docs_changelog.rst:203 msgid ":ref:`doc_making_trees`" msgstr "" #: ../../docs/about/docs_changelog.rst:206 #: ../../docs/tutorials/misc/index.rst:2 msgid "Miscellaneous" msgstr "" #: ../../docs/about/docs_changelog.rst:208 msgid ":ref:`doc_jitter_stutter`" msgstr "" #: ../../docs/about/docs_changelog.rst:209 msgid ":ref:`doc_running_code_in_the_editor`" msgstr "" #: ../../docs/about/docs_changelog.rst:210 msgid ":ref:`doc_change_scenes_manually`" msgstr "" #: ../../docs/about/docs_changelog.rst:211 msgid ":ref:`doc_gles2_gles3_differences`" msgstr "" #: ../../docs/about/docs_changelog.rst:214 #: ../../docs/tutorials/plugins/gdnative/gdnative-c-example.rst:349 #: ../../docs/development/compiling/index.rst:2 #: ../../docs/development/compiling/compiling_for_windows.rst:92 #: ../../docs/development/compiling/compiling_for_x11.rst:89 #: ../../docs/development/compiling/compiling_for_osx.rst:31 #: ../../docs/development/compiling/compiling_for_ios.rst:19 #: ../../docs/development/compiling/compiling_for_uwp.rst:33 msgid "Compiling" msgstr "" #: ../../docs/about/docs_changelog.rst:216 msgid ":ref:`doc_optimizing_for_size`" msgstr "" #: ../../docs/about/docs_changelog.rst:217 msgid ":ref:`doc_compiling_with_script_encryption_key`" msgstr "" #: ../../docs/about/docs_changelog.rst:220 #: ../../docs/development/cpp/index.rst:2 msgid "Engine development" msgstr "" #: ../../docs/about/docs_changelog.rst:222 msgid ":ref:`doc_binding_to_external_libraries`" msgstr "" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:4 #, fuzzy msgid "Introduction to Godot's editor" msgstr "Hướng dẫn Godot editor" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:6 #, fuzzy msgid "" "This tutorial will run you through Godot's interface. We're going to look at " "the **Project Manager, docks, workspaces** and everything you need to know " "to get started with the engine." msgstr "" "Hướng dẫn này sẽ đưa bạn qua giao diện Godot. Chúng tôi sẽ xem xét **Project " "Manager, docks, workspaces** và mọi thứ bạn cần biết để bắt đầu với công cụ." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:11 msgid "Project manager" msgstr "Project manager (Quản lý dự án)" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:13 #, fuzzy msgid "" "When you launch Godot, the first window you'll see is the Project Manager. " "Since you have no projects there will be a popup asking if you want to open " "the asset library, just click cancel, we'll look at it later." msgstr "" "Khi bạn khởi chạy Godot, cửa sổ đầu tiên bạn sẽ thấy là Project Manager. Nó " "cho phép bạn tạo, xóa, import hoặc chơi các dự án trò chơi." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:19 #, fuzzy msgid "" "Now you should see the project manager. It lets you create, remove, import " "or play game projects." msgstr "" "Khi bạn khởi chạy Godot, cửa sổ đầu tiên bạn sẽ thấy là Project Manager. Nó " "cho phép bạn tạo, xóa, import hoặc chơi các dự án trò chơi." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:24 #, fuzzy msgid "" "In the top-right corner you'll find a drop-down menu to change the editor's " "language." msgstr "" "Ở góc trên cùng bên phải có một bảng menu kéo xuống để thay đổi ngôn ngữ " "trình biên tập." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:29 #, fuzzy msgid "" "From the **Templates** tab you can download open source project templates " "and demos from the Asset Library to help you get started faster. Just select " "the template or demo you want, click download, once it's finished " "downloading click install and choose where you want the project to go. You " "can learn more about it in :ref:`doc_what_is_assetlib`." msgstr "" "Từ tab **Templates** bạn có thể tải project templates mã nguồn mở và bản " "demo để giúp bắt đầu nhanh hơn." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:38 msgid "Create or import a project" msgstr "Tạo hoặc nhập vào một dự án" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:40 #, fuzzy msgid "" "To create a new project, click the ``New Project`` button on the right. Here " "you give it a name, choose an empty folder on your computer to save it to, " "and choose a renderer." msgstr "" "Để tạo một dự án mới, nhấp vào nút ``Dự án mới`` ở bên phải. Đặt tên và chọn " "một folder trống trên máy tính để lưu lại." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:46 #, fuzzy msgid "" "Click the Browse button to open Godot's file browser and pick a location or " "type the folder's path in the Project Path field." msgstr "" "Nhấp vào nút Browse để mở trình duyệt tệp Godot, và chọn một vị trí hoặc " "nhập đường dẫn thư mục trong trường Đường dẫn dự án." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:51 #, fuzzy msgid "" "When you see the green tick on the right, it means the engine detects an " "empty folder. You can also click the ``Create Folder`` button next to your " "project name and an empty folder will be created with that name for the " "project." msgstr "" "Khi bạn thấy dấu tick màu xanh bên phải, điều đó có nghĩa là engine phát " "hiện một thư mục trống và bạn có thể nhấp vào `` Create``. Godot sẽ tạo dự " "án cho bạn và mở nó trong trình chỉnh sửa." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:55 msgid "" "Finally, you need to choose which renderer to use (OpenGL ES 3.0 or OpenGL " "ES 2.0). The advantages and disadvantages of each are listed to help you " "choose, and you can refer to :ref:`doc_gles2_gles3_differences` for more " "details. Note that you can change the backend from the project settings if " "you change your mind later on. For this tutorial either backend is fine." msgstr "" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:61 #, fuzzy msgid "" "Once you are done click ``Create & Edit``. Godot will create the project for " "you and open it in the editor." msgstr "" "Khi bạn thấy dấu tick màu xanh bên phải, điều đó có nghĩa là engine phát " "hiện một thư mục trống và bạn có thể nhấp vào `` Create``. Godot sẽ tạo dự " "án cho bạn và mở nó trong trình chỉnh sửa." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:64 #, fuzzy msgid "" "The next time you open the project manager, you'll see your new project in " "the list. Double click on it to open it in the editor." msgstr "" "Lần tới khi bạn mở Godot, bạn sẽ thấy dự án mới của mình trong danh sách. " "Nhấp đúp chuột vào nó để mở nó trong trình chỉnh sửa." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:69 msgid "" "You can import existing projects in a similar way, using the Import button. " "Locate the folder that contains the project or the ``project.godot`` file to " "import and edit it." msgstr "" "Bạn có thể nhập các dự án hiện có theo cách tương tự, sử dụng nút Import. " "Định vị thư mục chứa dự án hoặc tệp `` project.godot`` để nhập và chỉnh sửa " "nó." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:75 msgid "When the folder path is correct, you'll see a green checkmark." msgstr "Khi đường dẫn thư mục chính xác, bạn sẽ thấy dấu kiểm màu xanh lục." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:80 #, fuzzy msgid "Your first look at Godot's editor" msgstr "Cái nhìn đầu tiên của bạn về editor (trình soạn thảo) của Godot," #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:82 #, fuzzy msgid "" "Welcome to Godot! With your project open, you should see the editor's " "interface with menus along the top of the interface and docks along the far " "extremes of the interface on either side of the viewport." msgstr "" "Chào mừng bạn đến Godot! Với dự án mở của bạn, bạn sẽ thấy giao diện của " "editor với 3D viewport đang hoạt động. Bạn có thể thay đổi không gian làm " "việc hiện tại ở phía trên của giao diện. Nhấp vào 2D để chuyển sang không " "gian làm việc 2D." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:88 msgid "" "At the top, from left to right, you can see the **main menus**, the " "**workspaces**, and the **playtest buttons**." msgstr "" "Ở trên cùng, từ trái sang phải, bạn có thể thấy **main menus**, the " "**workspaces**, and the **playtest buttons**." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:91 #, fuzzy msgid "" "The **FileSystem dock** is where you'll manage your project files and assets." msgstr "" "Ở phía bên trái, bạn có **FileSystem dock**, nơi bạn sẽ quản lý các file và " "tài sản dự án của mình." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:95 #, fuzzy msgid "" "The **Scene dock** lists the active scene's content and the **Inspector** " "allows for the management of the properties of a scene's content." msgstr "" "Ở phía bên phải, bạn sẽ tìm thấy **Scene dock**, trong đó danh sách nội dung " "scene đang được chọn và **Inspector** ở góc dưới bên phải." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:100 #, fuzzy msgid "" "In the center, you have the **Toolbar** at the top, where you'll find tools " "to move, scale or lock your scene's objects. It changes as you jump to " "different workspaces." msgstr "" "Ở trung tâm, bạn có ** Thanh công cụ ** ở trên cùng, nơi bạn sẽ tìm các công " "cụ để di chuyển, thu phóng tỷ lệ hoặc khóa các đối tượng trong scene của " "bạn. Nó thay đổi khi bạn chuyển đến các không gian làm việc khác nhau." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:106 #, fuzzy msgid "" "The **Bottom Panel** is the host for the debug console, the animation " "editor, the audio mixer… They are wide and can take precious space. That's " "why they're folded by default." msgstr "" "** Bảng điều khiển dưới cùng ** là máy chủ lưu trữ cho bảng điều khiển gỡ " "lỗi (debug,) trình chỉnh sửa animation, bộ trộn âm thanh." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:113 msgid "The workspaces" msgstr "Không gian làm việc" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:115 msgid "" "You can see four workspace buttons at the top: 2D, 3D, Script and AssetLib." msgstr "" "Bạn có thể thấy bốn nút về không gian làm việc ở trên cùng: 2D, 3D, Script " "và AssetLib." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:118 #, fuzzy msgid "" "You'll use the **2D workspace** for all types of games. In addition to 2D " "games, the 2D workspace is where you'll build your interfaces. Press :kbd:" "`F1` (or :kbd:`Alt + 1` on macOS) to access it." msgstr "" "Bạn có thể sử dụng ** không gian làm việc 2D ** cho tất cả các loại trò " "chơi. Ngoài các trò chơi 2D, không gian làm việc 2D là nơi bạn sẽ xây dựng " "giao diện của mình. Nhấn F1 để truy cập nó." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:124 #, fuzzy msgid "" "In the **3D workspace**, you can work with meshes, lights, and design levels " "for 3D games. Press :kbd:`F2` (or :kbd:`Alt + 2` on macOS) to access it." msgstr "" "Trong ** không gian làm việc 3D **, bạn có thể làm việc với các lưới, đèn và " "design level cho các trò chơi 3D. Nhấn F2 để truy cập nó." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:129 #, fuzzy msgid "" "Notice the perspective button under the toolbar, it opens a list of options " "related to the 3D viewport." msgstr "" "Lưu ý văn bản [perspective] dưới thanh công cụ, đó là nút mở danh sách các " "tùy chọn liên quan đến chế độ xem 3D." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:134 #, fuzzy msgid "" "Read :ref:`doc_introduction_to_3d` for more detail about **3D workspace**." msgstr "" "Đọc: Ref: ' doc_introduction_to_3d ' để biết thêm chi tiết về * * 3D " "Workspace * *." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:136 #, fuzzy msgid "" "The **Script** workspace is a complete code editor with a debugger, rich " "auto-completion, and built-in code reference. Press :kbd:`F3` (or :kbd:`Alt " "+ 3` on macOS) to access it, and :kbd:`F4` to search the reference." msgstr "" "* * Script * * Workspace là một trình soạn thảo mã hoàn chỉnh với trình gỡ " "lỗi, hoàn thành tự động phong phú và tham chiếu mã được tích hợp sẵn. Nhấn " "F3 để truy cập nó, và F4 để tìm kiếm tham chiếu." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:142 msgid "" "To search for information about a class, method, property, constant, or " "signal in the engine while you are writing a script, press the \"Search Help" "\" button at the top right of the Script workspace." msgstr "" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:148 msgid "" "A new window will pop up. Search for the item that you want to find " "information about." msgstr "" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:153 msgid "" "Click on the item you are looking for and press open. The documentation for " "the item will be displayed in the script workspace." msgstr "" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:158 #, fuzzy msgid "" "Finally, the **AssetLib** is a library of free and open source add-ons, " "scripts and assets to use in your projects." msgstr "" "Cuối cùng, ** AssetLib ** là một thư viện các tiện ích, script và tài sản " "miễn phí để sử dụng trong các dự án của bạn." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:162 #, fuzzy msgid "Modify the interface" msgstr "Sửa đổi giao diện" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:164 #, fuzzy msgid "" "Godot's interface lives in a single window. You cannot split it across " "multiple screens although you can work with an external code editor like " "Atom or Visual Studio Code for instance." msgstr "" "Giao diện của Godot ở trong một cửa sổ duy nhất. Bạn không thể chia nhỏ trên " "nhiều màn hình mặc dù bạn có thể làm việc với một trình soạn thảo mã bên " "ngoài như Atom hoặc Visual Studio chẳng hạn." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:169 msgid "Move and resize docks" msgstr "Di chuyển và thay đổi kích thước các cửa sổ" #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:171 msgid "" "Click and drag on the edge of any dock or panel to resize it horizontally or " "vertically." msgstr "" "Nhấp và kéo trên mép của bất kỳ cửa sổ hoặc bảng điều khiển để thay đổi kích " "thước nó theo chiều ngang hoặc chiều dọc." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:176 msgid "" "Click the three-dotted icon at the top of any dock to change its location." msgstr "" "Nhấp vào biểu tượng ba chấm ở đầu bất kỳ cửa sổ nào để thay đổi vị trí của " "nó." #: ../../docs/getting_started/step_by_step/intro_to_the_editor_interface.rst:181 msgid "" "Go to the ``Editor`` menu and ``Editor Settings`` to fine-tune the look and " "feel of the editor." msgstr "" "Chuyển đến trình đơn `` Editor`` và `` Editor Settings`` để tinh chỉnh giao " "diện của editor." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:4 msgid "Scenes and nodes" msgstr "Các scene và node" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:11 msgid "" "Imagine for a second that you are not a game developer anymore. Instead, " "you're a chef! Change your hipster outfit for a toque and a double breasted " "jacket. Now, instead of making games, you create new and delicious recipes " "for your guests." msgstr "" "Hãy tưởng tượng trong một giây rằng bạn không còn là nhà phát triển trò chơi " "nữa. Thay vào đó, bạn là một đầu bếp! Bây giờ, thay vì làm trò chơi, bạn tạo " "ra các công thức mới và món ngon cho khách của bạn." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:16 #, fuzzy msgid "" "So, how does a chef create a recipe? Recipes are divided into two sections: " "the first is the ingredients and the second is the instructions to prepare " "it. This way, anyone can follow the recipe and savor your magnificent " "creation." msgstr "" "Vì vậy, làm thế nào để một đầu bếp tạo ra một công thức? Bí quyết được chia " "thành hai phần: phần thứ nhất là nguyên liệu và phần thứ hai là hướng dẫn để " "chuẩn bị. Bằng cách này, bất cứ ai cũng có thể làm theo công thức và thưởng " "thức sáng tạo tuyệt vời của bạn." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:21 msgid "" "Making games in Godot feels pretty much the same way. Using the engine feels " "like being in a kitchen. In this kitchen, *nodes* are like a refrigerator " "full of fresh ingredients with which to cook." msgstr "" "Làm các trò chơi trong Godot khá giống như vậy. Sử dụng engine cho cảm giác " "như đang ở trong bếp. Trong nhà bếp này, * các node * giống như một tủ lạnh " "chứa đầy các nguyên liệu tươi để nấu." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:25 msgid "" "There are many types of nodes. Some show images, others play sound, other " "nodes display 3D models, etc. There are dozens of them." msgstr "" "Có nhiều loại node. Một số hiển thị hình ảnh, một số khác phát âm thanh, các " "nút khác hiển thị mô hình 3D, v.v ... Có hàng tá trong số chúng." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:29 #: ../../docs/getting_started/workflow/assets/importing_scenes.rst:101 #: ../../docs/tutorials/2d/2d_lights_and_shadows.rst:46 #: ../../docs/development/file_formats/tscn.rst:26 msgid "Nodes" msgstr "Node" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:31 msgid "" "But let's start with the basics. Nodes are fundamental building blocks for " "creating a game. As mentioned above, a node can perform a variety of " "specialized functions. However, any given node always has the following " "attributes:" msgstr "" "Nhưng hãy bắt đầu với những điều cơ bản. Các node là các khối xây dựng cơ " "bản để tạo ra một trò chơi. Như đã đề cập ở trên, một node có thể thực hiện " "một loạt các chức năng chuyên biệt. Tuy nhiên, bất kỳ node đã cho nào luôn " "có các thuộc tính sau:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:35 msgid "It has a name." msgstr "Nó có một cái tên." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:36 msgid "It has editable properties." msgstr "Nó có thuộc tính có thể chỉnh sửa." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:37 #, fuzzy msgid "It can receive a callback to process every frame." msgstr "Nó có thể nhận được một callback để xử lý mọi frame." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:38 msgid "It can be extended (to have more functions)." msgstr "Nó có thể được mở rộng (để có nhiều hàm nhiều chức năng hơn)." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:39 msgid "It can be added to another node as a child." msgstr "Nó có thể được thêm vào một node khác như là một node con." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:43 msgid "" "The last one is important. Nodes can have other nodes as children. When " "arranged in this way, the nodes become a **tree**." msgstr "" "Điều cuối cùng là quan trọng. Các node có thể có các node khác như con. Khi " "được sắp xếp theo cách này, các nút trở thành một tree **." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:46 msgid "" "In Godot, the ability to arrange nodes in this way creates a powerful tool " "for organizing projects. Since different nodes have different functions, " "combining them allows for the creation of more complex functions." msgstr "" "Trong Godot, khả năng sắp xếp các node theo cách này tạo ra một công cụ mạnh " "mẽ để tổ chức các dự án. Vì các node khác nhau có các chức năng, hàm khác " "nhau, việc kết hợp chúng cho phép tạo ra các chức năng phức tạp hơn." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:50 msgid "" "Don't worry if this doesn't click yet. We will continue to explore this over " "the next few sections. The most important fact to remember for now is that " "nodes exist and can be arranged this way." msgstr "" "Đừng lo lắng nếu điều này khó hiểu. Chúng ta sẽ tiếp tục khám phá điều này " "trong vài phần tiếp theo. Thực tế quan trọng nhất cần nhớ bây giờ là các " "node tồn tại và có thể được sắp xếp sử dụng theo cách này." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:55 msgid "Scenes" msgstr "Scene (còn gọi là cảnh)" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:59 msgid "" "Now that the concept of nodes has been defined, the next logical step is to " "explain what a Scene is." msgstr "" "Bây giờ khái niệm về các node đã được định nghĩa, bước tiếp theo là logic là " "giải thích một Scene là gì." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:62 msgid "" "A scene is composed of a group of nodes organized hierarchically (in tree " "fashion). Furthermore, a scene:" msgstr "" "Một scene bao gồm một nhóm các node được tổ chức theo thứ bậc (theo kiểu " "cây). Hơn nữa, một scene:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:65 msgid "always has one root node." msgstr "luôn có một node gốc (root node)." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:66 msgid "can be saved to disk and loaded back." msgstr "có thể được lưu vào đĩa và tải lại." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:67 msgid "can be *instanced* (more on that later)." msgstr "có thể *instance* (nhiều hơn về điều đó sau)." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:69 msgid "" "Running a game means running a scene. A project can contain several scenes, " "but for the game to start, one of them must be selected as the main scene." msgstr "" "Chạy một trò chơi có nghĩa là chạy một scene. Một dự án có thể chứa một vài " "scene, nhưng để trò chơi bắt đầu, một trong số chúng phải được chọn làm main " "scene (cảnh chính)." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:72 msgid "" "Basically, the Godot editor is a **scene editor**. It has plenty of tools " "for editing 2D and 3D scenes as well as user interfaces, but the editor is " "based on the concept of editing a scene and the nodes that compose it." msgstr "" "Về cơ bản, trình soạn thảo Godot là **scene editor**. Nó có nhiều công cụ để " "chỉnh sửa scene 2D và 3D cũng như giao diện người dùng, nhưng trình chỉnh " "sửa dựa trên khái niệm chỉnh sửa scene và các node tạo ra nó." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:77 #: ../../docs/getting_started/editor/external_editor.rst:32 #: ../../docs/development/compiling/compiling_with_mono.rst:191 msgid "Editor" msgstr "Editor (trình biên tập)" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:79 msgid "" "Open the project you made in :ref:`doc_intro_to_the_editor_interface`, or " "create a new one. This will open the Godot editor:" msgstr "" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:84 msgid "" "As mentioned before, making games in Godot feels like being in a kitchen, so " "let's open the refrigerator and add some fresh nodes to the project. We'll " "begin with a \"Hello World\" message that we'll put on the screen." msgstr "" "Như đã đề cập trước đây, làm các trò chơi trong Godot có cảm giác như đang ở " "trong bếp, vì vậy hãy mở tủ lạnh và thêm một số node mới vào dự án. Chúng ta " "sẽ bắt đầu với thông báo \"Hello World\" mà chúng ta sẽ đưa lên màn hình." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:89 msgid "" "To do this we need to add a Label node. Press the \"Add Child Node\" button " "at the top left of the scene dock (the icon represents a plus symbol). This " "button is the main way to add new nodes to a scene, and will always add the " "chosen node as a child of the currently selected node (or, in an empty " "scene, as the \"root\" node)." msgstr "" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:97 msgid "" "In an empty scene (without root node), the scene dock shows several options " "to quickly add a root node to the scene. \"2D Scene\" adds a Node2D node, " "\"3D Scene\" adds a Spatial node, \"User Interface\" adds a Control node, " "and \"Custom Node\" which lets you select any node (so it is equivalent to " "pressing the \"Add Child Node\" button). You can also press the star-shaped " "icon to toggle the display of your favorited nodes." msgstr "" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:105 msgid "" "Note that these presets are here for convenience and are not mandatory for " "the different types of scenes. Not every 3D scene needs a Spatial node as " "its root node, likewise not every GUI or 2D scene needs a Control node or " "Node2D as their root node." msgstr "" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:110 msgid "" "Now, to add a label node to this scene you can click on the Custom Node " "button or the Add Node button at the top. In scenes that aren't empty you " "use the add node button to create every child node." msgstr "" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:116 msgid "" "This will open the Create Node dialog, showing the long list of nodes that " "can be created:" msgstr "" "Điều này sẽ mở hộp thoại Create Node, hiển thị danh sách dài các node có thể " "được tạo:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:121 msgid "" "From there, select the \"Label\" node first. Searching for it is probably " "the fastest way:" msgstr "" "Từ đó, chọn node \"Lable\" trước. Tìm kiếm nó có lẽ là cách nhanh nhất:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:126 msgid "And finally, create the Label! A lot happens when Create is pressed:" msgstr "Và cuối cùng, tạo Lable! Rất nhiều điều xảy ra khi nhấn Create:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:130 msgid "" "First of all, the scene changes to the 2D editor (because Label is a 2D Node " "type), and the Label appears, selected, at the top left corner of the " "viewport." msgstr "" "Trước hết, scene thay đổi thành editor 2D (vì label là loại node 2D) và " "label xuất hiện, được chọn, ở góc trên cùng bên trái của cửa sổ viewport." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:133 #, fuzzy msgid "" "The node appears in the scene tree editor in the Scene dock, and the label " "properties appear in the Inspector dock." msgstr "" "Node xuất hiện trong scene tree editor (hộp ở góc trên cùng bên phải) và các " "thuộc tính label xuất hiện trong Inspector (hộp ở góc dưới bên phải)." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:136 msgid "" "The next step will be to change the \"Text\" Property of the label. Let's " "change it to \"Hello World\":" msgstr "" "Bước tiếp theo sẽ là thay đổi Thuộc tính \"Text\" của label. Hãy thay đổi nó " "thành \"Hello World\":" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:141 #, fuzzy msgid "" "Ok, everything's ready to run the scene! Press the PLAY SCENE Button on the " "top bar (or hit :kbd:`F6`):" msgstr "" "Ok, mọi thứ đã sẵn sàng để chạy sceneh! Nhấn nút PLAY SCENE trên thanh trên " "cùng (hoặc nhấn F6):" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:146 msgid "Aaaand... Oops." msgstr "Aaaand ... Rất tiếc." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:150 msgid "" "Scenes need to be saved to be run, so save the scene to something like Hello." "tscn in Scene -> Save:" msgstr "" "Các scene cần được lưu để được chạy, vì vậy hãy lưu scene vào một cái gì đó " "như Hello.tscn trong Scene -> Save:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:155 #, fuzzy msgid "" "And here's when something funny happens. The file dialog is a special file " "dialog, and only allows you to save inside the project. The project root is " "``res://`` which means \"resource path\". This means that files can only be " "saved inside the project. For the future, when doing file operations in " "Godot, remember that ``res://`` is the resource path, and no matter the " "platform or install location, it is the way to locate where resource files " "are from inside the game." msgstr "" "Và đây là khi một cái gì đó buồn cười xảy ra. Hộp thoại chứa file là một hộp " "thoại file đặc biệt và chỉ cho phép bạn lưu bên trong dự án. Dự án gốc là " "\"res: //\" có nghĩa là \"đường dẫn tài nguyên - resource path\". Điều này " "có nghĩa là các file chỉ có thể được lưu trong dự án. Trong tương lai, khi " "thực hiện các thao tác file trong Godot, hãy nhớ rằng \"res: //\" là đường " "dẫn tài nguyên và bất kể nền tảng hoặc vị trí cài đặt, đó là cách để xác " "định vị trí các tệp tài nguyên từ bên trong trò chơi." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:163 msgid "" "After saving the scene and pressing run scene again, the \"Hello World\" " "demo should finally execute:" msgstr "" "Sau khi lưu scene và nhấn lại run scene, bản demo \"Hello World\" cuối cùng " "sẽ thực hiện:" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:168 msgid "Success!" msgstr "Thành công!" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:172 msgid "" "If this doesn't immediately work and you have a hiDPI display on at least " "one of your monitors, go to **Project → Project Settings → Display → " "Window** then enable **Allow Hidpi** under **Dpi**." msgstr "" "Nếu điều này không hoạt động ngay lập tức và bạn có màn hình hiDPI trên ít " "nhất một màn hình của mình, hãy truy cập **Project → Project Settings → " "Display → Window** then enable **Allow Hidpi** under **Dpi**." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:180 #, fuzzy msgid "Configuring the project" msgstr "Cấu hình dự án" #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:182 msgid "" "Ok, it's time to configure the project. Right now, the only way to run " "something is to execute the current scene. Projects, however, may have " "several scenes, so one of them must be set as the main scene. This is the " "scene that will be loaded any time the project is run." msgstr "" "Ok, đã đến lúc chỉnh cấu hình dự án. Ngay bây giờ, cách duy nhất để chạy một " "cái gì đó là thực hiện scena hiện tại. Các dự án, tuy nhiên, có thể có một " "vài scene, vì vậy một trong số chúng phải được đặt làm main scene. Đây là " "scene sẽ được tải bất cứ khi nào dự án được chạy." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:187 msgid "" "These settings are all stored in a project.godot file, which is a plaintext " "file in win.ini format (for easy editing). There are dozens of settings that " "you can change in this file to alter how a project executes. To simplify " "this process, Godot provides a project settings dialog, which acts as a sort " "of frontend to editing a project.godot file." msgstr "" "Các cài đặt này đều được lưu trữ trong file project.godot, đây là file văn " "bản gốc ở định dạng win.ini (để chỉnh sửa dễ dàng). Có hàng tá cài đặt mà " "bạn có thể thay đổi trong file này để thay đổi cách thực hiện dự án. Để đơn " "giản hóa quá trình này, Godot cung cấp hộp thoại cài đặt dự án, hoạt động " "như một loại lối vào để chỉnh sửa file project.godot." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:193 #, fuzzy msgid "To access that dialog, select Project -> Project Settings. Try it now." msgstr "" "Để truy cập hộp thoại đó, chọn Project -> Project Settings. Thử ngay bây giờ." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:195 msgid "" "Once the window opens, let's select a main scene. Locate the `Application/" "Run/Main Scene` property and click on it to select 'Hello.tscn'." msgstr "" "Khi cửa sổ mở, hãy chọn một main scene. Xác định vị trí thuộc tính " "`Application / Run / Main Scene` và nhấp vào nó để chọn 'Hello.tscn'." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:200 msgid "" "Now, with this change, when you press the regular Play button (or F5), this " "scene will run, no matter which scene is actively being edited." msgstr "" "Bây giờ, với thay đổi này, khi bạn nhấn nút Play thông thường (hoặc F5), " "scene này sẽ chạy, bất kể scene nào đang được tích cực chỉnh sửa." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:203 msgid "" "The project settings dialog provides a lot of options that can be saved to a " "project.godot file and shows their default values. If you change a value, a " "tick is marked to the left of its name. This means that the property will be " "saved to the project.godot file and remembered." msgstr "" "Hộp thoại project settings cung cấp rất nhiều tùy chọn có thể được lưu vào " "file project.godot và hiển thị các giá trị mặc định của chúng. Nếu bạn thay " "đổi một giá trị, một đánh dấu được đánh dấu bên trái tên của nó. Điều này có " "nghĩa là thuộc tính sẽ được lưu vào tệp project.godot và ghi nhớ." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:208 #, fuzzy msgid "" "As a side note, it is also possible to add custom configuration options and " "read them in at run-time using the :ref:`ProjectSettings " "` singleton." msgstr "" "Là một lưu ý phụ, cũng có thể thêm các tùy chọn cấu hình tùy chỉnh và đọc " "chúng trong thời gian chạy bằng cách sử dụng: ref: `ProjectSinstall " "` singleton." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:212 msgid "To be continued..." msgstr "Còn tiếp..." #: ../../docs/getting_started/step_by_step/scenes_and_nodes.rst:214 msgid "" "This tutorial talked about \"scenes and nodes\", but so far there has been " "only *one* scene and *one* node! Don't worry, the next tutorial will expand " "on that..." msgstr "" "Hướng dẫn này nói về \"scene và node\", nhưng cho đến nay chỉ có duy nhất * " "một * scene và * một * node ! Đừng lo lắng, hướng dẫn tiếp theo sẽ mở rộng " "về điều đó ..." #: ../../docs/getting_started/step_by_step/instancing.rst:4 msgid "Instancing" msgstr "Instance (thực thể)" #: ../../docs/getting_started/step_by_step/instancing.rst:9 msgid "" "Creating a single scene and adding nodes into it might work for small " "projects, but as a project grows in size and complexity, the number of nodes " "can quickly become unmanageable. To address this, Godot allows a project to " "be separated into any number of scenes. This provides you with a powerful " "tool that helps you organize the different components of your game." msgstr "" "Tạo một scene đơn lẻ và thêm các node vào nó có thể hoạt động cho các dự án " "nhỏ, nhưng khi một dự án tăng kích thước và độ phức tạp, số lượng node có " "thể nhanh chóng trở nên không thể quản lý được. Để giải quyết vấn đề này, " "Godot cho phép tách một dự án thành bất kỳ nhiều scene . Điều này cung cấp " "cho bạn một công cụ mạnh mẽ giúp bạn sắp xếp các thành phần khác nhau trong " "trò chơi của bạn." #: ../../docs/getting_started/step_by_step/instancing.rst:15 msgid "" "In :ref:`doc_scenes_and_nodes` you learned that a scene is a collection of " "nodes organized in a tree structure, with a single node as the tree root." msgstr "" "Trong: ref: `doc_scene_and_node` bạn đã học được rằng một scene là một tập " "hợp các node được tổ chức trong cấu trúc tree, với một node là gốc cây (tree " "root)." #: ../../docs/getting_started/step_by_step/instancing.rst:20 msgid "" "You can create as many scenes as you like and save them to disk. Scenes " "saved in this manner are called \"Packed Scenes\" and have a ``.tscn`` " "filename extension." msgstr "" "Bạn có thể tạo bao nhiêu scene tùy thích và lưu chúng vào ổ. Các scene được " "lưu theo cách này được gọi là \"Packed Scenes\" (cảnh đã được đóng gói) và " "có phần mở rộng tên tệp `` .tscn``." #: ../../docs/getting_started/step_by_step/instancing.rst:26 msgid "" "Once a scene has been saved, it can be instanced into another scene as if it " "were any other node." msgstr "" "Khi một scene đã được lưu, nó có thể được chuyển sang một scene khác như thể " "đó là bất kỳ node nào khác." #: ../../docs/getting_started/step_by_step/instancing.rst:31 msgid "In the above picture, Scene B was added to Scene A as an instance." msgstr "" "Trong hình trên, Cảnh B được thêm vào Cảnh A như một instance (thực thể)." #: ../../docs/getting_started/step_by_step/instancing.rst:34 msgid "Instancing by example" msgstr "Ví dụ về instance" #: ../../docs/getting_started/step_by_step/instancing.rst:36 msgid "" "To learn how instancing works, let's start by downloading a sample project: :" "download:`instancing.zip `." msgstr "" "Để tìm hiểu cách hoạt động của instance, hãy bắt đầu bằng cách tải xuống một " "dự án mẫu :: download: `instance.zip `." #: ../../docs/getting_started/step_by_step/instancing.rst:39 msgid "" "Unzip this project anywhere you like. Then open Godot and add this project " "to the project manager using the 'Import' button:" msgstr "" "Giải nén dự án này bất cứ nơi nào bạn muốn. Sau đó mở Godot và thêm dự án " "này vào project manager bằng nút 'Import':" #: ../../docs/getting_started/step_by_step/instancing.rst:44 msgid "" "Browse to the folder you extracted and open the \"project.godot\" file you " "can find inside it. After doing this, the new project will appear on the " "list of projects. Edit the project by pressing the 'Edit' button." msgstr "" "Duyệt đến thư mục bạn đã trích xuất và mở tệp \"project.godot\" mà bạn có " "thể tìm thấy bên trong nó. Sau khi làm điều này, dự án mới sẽ xuất hiện " "trong danh sách các dự án (list of projects). Chỉnh sửa dự án bằng cách nhấn " "nút 'Edit'." #: ../../docs/getting_started/step_by_step/instancing.rst:48 msgid "" "This project contains two scenes: \"Ball.tscn\" and \"Main.tscn\". The ball " "scene uses a :ref:`RigidBody2D ` to provide physics " "behavior while the main scene has a set of obstacles for the ball to collide " "with (using :ref:`StaticBody2D `)." msgstr "" "Dự án này chứa hai scene: \"Ball. tscn\" và \"Main. tscn\". Ball scene sử " "dụng một: Ref: ' RigidBody2D < class_RigidBody2D > ' để cung cấp hành vi vật " "lý (physics behavior) trong khi main scene có một tập hợp các chướng ngại " "vật (obstacle) cho bóng để va chạm (collide) với (sử dụng: Ref: ' " "StaticBody2D < class_StaticBody2D > ')." #: ../../docs/getting_started/step_by_step/instancing.rst:57 msgid "Open the ``Main`` scene, and then select the root node:" msgstr "Mở `` Main`` scene, rồi chọn node gốc:" #: ../../docs/getting_started/step_by_step/instancing.rst:61 msgid "" "We want to add an instance of the ``Ball`` scene as a child of ``Main``. " "Click the \"link\"-shaped button (its hover-text says \"Instance a scene " "file as a Node.\") and select the ``Ball.tscn`` file." msgstr "" "Chúng tôi muốn thêm một instance của `` Ball`` scene khi còn là một con của " "`` Main``. Nhấp vào nút hình \"liên kết\" (văn bản ghi chú của nó có nội " "dung \"Instance a scene file as a Node.\") Và chọn file `` Ball.tscn``." #: ../../docs/getting_started/step_by_step/instancing.rst:67 msgid "" "The ball will be placed at the top-left corner of the screen area (this is " "``(0, 0)`` in screen coordinates). Click and drag the ball somewhere near " "the top-center of the scene:" msgstr "" "Quả bóng sẽ được đặt ở góc trên cùng bên trái của khu vực màn hình (đây là " "`` (0, 0) `` trong tọa độ màn hình). Nhấp và kéo quả bóng ở đâu đó gần trung " "tâm trên cùng của scene:" #: ../../docs/getting_started/step_by_step/instancing.rst:73 msgid "Press \"Play\" and watch the ball fall to the bottom of the screen:" msgstr "Nhấn \"Play\" và xem bóng rơi xuống dưới màn hình:" #: ../../docs/getting_started/step_by_step/instancing.rst:78 msgid "Multiple instances" msgstr "Nhiều instance" #: ../../docs/getting_started/step_by_step/instancing.rst:80 #, fuzzy msgid "" "You can add as many instances as you like to a scene, either by using the " "\"Instance\" button again, or by clicking on the ball instance and pressing :" "kbd:`Ctrl + D` (:kbd:`Cmd + D` on macOS) to duplicate it:" msgstr "" "Bạn có thể thêm bao nhiêu instance tùy thích vào một scene, bằng cách sử " "dụng lại nút \"Instance\" hoặc bằng cách nhấp vào ball instance và nhấn " "\"Duplicate\" (Nhân đôi) (Ctrl-D):" #: ../../docs/getting_started/step_by_step/instancing.rst:86 msgid "Run the scene again and all of the balls will fall." msgstr "Chạy lại scene và tất cả các quả bóng sẽ rơi xuống." #: ../../docs/getting_started/step_by_step/instancing.rst:91 msgid "Editing instances" msgstr "Chỉnh sửa instance" #: ../../docs/getting_started/step_by_step/instancing.rst:93 #, fuzzy msgid "" "Open the ``Ball`` scene and add a ``PhysicsMaterial`` by opening the " "\"Physics Material Override\" dropdown in the Inspector dock and selecting " "\"New PhysicsMaterial\"." msgstr "" "Mở `` Ball`` scene và thêm `` PhysicsMaterial ' (thêm vật liệu vật lý) bằng " "cách nhấp vào mũi tên xuống và chọn \"New PhysicsMaterial\"." #: ../../docs/getting_started/step_by_step/instancing.rst:99 msgid "" "Then, expand the material by clicking on it, and set the ``Bounce`` property " "to ``1``." msgstr "" "Sau đó, mở rộng material (vật liệu) bằng cách nhấp vào nó và đặt thuộc tính " "`` Bounce`` thành` `1``." #: ../../docs/getting_started/step_by_step/instancing.rst:104 msgid "" "Press \"Play\" and notice that all of the instanced balls are now much more " "bouncy. Because the instanced balls are based on the saved scene, changes to " "that scene will affect all instances." msgstr "" "Nhấn \"Play\" và nhận thấy rằng tất cả các quả bóng được instance bây giờ " "nảy hơn nhiều. Vì các quả bóng được điều khiển dựa trên scene đã lưu, nên " "các thay đổi đối với scene đó sẽ ảnh hưởng đến tất cả các trường hợp." #: ../../docs/getting_started/step_by_step/instancing.rst:108 msgid "" "You can also adjust individual instances. Set the bounce value back to ``0`` " "and then in the ``Main`` scene, select one of the instanced balls. Resources " "like ``PhysicsMaterial`` are shared between instances by default, so we need " "to make it unique. Click on the down arrow and select \"Make Unique\". Set " "its ``Bounce`` to ``1`` and press \"Play\"." msgstr "" "Bạn cũng có thể điều chỉnh các instance riêng lẻ. Đặt giá trị Bounce trở lại " "`` 0`` và sau đó trong `` Main`` scene, chọn một trong những quả bóng được " "instance. Các tài nguyên như `` PhysicsMaterial`` được chia sẻ giữa các " "instance theo mặc định, vì vậy chúng ta cần làm cho nó trở nên độc nhất duy " "nhất. Nhấp vào mũi tên xuống và chọn \"Make Unique\". Đặt `` Bounce`` thành " "`` 1`` và nhấn \"Play\"." #: ../../docs/getting_started/step_by_step/instancing.rst:116 msgid "" "Notice that a grey \"revert\" button appears next to the adjusted property. " "When this button is present, it means you modified a property in the " "instanced scene to override its value in the saved scene. Even if that " "property is modified in the original scene, the custom value will remain. " "Pressing the revert button will restore the property to the value in the " "saved scene." msgstr "" "Lưu ý rằng nút \"revert\" (trở lại) màu xám xuất hiện bên cạnh thuộc tính " "được điều chỉnh. Khi có nút này, điều đó có nghĩa là bạn đã sửa đổi một " "thuộc tính trong cảnh được kích hoạt để ghi đè giá trị của nó trong scene đã " "lưu. Ngay cả khi thuộc tính đó được sửa đổi trong cảnh ban đầu, giá trị tùy " "chỉnh sẽ vẫn còn. Nhấn nút revert sẽ khôi phục thuộc tính về giá trị trong " "cảnh đã lưu." #: ../../docs/getting_started/step_by_step/instancing.rst:124 #: ../../docs/getting_started/step_by_step/signals.rst:276 #: ../../docs/getting_started/workflow/best_practices/scenes_versus_scripts.rst:151 #: ../../docs/tutorials/shading/your_first_shader/your_first_canvasitem_shader.rst:214 msgid "Conclusion" msgstr "Kết luận" #: ../../docs/getting_started/step_by_step/instancing.rst:126 msgid "" "Instancing can be useful when you want to create many copies of the same " "object. It is also possible to create instances in code by using GDScript, " "see :ref:`doc_instancing_continued`." msgstr "" "Instance có thể hữu ích khi bạn muốn tạo nhiều bản sao của cùng một đối " "tượng. Cũng có thể tạo các instance trong code (mã) bằng cách sử dụng " "GDScript, xem: ref: `doc_instANCE_continued`." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:4 msgid "Instancing (continued)" msgstr "Instance (tiếp theo)" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:7 #, fuzzy msgid "Recap" msgstr "Tóm tắt" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:9 msgid "Instancing has many handy uses. At a glance, with instancing you have:" msgstr "" "Instance có nhiều công dụng tiện dụng. Trong nháy mắt, với instance bạn có:" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:11 msgid "The ability to subdivide scenes and make them easier to manage." msgstr "Khả năng chia nhỏ các scene và làm cho chúng dễ quản lý hơn." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:12 msgid "A tool to manage and edit multiple node instances at once." msgstr "Một công cụ để quản lý và chỉnh sửa nhiều instance node cùng một lúc." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:13 msgid "" "A way to organize and embed complex game flows or even UIs (in Godot, UI " "Elements are nodes, too)." msgstr "" "Một cách để tổ chức và nhúng các phần trò chơi phức tạp hoặc thậm chí các UI " "(trong Godot, thành phần UI cũng là các node)." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:17 #, fuzzy msgid "Design language" msgstr "Ngôn ngữ thiết kế" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:19 msgid "" "But the greatest strength that comes with instancing scenes is that it works " "as an excellent design language. This distinguishes Godot from all the other " "engines out there. Godot was designed from the ground up around this concept." msgstr "" "Nhưng sức mạnh lớn nhất đi kèm với các instance scene là nó hoạt động như " "một ngôn ngữ thiết kế tuyệt vời. Điều này phân biệt Godot với tất cả các " "engine khác ngoài kia. Godot được thiết kế từ mặt đất xung quanh khái niệm " "này." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:24 msgid "" "When making games with Godot, the recommended approach is to dismiss most " "common design patterns, such as MVC or Entity-Relationship diagrams, and " "instead think about your scenes in a more natural way. Start by imagining " "the visible elements in your game, the ones that can be named not just by a " "programmer, but by anyone." msgstr "" "Khi làm trò chơi với Godot, cách tiếp cận được đề xuất là loại bỏ hầu hết " "các mẫu thiết kế phổ biến, chẳng hạn như sơ đồ MVC hoặc sơ đồ Entity-" "Relationship diagrams, và thay vào đó hãy nghĩ về các scene của bạn theo " "cách tự nhiên hơn. Bắt đầu bằng cách tưởng tượng các yếu tố có thể nhìn thấy " "trong trò chơi của bạn, những yếu tố có thể được đặt tên không chỉ bởi một " "lập trình viên, mà bởi bất kỳ ai." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:30 #, fuzzy msgid "For example, here's how a simple shooter game could be imagined:" msgstr "" "Ví dụ, đây là cách một trò chơi bắn súng đơn giản có thể được tưởng tượng:" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:34 #, fuzzy msgid "" "You can come up with a diagram like this for almost any kind of game. Write " "down the parts of the game that you can visualize, and then add arrows to " "represent ownership of one component by another." msgstr "" "Bạn có thể đưa ra một sơ đồ như thế này cho hầu hết mọi loại trò chơi. Viết " "xuống các phần của trò chơi mà bạn có thể hình dung, sau đó thêm mũi tên để " "thể hiện quyền sở hữu của một thành phần khác." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:38 msgid "" "Once you have a diagram like this, the recommended process for making a game " "is to create a scene for each element listed in the diagram. You'll use " "instancing (either by code or directly in the editor) for the ownership " "relationships." msgstr "" "Khi bạn có một sơ đồ như thế này, quy trình được đề xuất để tạo trò chơi là " "tạo scene cho từng thành phần được liệt kê trong sơ đồ. Bạn sẽ sử dụng " "instance (bằng code hoặc trực tiếp trong editor - trình chỉnh sửa) cho các " "mối quan hệ sở hữu." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:42 msgid "" "A lot of time spent in programming games (or software in general) is on " "designing an architecture and fitting game components to that architecture. " "Designing based on scenes replaces that approach and makes development much " "faster and more straightforward, allowing you to concentrate on the game " "logic itself. Because most game components map directly to a scene, using a " "design based on scene instantiation means little other architectural code is " "needed." msgstr "" "Rất nhiều thời gian dành cho các trò chơi lập trình (hoặc phần mềm nói " "chung) là dành cho việc thiết kế một kiến trúc và các thành phần trò chơi " "phù hợp với kiến trúc đó. Thiết kế dựa trên các scene thay thế cách tiếp cận " "đó và làm cho sự phát triển nhanh hơn và đơn giản hơn, cho phép bạn tập " "trung vào logic trò chơi. Bởi vì hầu hết các thành phần trò chơi ánh xạ trực " "tiếp đến một scene, sử dụng thiết kế dựa trên khởi tạo scene có nghĩa là cần " "ít những kiến trúc khác." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:48 #, fuzzy msgid "" "Let's take a look at one more, somewhat more complex, example of an open-" "world type game with lots of assets and nested elements:" msgstr "" "Chúng ta hãy xem xét thêm một ví dụ, hơi phức tạp hơn, ví dụ về một trò chơi " "kiểu thế giới mở với nhiều tài sản và các yếu tố lồng nhau:" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:53 msgid "" "Take a look at the room element. Let's say we started there. We could make a " "couple of different room scenes, with different arrangements of furniture " "(also scenes) in them. Later, we could make a house scene, connecting rooms " "to make up its interior." msgstr "" "Hãy nhìn vào yếu tố của căn phòng. Hãy nói rằng chúng ta đã bắt đầu ở đó. " "Chúng tôi có thể tạo ra một vài scene căn phòng khác nhau, với sự sắp xếp " "khác nhau của đồ nội thất (cũng là cảnh) trong đó. Sau đó, chúng tôi có thể " "làm một scene nhà, kết nối các phòng để tạo nên nội thất của nó." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:58 msgid "" "Then, we could make a citadel scene, which is made out of many instanced " "houses. Then, we could start working on the world map terrain, adding the " "citadel onto it." msgstr "" "Sau đó, chúng ta có thể tạo nên một khung cảnh thành cổ (citadel), được tạo " "nên từ nhiều ngôi nhà có instance. Sau đó, chúng ta có thể bắt đầu làm việc " "trên địa hình bản đồ thế giới (world map terrain), và thêm tòa thành " "(citadel) vào đó." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:62 msgid "" "Later, we could create scenes that represent guards (and other NPCs) and add " "them to the citadel as well. As a result, they would be indirectly added to " "the overall game world." msgstr "" "Sau đó, chúng ta có thể tạo ra các scene đại diện cho lính canh (guard) (và " "các NPC khác) và thêm chúng vào thành cổ. Kết quả là, họ sẽ được gián tiếp " "thêm vào tổng thể trò chơi thế giới." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:66 msgid "" "With Godot, it's easy to iterate on your game like this, as all you need to " "do is create and instance more scenes. Furthermore, the editor UI is " "designed to be user friendly for programmers and non-programmers alike. A " "typical team development process can involve 2D or 3D artists, level " "designers, game designers, and animators, all working with the editor " "interface." msgstr "" "Với Godot, thật dễ dàng để lặp lại trò chơi của bạn như thế này, vì tất cả " "những gì bạn cần làm là tạo và ví dụ nhiều scene hơn. Hơn nữa, UI editor " "được thiết kế thân thiện với người dùng cho cả lập trình viên và người không " "lập trình. Một quy trình phát triển nhóm điển hình có thể có sự tham gia của " "các nghệ sĩ 2D hoặc 3D, nhà thiết kế cấp độ, nhà thiết kế trò chơi và nhà " "làm phim hoạt hình, tất cả đều làm việc với giao diện editor." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:73 #, fuzzy msgid "Information overload!" msgstr "Quá tải thông tin!" #: ../../docs/getting_started/step_by_step/instancing_continued.rst:75 msgid "" "This has been a lot of high level information dropped on you all at once. " "However, the important part of this tutorial was to create an awareness of " "how scenes and instancing are used in real projects." msgstr "" "Rất nhiều thông tin cấp cao, khó rơi vào bạn tất cả cùng một lúc. Tuy nhiên, " "phần quan trọng của hướng dẫn này là tạo ra nhận thức về cách các scene và " "instance được sử dụng trong các dự án thực tế." #: ../../docs/getting_started/step_by_step/instancing_continued.rst:79 #, fuzzy msgid "" "Everything discussed here will become second nature to you once you start " "making games and putting these concepts into practice. For now, don't worry " "about it too much, and go on to the next tutorial!" msgstr "" "Mọi thứ được thảo luận ở đây sẽ trở thành bản chất thứ hai đối với bạn một " "khi bạn bắt đầu làm game và đưa những khái niệm này vào thực tế. Ngay bây " "giờ, đừng lo lắng về nó quá nhiều, và đi đến hướng dẫn tiếp theo!" #: ../../docs/getting_started/step_by_step/scripting.rst:9 msgid "" "Before Godot 3.0, the only choice for scripting a game was to use :ref:" "`GDScript`. Nowadays, Godot has four (yes, four!) official " "languages and the ability to add extra scripting languages dynamically!" msgstr "" "Trước Godot 3.0, lựa chọn duy nhất để viết (script) kịch bản cho một trò " "chơi là sử dụng: ref: `GDScript `. Ngày nay, Godot có bốn ngôn " "ngữ chính thức (vâng, bốn!) Và khả năng thêm ngôn ngữ kịch bản bổ sung một " "cách linh hoạt!" #: ../../docs/getting_started/step_by_step/scripting.rst:13 #, fuzzy msgid "" "This is great, mostly due to the large amount of flexibility provided, but " "it also makes our work supporting languages more difficult." msgstr "" "Điều này thật tuyệt, chủ yếu là do số lượng lớn tính linh hoạt được cung " "cấp, nhưng nó cũng làm cho công việc hỗ trợ ngôn ngữ của chúng tôi trở nên " "khó khăn hơn." #: ../../docs/getting_started/step_by_step/scripting.rst:16 msgid "" "The \"main\" languages in Godot, though, are GDScript and VisualScript. The " "main reason to choose them is their level of integration with Godot, as this " "makes the experience smoother; both have slick editor integration, while C# " "and C++ need to be edited in a separate IDE. If you are a big fan of " "statically typed languages, go with C# and C++ instead." msgstr "" "Tuy nhiên, ngôn ngữ \"chính\" trong Godot là GDScript và VisualScript. Lý do " "chính để chọn chúng là mức độ tích hợp của chúng với Godot, vì điều này làm " "cho trải nghiệm mượt mà hơn; cả hai đều có tích hợp trình soạn thảo khéo " "léo, trong khi C # và C ++ cần được chỉnh sửa trong một IDE riêng. Nếu bạn " "là một fan hâm mộ lớn của các ngôn ngữ tĩnh, thay vào đó hãy sử dụng C # và " "C ++." #: ../../docs/getting_started/step_by_step/scripting.rst:22 #: ../../docs/getting_started/scripting/gdscript/index.rst:2 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:30 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:59 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:199 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:214 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:226 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:237 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:245 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:260 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:272 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:329 #: ../../docs/tutorials/debug/overview_of_debugging_tools.rst:101 #, fuzzy msgid "GDScript" msgstr "GDScript" #: ../../docs/getting_started/step_by_step/scripting.rst:24 #, fuzzy msgid "" ":ref:`GDScript` is, as mentioned above, the main language used " "in Godot. Using it has some positive points compared to other languages due " "to its high integration with Godot:" msgstr "" ": ref: `GDScript `, như đã đề cập ở trên, ngôn ngữ chính được " "sử dụng trong Godot. Sử dụng nó có một số điểm tích cực so với các ngôn ngữ " "khác do tích hợp cao với Godot:" #: ../../docs/getting_started/step_by_step/scripting.rst:28 #, fuzzy msgid "" "It's simple, elegant, and designed to be familiar for users of other " "languages such as Lua, Python, Squirrel, etc." msgstr "" "Nó đơn giản, thanh lịch và được thiết kế quen thuộc với người dùng các ngôn " "ngữ khác như Lua, Python, Squirrel, v.v." #: ../../docs/getting_started/step_by_step/scripting.rst:29 #, fuzzy msgid "Loads and compiles blazingly fast." msgstr "Tải và biên dịch nhanh chóng." #: ../../docs/getting_started/step_by_step/scripting.rst:30 msgid "" "The editor integration is a pleasure to work with, with code completion for " "nodes, signals, and many other items pertaining to the scene being edited." msgstr "" "Tích hợp trình chỉnh sửa là một niềm vui để làm việc, với việc hoàn thành mã " "cho các node, signal (tín hiệu ) và nhiều mục khác liên quan đến scene đang " "được chỉnh sửa." #: ../../docs/getting_started/step_by_step/scripting.rst:31 #, fuzzy msgid "" "Has vector types built-in (such as Vectors, transforms, etc.), making it " "efficient for heavy use of linear algebra." msgstr "" "Có các loại vectơ tích hợp (như vectơ, biến đổi, v.v.), làm cho nó hiệu quả " "khi sử dụng nhiều đại số tuyến tính." #: ../../docs/getting_started/step_by_step/scripting.rst:32 msgid "" "Supports multiple threads as efficiently as statically typed languages - one " "of the limitations that made us avoid VMs such as Lua, Squirrel, etc." msgstr "" "Hỗ trợ nhiều luồng hiệu quả như các ngôn ngữ được nhập tĩnh - một trong " "những hạn chế khiến chúng tôi tránh các VMs như Lua, Squirrel, v.v." #: ../../docs/getting_started/step_by_step/scripting.rst:33 #, fuzzy msgid "" "Uses no garbage collector, so it trades a small bit of automation (most " "objects are reference counted anyway), by determinism." msgstr "" "Sử dụng không có trình thu gom rác, do đó, nó giao dịch một chút tự động hóa " "(hầu hết các đối tượng đều được tham chiếu tính theo cách nào), theo tính " "xác định." #: ../../docs/getting_started/step_by_step/scripting.rst:34 msgid "" "Its dynamic nature makes it easy to optimize sections of code in C++ (via " "GDNative) if more performance is required, all without recompiling the " "engine." msgstr "" "Bản chất động của nó giúp dễ dàng tối ưu hóa các phần mã trong C ++ (thông " "qua GDNative) nếu cần nhiều hiệu suất hơn, tất cả mà không cần biên dịch lại " "engine." #: ../../docs/getting_started/step_by_step/scripting.rst:36 #, fuzzy msgid "" "If you're undecided and have experience with programming, especially " "dynamically typed languages, go for GDScript!" msgstr "" "Nếu bạn chưa quyết định và có kinh nghiệm về lập trình, đặc biệt là các ngôn " "ngữ được nhập động, hãy truy cập GDScript!" #: ../../docs/getting_started/step_by_step/scripting.rst:40 #: ../../docs/getting_started/scripting/visual_script/index.rst:2 msgid "VisualScript" msgstr "VisualScript" #: ../../docs/getting_started/step_by_step/scripting.rst:42 #, fuzzy msgid "" "Beginning with 3.0, Godot offers :ref:`Visual " "Scripting`. This is a typical implementation of a " "\"blocks and connections\" language, but adapted to how Godot works." msgstr "" "Bắt đầu với 3.0, Godot cung cấp: ref: `Visual Scripting " "`. Đây là cách triển khai điển hình của ngôn ngữ " "\"khối và kết nối\", nhưng thích nghi với cách thức hoạt động của Godot." #: ../../docs/getting_started/step_by_step/scripting.rst:46 msgid "" "Visual scripting is a great tool for non-programmers, or even for " "experienced developers who want to make parts of the code more accessible to " "others, like game designers or artists." msgstr "" "Visual script là một công cụ tuyệt vời cho những người không chuyên lập " "trình, hoặc thậm chí cho các nhà phát triển có kinh nghiệm muốn làm cho các " "phần của mã dễ tiếp cận hơn với những người khác, như các nhà thiết kế trò " "chơi hoặc nghệ sĩ." #: ../../docs/getting_started/step_by_step/scripting.rst:50 #, fuzzy msgid "" "It can also be used by programmers to build state machines or custom visual " "node workflows - for example, a dialogue system." msgstr "" "Nó cũng có thể được sử dụng bởi các lập trình viên để xây dựng các máy trạng " "thái hoặc quy trình làm việc của nút trực quan tùy chỉnh - ví dụ: một hệ " "thống đối thoại." #: ../../docs/getting_started/step_by_step/scripting.rst:55 msgid ".NET / C#" msgstr ".NET / C #" #: ../../docs/getting_started/step_by_step/scripting.rst:57 #, fuzzy msgid "" "As Microsoft's C# is a favorite amongst game developers, we have added " "official support for it. C# is a mature language with tons of code written " "for it, and support was added thanks to a generous donation from Microsoft." msgstr "" "Vì C # của Microsoft được các nhà phát triển trò chơi yêu thích, chúng tôi " "đã thêm hỗ trợ chính thức cho nó. C # là một ngôn ngữ trưởng thành với hàng " "tấn mã được viết cho nó và hỗ trợ đã được thêm vào nhờ vào sự đóng góp hào " "phóng từ Microsoft." #: ../../docs/getting_started/step_by_step/scripting.rst:62 msgid "" "It has an excellent tradeoff between performance and ease of use, although " "one must be aware of its garbage collector." msgstr "" "Nó có một sự đánh đổi tuyệt vời giữa hiệu suất và dễ sử dụng, mặc dù người " "ta phải nhận thức được công cụ thu gom rác của nó." #: ../../docs/getting_started/step_by_step/scripting.rst:65 #, fuzzy msgid "" "Since Godot uses the `Mono `_ .NET runtime, in " "theory any third-party .NET library or framework can be used for scripting " "in Godot, as well as any Common Language Infrastructure-compliant " "programming language, such as F#, Boo or ClojureCLR. In practice however, C# " "is the only officially supported .NET option." msgstr "" "Vì Godot sử dụng `Mono ` _ .NET runtime, theo lý " "thuyết, mọi thư viện hoặc khung .NET của bên thứ ba đều có thể được sử dụng " "để viết kịch bản trong Godot, cũng như bất kỳ Cơ sở hạ tầng ngôn ngữ chung " "nào- ngôn ngữ lập trình tuân thủ, chẳng hạn như F #, Boo hoặc ClojureCLR. " "Tuy nhiên, trên thực tế, C # là tùy chọn .NET được hỗ trợ chính thức duy " "nhất." #: ../../docs/getting_started/step_by_step/scripting.rst:71 msgid "GDNative / C++" msgstr "GDNative / C ++" #: ../../docs/getting_started/step_by_step/scripting.rst:73 #, fuzzy msgid "" "Finally, one of our brightest additions for the 3.0 release: GDNative allows " "scripting in C++ without needing to recompile (or even restart) Godot." msgstr "" "Cuối cùng, một trong những bổ sung sáng giá nhất của chúng tôi cho phiên bản " "3.0: GDNative cho phép tạo kịch bản trong C ++ mà không cần phải biên dịch " "lại (hoặc thậm chí khởi động lại) Godot." #: ../../docs/getting_started/step_by_step/scripting.rst:77 #, fuzzy msgid "" "Any C++ version can be used, and mixing compiler brands and versions for the " "generated shared libraries works perfectly, thanks to our use of an internal " "C API Bridge." msgstr "" "Bất kỳ phiên bản C ++ nào cũng có thể được sử dụng và trộn các thương hiệu " "và phiên bản trình biên dịch cho các thư viện chia sẻ được tạo ra hoạt động " "hoàn hảo, nhờ vào việc chúng tôi sử dụng Cầu API C nội bộ." #: ../../docs/getting_started/step_by_step/scripting.rst:81 #, fuzzy msgid "" "This language is the best choice for performance and does not need to be " "used throughout an entire game, as other parts can be written in GDScript or " "Visual Script. However, the API is clear and easy to use as it resembles, " "mostly, Godot's actual C++ API." msgstr "" "Ngôn ngữ này là lựa chọn tốt nhất cho hiệu suất và không cần sử dụng trong " "toàn bộ trò chơi, vì các phần khác có thể được viết bằng GDScript hoặc " "Visual Script. Tuy nhiên, API rõ ràng và dễ sử dụng vì nó giống với API C ++ " "thực tế của Godot." #: ../../docs/getting_started/step_by_step/scripting.rst:86 #, fuzzy msgid "" "More languages can be made available through the GDNative interface, but " "keep in mind we don't have official support for them." msgstr "" "Nhiều ngôn ngữ có thể được cung cấp qua giao diện GDNative, nhưng hãy nhớ " "rằng chúng tôi không có hỗ trợ chính thức cho chúng." #: ../../docs/getting_started/step_by_step/scripting.rst:90 msgid "Scripting a scene" msgstr "Script một scene" #: ../../docs/getting_started/step_by_step/scripting.rst:92 msgid "" "For the rest of this tutorial we'll set up a GUI scene consisting of a " "button and a label, where pressing the button will update the label. This " "will demonstrate:" msgstr "" "Đối với phần còn lại của hướng dẫn này, chúng tôi sẽ thiết lập một cảnh GUI " "bao gồm một nút và label, trong đó nhấn nút sẽ cập nhật label. Điều này sẽ " "chứng minh:" #: ../../docs/getting_started/step_by_step/scripting.rst:96 msgid "Writing a script and attaching it to a node." msgstr "Viết một script (kịch bản) và gắn nó vào một node." #: ../../docs/getting_started/step_by_step/scripting.rst:97 msgid "Hooking up UI elements via signals." msgstr "Kết nối các yếu tố UI thông qua các signal (tín hiệu)." #: ../../docs/getting_started/step_by_step/scripting.rst:98 msgid "Writing a script that can access other nodes in the scene." msgstr "Viết một script có thể truy cập các node khác trong scene." #: ../../docs/getting_started/step_by_step/scripting.rst:100 #, fuzzy msgid "" "Before continuing, please make sure to read the :ref:" "`GDScript` reference. It's a language designed to be simple, " "and the reference is short, so it will not take more than a few minutes to " "get an overview of the concepts." msgstr "" "Trước khi tiếp tục, vui lòng đảm bảo đọc: ref: `GDScript `. Đó " "là một ngôn ngữ được thiết kế đơn giản và tài liệu tham khảo ngắn, vì vậy sẽ " "không mất hơn vài phút để có cái nhìn tổng quan về các khái niệm." #: ../../docs/getting_started/step_by_step/scripting.rst:105 #: ../../docs/tutorials/physics/kinematic_character_2d.rst:79 #: ../../docs/tutorials/animation/introduction_2d.rst:109 msgid "Scene setup" msgstr "Thiết lập scene" #: ../../docs/getting_started/step_by_step/scripting.rst:107 #, fuzzy msgid "" "Use the \"Add Child Node\" dialogue accessed from the Scene tab (or by " "pressing :kbd:`Ctrl + A`) to create a hierarchy with the following nodes:" msgstr "" "Sử dụng hộp thoại \"Add Child Node\" được truy cập từ tab Scene (hoặc bằng " "cách nhấn `` Ctrl + A``) để tạo cấu trúc phân cấp với các node sau:" #: ../../docs/getting_started/step_by_step/scripting.rst:110 msgid "Panel" msgstr "Panel (bảng)" #: ../../docs/getting_started/step_by_step/scripting.rst:112 #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:144 msgid "Label" msgstr "Label (nhãn)" #: ../../docs/getting_started/step_by_step/scripting.rst:113 msgid "Button" msgstr "Button (nút, phím)" #: ../../docs/getting_started/step_by_step/scripting.rst:115 msgid "The scene tree should look like this:" msgstr "Scene tree nên trông như thế này:" #: ../../docs/getting_started/step_by_step/scripting.rst:119 msgid "" "Use the 2D editor to position and resize the Button and Label so that they " "look like the image below. You can set the text from the Inspector tab." msgstr "" "Sử dụng editor 2D để chỉnh vị trí và thay đổi kích thước Button và Label sao " "cho chúng trông giống như hình ảnh bên dưới. Bạn có thể đặt văn bản từ tab " "Inspector." #: ../../docs/getting_started/step_by_step/scripting.rst:124 msgid "Finally, save the scene with a name such as ``sayhello.tscn``." msgstr "Cuối cùng, lưu scene với một tên như `` sayhello.tscn``." #: ../../docs/getting_started/step_by_step/scripting.rst:129 msgid "Adding a script" msgstr "Thêm một script" #: ../../docs/getting_started/step_by_step/scripting.rst:131 msgid "" "Right click on the Panel node, then select \"Attach Script\" from the " "context menu:" msgstr "" "Nhấp chuột phải vào node Panel, sau đó chọn \"Attach Script\" từ menu " "context:" #: ../../docs/getting_started/step_by_step/scripting.rst:136 msgid "" "The script creation dialog will pop up. This dialog allows you to set the " "script's language, class name, and other relevant options." msgstr "" "Hộp thoại tạo script sẽ bật lên. Hộp thoại này cho phép bạn đặt ngôn ngữ của " "scritp, tên lớp (class) và các tùy chọn liên quan khác." #: ../../docs/getting_started/step_by_step/scripting.rst:139 #, fuzzy msgid "" "In GDScript, the file itself represents the class, so the class name field " "is not editable." msgstr "" "Trong GDScript, chính tệp đại diện cho lớp, vì vậy trường tên lớp không thể " "chỉnh sửa." #: ../../docs/getting_started/step_by_step/scripting.rst:142 msgid "" "The node we're attaching the script to is a panel, so the Inherits field " "will automatically be filled in with \"Panel\". This is what we want, as the " "script's goal is to extend the functionality of our panel node." msgstr "" "Node chúng ta đính kèm script vào là một panel, vì vậy trường Kế thừa sẽ tự " "động được điền vào \"Panel\". Đây là những gì chúng ta muốn, vì mục tiêu của " "script là mở rộng chức năng của node Panel của chúng ta." #: ../../docs/getting_started/step_by_step/scripting.rst:146 msgid "Finally, enter a path name for the script and select Create:" msgstr "Cuối cùng, nhập tên đường dẫn cho tập lệnh và chọn Create:" #: ../../docs/getting_started/step_by_step/scripting.rst:150 msgid "" "The script will then be created and added to the node. You can see this as " "an \"Open script\" icon next to the node in the Scene tab, as well as in the " "script property under Inspector:" msgstr "" "Script sau đó sẽ được tạo và thêm vào node. Bạn có thể thấy đây là biểu " "tượng \"Open script\" bên cạnh node trong tab Scene, cũng như trong thuộc " "tính script trong Inspector:" #: ../../docs/getting_started/step_by_step/scripting.rst:156 msgid "" "To edit the script, select either of these buttons, both of which are " "highlighted in the above image. This will bring you to the script editor, " "where a default template will be included:" msgstr "" "Để chỉnh sửa script, chọn một trong hai nút này, cả hai nút được tô sáng đỏ " "trong hình trên. Điều này sẽ đưa bạn đến trình chỉnh sửa script, trong đó " "một mẫu mặc định (default template) sẽ được đưa vào:" #: ../../docs/getting_started/step_by_step/scripting.rst:161 msgid "" "There's not much there. The ``_ready()`` function is called when the node, " "and all its children, enters the active scene. **Note:** ``_ready()`` is not " "the constructor; the constructor is instead ``_init()``." msgstr "" "Không có quá nhiều. Hàm `` _ ready() `` được gọi khi node và tất cả các phần " "tử con của nó đi vào scene hoạt động. ** Lưu ý: ** `` _ready() `` không phải " "là hàm constructor; thay vào đó, hàm constructor là `` _init () ``." #: ../../docs/getting_started/step_by_step/scripting.rst:166 msgid "The role of the script" msgstr "Vai trò của script" #: ../../docs/getting_started/step_by_step/scripting.rst:168 msgid "" "A script adds behavior to a node. It is used to control how the node " "functions as well as how it interacts with other nodes: children, parent, " "siblings, and so on. The local scope of the script is the node. In other " "words, the script inherits the functions provided by that node." msgstr "" "Một script thêm hành vi (behavior) cho một node. Nó được sử dụng để kiểm " "soát cách thức hoạt động của node cũng như cách nó tương tác với các node " "khác: con, cha mẹ, anh chị em, (children, parent, siblings) v.v. Phạm vi " "thừa kế của script là node. Nói cách khác, script kế thừa các hàm được cung " "cấp bởi node đó." #: ../../docs/getting_started/step_by_step/scripting.rst:179 msgid "Handling a signal" msgstr "Xử lý tín hiệu (signal)" #: ../../docs/getting_started/step_by_step/scripting.rst:181 msgid "" "Signals are \"emitted\" when some specific kind of action happens, and they " "can be connected to any function of any script instance. Signals are used " "mostly in GUI nodes, although other nodes have them too, and you can even " "define custom signals in your own scripts." msgstr "" "Signal được \"phát ra\" (emit) khi một số loại hành động cụ thể xảy ra và " "chúng có thể được kết nối (connect) với bất kỳ chức năng nào của bất kỳ " "trường hợp script nào. Signal được sử dụng chủ yếu trong các node GUI, mặc " "dù các node khác cũng có chúng và thậm chí bạn có thể xác định signal tùy " "chỉnh trong script của riêng mình." #: ../../docs/getting_started/step_by_step/scripting.rst:186 msgid "" "In this step, we'll connect the \"pressed\" signal to a custom function. " "Forming connections is the first part and defining the custom function is " "the second part. For the first part, Godot provides two ways to create " "connections: through a visual interface the editor provides or through code." msgstr "" "Trong bước này, chúng tôi sẽ kết nối signal \"pressed\" với chức năng, hàm " "tùy chỉnh. Hình thành các kết nối là phần đầu tiên và xác định chức năng tùy " "chỉnh là phần thứ hai. Đối với phần đầu tiên, Godot cung cấp hai cách để tạo " "kết nối: thông qua giao diện trực quan mà trình soạn thảo cung cấp hoặc " "thông qua code." #: ../../docs/getting_started/step_by_step/scripting.rst:191 msgid "" "While we will use the code method for the remainder of this tutorial series, " "let's cover how the editor interface works for future reference." msgstr "" "Mặc dù chúng tôi sẽ sử dụng phương thức code cho phần còn lại của loạt bài " "hướng dẫn này, chúng ta hãy trình bày cách giao diện trình soạn thảo hoạt " "động để tham khảo trong tương lai." #: ../../docs/getting_started/step_by_step/scripting.rst:194 msgid "" "Select the Button node in the scene tree and then select the \"Node\" tab. " "Next, make sure that you have \"Signals\" selected." msgstr "" "Chọn Button node trong scene tree và sau đó chọn tab \"Node\". Tiếp theo, " "hãy chắc chắn rằng bạn đã chọn \"Signals\"." #: ../../docs/getting_started/step_by_step/scripting.rst:199 msgid "" "If you then select \"pressed()\" under \"BaseButton\" and click the " "\"Connect...\" button in the bottom right, you'll open up the connection " "creation dialogue." msgstr "" "Nếu sau đó bạn chọn \"pressed()\" trong \"BaseButton\" và nhấp vào nút " "\"Connect...\" ở dưới cùng bên phải, bạn sẽ mở hộp thoại tạo kết nối." #: ../../docs/getting_started/step_by_step/scripting.rst:204 msgid "" "The top of the dialogue displays a list of your scene's nodes with the " "emitting node's name highlighted in blue. Select the \"Panel\" node here." msgstr "" #: ../../docs/getting_started/step_by_step/scripting.rst:207 msgid "" "The bottom of the dialogue shows the name of the method that will be " "created. By default, the method name will contain the emitting node's name " "(\"Button\" in this case), resulting in ``_on_[EmitterNode]_[signal_name]``." msgstr "" #: ../../docs/getting_started/step_by_step/scripting.rst:211 msgid "" "And that concludes the guide on how to use the visual interface. However, " "this is a scripting tutorial, so for the sake of learning, let's dive into " "the manual process!" msgstr "" "Và điều đó kết luận hướng dẫn về cách sử dụng giao diện trực quan. Tuy " "nhiên, đây là một hướng dẫn về script, vì vậy để học hỏi, hãy đi sâu vào quy " "trình thủ công!" #: ../../docs/getting_started/step_by_step/scripting.rst:215 msgid "" "To accomplish this, we will introduce a function that is probably the most " "used by Godot programmers: :ref:`Node.get_node() " "`. This function uses paths to fetch nodes " "anywhere in the scene, relative to the node that owns the script." msgstr "" "Để thực hiện điều này, chúng tôi sẽ giới thiệu một hàm có lẽ được các lập " "trình viên Godot sử dụng nhiều nhất :: ref: `Node.get_node () " "`. Hàm này sử dụng các đường dẫn để tìm nạp các " "node ở bất cứ đâu trong scene, liên quan đến node sở hữu script." #: ../../docs/getting_started/step_by_step/scripting.rst:220 msgid "" "For the sake of convenience, delete everything underneath ``extends Panel``. " "You will fill out the rest of the script manually." msgstr "" "Để thuận tiện, hãy xóa mọi thứ bên dưới `` extends Panel``. Bạn sẽ điền phần " "còn lại của script theo cách thủ công." #: ../../docs/getting_started/step_by_step/scripting.rst:223 msgid "" "Because the Button and Label are siblings under the Panel where the script " "is attached, you can fetch the Button by typing the following underneath the " "``_ready()`` function:" msgstr "" "Vì Button và Label là anh em trong Bảng nơi script được đính kèm, bạn có " "thể tìm nạp Button bằng cách nhập nội dung bên dưới hàm `` _ready() ``:" #: ../../docs/getting_started/step_by_step/scripting.rst:240 #, fuzzy msgid "Next, write a function which will be called when the button is pressed:" msgstr "Tiếp theo, viết một hàm sẽ được gọi khi nhấn nút:" #: ../../docs/getting_started/step_by_step/scripting.rst:255 #, fuzzy msgid "" "Finally, connect the button's \"pressed\" signal to ``_on_Button_pressed()`` " "by using :ref:`Object.connect() `." msgstr "" "Cuối cùng, kết nối signal \"pressed\" của node với ``_ready() `` bằng cách " "sử dụng: ref: `Object.connect () `." #: ../../docs/getting_started/step_by_step/scripting.rst:271 msgid "The final script should look like this:" msgstr "Script cuối cùng sẽ trông như thế này:" #: ../../docs/getting_started/step_by_step/scripting.rst:304 msgid "" "Run the scene and press the button. You should get the following result:" msgstr "Chạy scene và nhấn nút. Bạn sẽ nhận được kết quả sau:" #: ../../docs/getting_started/step_by_step/scripting.rst:308 msgid "Why, hello there! Congratulations on scripting your first scene." msgstr "Tại sao, xin chào! Chúc mừng việc script scene đầu tiên của bạn." #: ../../docs/getting_started/step_by_step/scripting.rst:312 msgid "" "A common misunderstanding regarding this tutorial is how ``get_node(path)`` " "works. For a given node, ``get_node(path)`` searches its immediate children. " "In the above code, this means that Button must be a child of Panel. If " "Button were instead a child of Label, the code to obtain it would be:" msgstr "" "Một sự hiểu lầm phổ biến liên quan đến hướng dẫn này là cách `` get_node " "(path) `` hoạt động. Đối với một node đã cho, `` get_node (path) `` tìm kiếm " "các phần tử con ngay lập tức của nó. Trong đoạn code trên, điều này có nghĩa " "là Button phải là con của Panel. Nếu Button thay vì là con của Label, code " "để có được nó sẽ là:" #: ../../docs/getting_started/step_by_step/scripting.rst:330 msgid "Also, remember that nodes are referenced by name, not by type." msgstr "" "Ngoài ra, hãy nhớ rằng các node được tham chiếu theo tên, không phải theo " "loại." #: ../../docs/getting_started/step_by_step/scripting.rst:334 #, fuzzy msgid "" "The right-hand panel of the connect dialogue is for binding specific values " "to the connected function's parameters. You can add and remove values of " "different types." msgstr "" "Bảng bên phải của hộp thoại kết nối là để liên kết các giá trị cụ thể với " "các tham số của chức năng được kết nối. Bạn có thể thêm và loại bỏ các giá " "trị của các loại khác nhau." #: ../../docs/getting_started/step_by_step/scripting.rst:338 msgid "" "The code approach also enables this with a 4th ``Array`` parameter that is " "empty by default. Feel free to read up on the ``Object.connect`` method for " "more information." msgstr "" "Cách tiếp cận code cũng cho phép điều này với tham số `` Array`` thứ 4 trống " "theo mặc định. Vui lòng đọc lên phương thức `` Object.connect`` để biết thêm " "thông tin." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:4 msgid "Scripting (continued)" msgstr "Viết script (tiếp theo)" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:7 #, fuzzy msgid "Processing" msgstr "Đang xử lý" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:9 msgid "" "Several actions in Godot are triggered by callbacks or virtual functions, so " "there is no need to write code that runs all the time." msgstr "" "Một số hành động trong Godot được kích hoạt bởi các callback hoặc các hàm " "ảo, do đó không cần phải viết code chạy mọi lúc." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:12 msgid "" "However, it is still common to need a script to be processed on every frame. " "There are two types of processing: idle processing and physics processing." msgstr "" "Tuy nhiên, thông thường vẫn cần một script được xử lý trên mọi frame. Có hai " "loại xử lý: xử lý nhàn rỗi và xử lý vật lý (idle processing and physics " "processing)." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:16 msgid "" "Idle processing is activated when the method :ref:`Node._process() " "` is found in a script. It can be turned off and " "on with the :ref:`Node.set_process() ` " "function." msgstr "" "Idle processing rỗi được kích hoạt khi phương thức: ref: `Node._ process () " "` được tìm thấy trong một script. Nó có thể " "được tắt và bật với hàm: ref: `Node.set_ process () `." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:20 msgid "This method will be called every time a frame is drawn:" msgstr "Phương thức này sẽ được gọi mỗi khi một frame được vẽ:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:36 msgid "" "It's important to bear in mind that the frequency with which ``_process()`` " "will be called depends on how many frames per second (FPS) your application " "is running at. This rate can vary over time and devices." msgstr "" "Điều quan trọng là phải nhớ rằng tần số mà `` _ process() `` sẽ được gọi phụ " "thuộc vào số lượng frame (khung hình) mỗi giây (FPS) mà ứng dụng của bạn " "đang chạy. Tỷ lệ này có thể thay đổi theo thời gian và thiết bị." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:40 #, fuzzy msgid "" "To help manage this variability, the ``delta`` parameter contains the time " "elapsed in seconds as a floating-point number since the previous call to " "``_process()``." msgstr "" "Để giúp quản lý sự biến đổi này, tham số `` delta`` chứa thời gian trôi qua " "tính bằng giây, như một điểm nổi, vì cuộc gọi trước đó đến `` _ process () " "``." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:43 #, fuzzy msgid "" "This parameter can be used to make sure things always take the same amount " "of time, regardless of the game's FPS." msgstr "" "Tham số này có thể được sử dụng để đảm bảo mọi thứ luôn mất cùng thời gian, " "bất kể FPS của trò chơi." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:46 #, fuzzy msgid "" "For example, movement is often multiplied with a time delta to make movement " "speed both constant and independent of the frame rate." msgstr "" "Ví dụ, chuyển động thường được nhân với delta thời gian để làm cho tốc độ di " "chuyển không đổi và độc lập với tốc độ khung hình." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:49 msgid "" "Physics processing with ``_physics_process()`` is similar, but it should be " "used for processes that must happen before each physics step, such as " "controlling a character. It always runs before a physics step and it is " "called at fixed time intervals: 60 times per second by default. You can " "change the interval from the Project Settings, under Physics -> Common -> " "Physics Fps." msgstr "" "Physics processing với `` _physics_ process () `` là tương tự, nhưng nó nên " "được sử dụng cho các quá trình phải xảy ra trước mỗi bước vật lý, chẳng hạn " "như điều khiển một ký tự. Nó luôn chạy trước một bước vật lý và nó được gọi " "theo các khoảng thời gian cố định: 60 lần mỗi giây theo mặc định. Bạn có thể " "thay đổi khoảng thời gian từ Cài đặt dự án, trong Physics -> Common -> " "Physics Fps." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:55 msgid "" "The function ``_process()``, however, is not synced with physics. Its frame " "rate is not constant and is dependent on hardware and game optimization. Its " "execution is done after the physics step on single-threaded games." msgstr "" "Tuy nhiên, hàm `` _ process() `` không được đồng bộ hóa với vật lý. Tốc độ " "khung hình của nó không phải là hằng số và phụ thuộc vào tối ưu hóa phần " "cứng và trò chơi. Việc thực hiện của nó được thực hiện sau bước vật lý trên " "các trò chơi đơn luồng." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:58 msgid "" "A simple way to see the ``_process()`` function at work is to create a scene " "with a single Label node, with the following script:" msgstr "" "Một cách đơn giản để xem hàm `` _ process () `` tại nơi làm việc là tạo một " "scene với một node Label duy nhất, với đoạn script sau:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:85 msgid "Which will show a counter increasing each frame." msgstr "Mà sẽ hiển thị một bộ đếm tăng dẫn sau mỗi từng khung." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:88 msgid "Groups" msgstr "Nhóm (Groups)" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:90 msgid "" "Groups in Godot work like tags you might have come across in other software. " "A node can be added to as many groups as desired. This is a useful feature " "for organizing large scenes. There are two ways to add nodes to groups. The " "first is from the UI, using the Groups button under the Node panel:" msgstr "" "Groups trong Godot làm việc như thẻ bạn có thể đã đi qua trong phần mềm " "khác. Một node có thể được thêm vào nhiều nhóm như mong muốn. Đây là một " "tính năng hữu ích để tổ chức các scene lớn. Có hai cách để thêm các node vào " "groups. Đầu tiên là từ giao diện người dùng UI, sử dụng nút Groups bên cạnh " "bảng Node:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:97 msgid "" "And the second way is from code. The following script would add the current " "node to the ``enemies`` group as soon as it appeared in the scene tree." msgstr "" "Và cách thứ hai là từ code. Đoạn script sau sẽ thêm nút hiện tại vào nhóm `` " "enemies`` ngay khi nó xuất hiện trong cây scene." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:115 #, fuzzy msgid "" "This way, if the player is discovered sneaking into a secret base, all " "enemies can be notified about its alarm sounding by using :ref:`SceneTree." "call_group() `:" msgstr "" "Bằng cách này, nếu người chơi bị phát hiện lẻn vào một căn cứ bí mật, tất cả " "kẻ thù có thể được thông báo về âm thanh báo động của nó bằng cách sử dụng: " "ref: `SceneTree.call_group () `:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:132 msgid "" "The above code calls the function ``player_was_discovered`` on every member " "of the group ``enemies``." msgstr "" "Đoạn code trên gọi hàm `` player_was_discovered`` trên mọi thành viên của " "nhóm `` enemies``." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:135 msgid "" "It is also possible to get the full list of ``enemies`` nodes by calling :" "ref:`SceneTree.get_nodes_in_group() " "`:" msgstr "" "Cũng có thể lấy danh sách đầy đủ các node``enemies`` bằng cách gọi: ref: " "`SceneTree.get_nodes_in_group () " "`:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:148 msgid "" "The :ref:`SceneTree ` class provides many useful methods, " "like interacting with scenes, their node hierarchy and groups of nodes. It " "allows you to easily switch scenes or reload them, to quit the game or pause " "and unpause it. It even comes with interesting signals. So check it out if " "you have some time!" msgstr "" "Lớp: ref: `SceneTree ` cung cấp nhiều phương thức hữu ích, " "như tương tác với các scene, phân cấp node của chúng và các nhóm node. Nó " "cho phép bạn dễ dàng chuyển scene hoặc tải lại chúng, thoát khỏi trò chơi " "hoặc tạm dừng và bỏ tạm dừng nó. Nó thậm chí đi kèm với các signal thú vị. " "Vì vậy, hãy kiểm tra nó nếu bạn có thời gian!" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:156 #: ../../docs/tutorials/gui/custom_gui_controls.rst:157 msgid "Notifications" msgstr "Thông báo" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:158 msgid "" "Godot has a system of notifications. These are usually not needed for " "scripting, as it's too low-level and virtual functions are provided for most " "of them. It's just good to know they exist. For example, you may add an :ref:" "`Object._notification() ` function in " "your script:" msgstr "" "Godot có một hệ thống thông báo. Chúng thường không cần thiết cho script, vì " "nó quá thấp và các hàm ảo được cung cấp cho hầu hết chúng. Thật tốt khi biết " "chúng tồn tại. Ví dụ: bạn có thể thêm một hàm: ref: `Object._notification () " "` trong tập lệnh của bạn:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:193 #, fuzzy msgid "" "The documentation of each class in the :ref:`Class Reference ` shows the notifications it can receive. However, in most cases " "GDScript provides simpler overridable functions." msgstr "" "Tài liệu của mỗi lớp trong: ref: `Class Reference ` hiển thị " "các thông báo mà nó có thể nhận được. Tuy nhiên, trong hầu hết các trường " "hợp, GDScript cung cấp các hàm ghi đè đơn giản hơn." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:198 #, fuzzy msgid "Overridable functions" msgstr "Hàm chồng chéo (Overrideable functions)" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:200 #, fuzzy msgid "" "Such overridable functions, which are described as follows, can be applied " "to nodes:" msgstr "" "Các overrideable functions như vậy, được mô tả như sau, có thể được áp dụng " "cho các node:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:272 msgid "" "As mentioned before, it's better to use these functions instead of the " "notification system." msgstr "" "Như đã đề cập trước đây, tốt hơn là sử dụng các hàm này thay vì hệ thống " "thông báo." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:276 msgid "Creating nodes" msgstr "Tạo các node" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:278 msgid "" "To create a node from code, call the ``.new()`` method, like for any other " "class-based datatype. For example:" msgstr "" "Để tạo một node từ code, hãy gọi phương thức `` .new () ``, giống như với " "bất kỳ kiểu dữ liệu dựa trên lớp nào khác. Ví dụ:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:302 msgid "" "To delete a node, be it inside or outside the scene, ``free()`` must be used:" msgstr "" "Để xóa một node, có thể là bên trong hoặc bên ngoài scene, `` free () `` " "phải được sử dụng:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:318 msgid "" "When a node is freed, it also frees all its child nodes. Because of this, " "manually deleting nodes is much simpler than it appears. Free the base node " "and everything else in the subtree goes away with it." msgstr "" "Khi một node được giải phóng, nó cũng giải phóng tất cả các node con của nó. " "Bởi vì điều này, việc xóa các nút thủ công đơn giản hơn nhiều so với nó xuất " "hiện. Giải phóng node cơ sở và mọi thứ khác trong cây con (subtree) sẽ biến " "mất cùng với nó." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:322 msgid "" "A situation might occur where we want to delete a node that is currently " "\"blocked\", because it is emitting a signal or calling a function. This " "will crash the game. Running Godot with the debugger will often catch this " "case and warn you about it." msgstr "" "Một tình huống có thể xảy ra khi chúng ta muốn xóa một node hiện đang bị " "\"blocked\", bởi vì nó đang phát ra signal hoặc gọi một hàm. Điều này sẽ làm " "hỏng trò chơi (crash game). Chạy Godot với trình gỡ lỗi thường sẽ bắt trường " "hợp này và cảnh báo bạn về nó." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:327 msgid "" "The safest way to delete a node is by using :ref:`Node.queue_free() " "`. This erases the node safely during idle." msgstr "" "Cách an toàn nhất để xóa một node là sử dụng: ref: `Node.queue_free () " "`. Điều này xóa node an toàn trong thời gian " "rảnh." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:345 #: ../../docs/tutorials/misc/running_code_in_the_editor.rst:128 msgid "Instancing scenes" msgstr "Instance scene" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:347 msgid "" "Instancing a scene from code is done in two steps. The first one is to load " "the scene from your hard drive:" msgstr "" "Instance một scene từ code được thực hiện trong hai bước. Đầu tiên là tải " "scene từ ổ cứng của bạn:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:360 #, fuzzy msgid "" "Preloading it can be more convenient, as it happens at parse time (GDScript " "only):" msgstr "" "Tải trước nó có thể thuận tiện hơn, vì nó xảy ra vào thời gian phân tích cú " "pháp (chỉ GDScript):" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:368 msgid "" "But ``scene`` is not yet a node. It's packed in a special resource called :" "ref:`PackedScene `. To create the actual node, the " "function :ref:`PackedScene.instance() ` " "must be called. This will return the tree of nodes that can be added to the " "active scene:" msgstr "" "Nhưng `` scene`` chưa phải là một node. Nó được đóng gói trong một tài " "nguyên đặc biệt gọi là: ref: `PackedScene `. Để tạo node " "thực sự, hàm: ref: `PackedScene.instance () " "` phải được gọi. Điều này sẽ trả về cây " "node có thể được thêm vào scene đang chọn:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:386 msgid "" "The advantage of this two-step process is that a packed scene may be kept " "loaded and ready to use so that you can create as many instances as desired. " "This is especially useful to quickly instance several enemies, bullets, and " "other entities in the active scene." msgstr "" "Ưu điểm của quy trình hai bước này là một scene được đóng gói có thể được " "tải và sẵn sàng sử dụng để bạn có thể tạo nhiều instance như mong muốn. Điều " "này đặc biệt hữu ích để nhanh chóng instance một số kẻ thù, đạn và các thực " "thể khác trong scene được chọn." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:394 msgid "Register scripts as classes" msgstr "Đăng ký script như các lớp" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:396 msgid "" "Godot has a \"Script Class\" feature to register individual scripts with the " "Editor. By default, you can only access unnamed scripts by loading the file " "directly." msgstr "" "Godot có tính năng \"Lớp script\" để đăng ký các script riêng lẻ với Trình " "chỉnh sửa. Theo mặc định, bạn chỉ có thể truy cập các script chưa được đặt " "tên bằng cách tải file trực tiếp." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:400 msgid "" "You can name a script and register it as a type in the editor with the " "``class_name`` keyword followed by the class's name. You may add a comma and " "an optional path to an image to use as an icon. You will then find your new " "type in the Node or Resource creation dialog." msgstr "" "Bạn có thể đặt tên cho một script và đăng ký nó dưới dạng một loại trong " "trình soạn thảo với từ khóa ``class_name`` theo sau là tên của lớp. Bạn có " "thể thêm dấu phẩy và đường dẫn tùy chọn vào hình ảnh để sử dụng làm biểu " "tượng. Sau đó, bạn sẽ tìm thấy loại mới của mình trong hộp thoại Node hoặc " "Resource creation,." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:422 #, fuzzy msgid "In Godot 3.1:" msgstr "Trong Godot 3.1:" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:424 msgid "" "Only GDScript and NativeScript, i.e., C++ and other GDNative-powered " "languages, can register scripts." msgstr "" "Chỉ GDScript và NativeScript, tức là, C ++ và các ngôn ngữ được cung cấp bởi " "GDNative khác, mới có thể đăng ký script." #: ../../docs/getting_started/step_by_step/scripting_continued.rst:425 msgid "Only GDScript creates global variables for each named script." msgstr "Chỉ GDScript tạo các biến toàn cục cho mỗi script được đặt tên." #: ../../docs/getting_started/step_by_step/signals.rst:1 #: ../../docs/tutorials/misc/instancing_with_signals.rst:1 #, fuzzy msgid "Signal" msgstr "Tín hiệu (Signal)" #: ../../docs/getting_started/step_by_step/signals.rst:7 #: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1296 #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:484 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:164 #: ../../docs/tutorials/plugins/gdnative/gdnative-cpp-example.rst:696 #: ../../docs/development/cpp/object_class.rst:214 msgid "Signals" msgstr "Tín hiệu (Signal)" #: ../../docs/getting_started/step_by_step/signals.rst:12 msgid "" "Signals are Godot's version of the *observer* pattern. They allow a node to " "send out a message that other nodes can listen for and respond to. For " "example, rather than continuously checking a button to see if it's being " "pressed, the button can emit a signal when it's pressed." msgstr "" "Signal là phiên bản của Godot của mẫu * quan sát viên * (observer* pattern). " "Chúng cho phép một node gửi đi một thông điệp mà các node khác có thể lắng " "nghe và phản hồi. Ví dụ, thay vì liên tục kiểm tra một nút để xem nếu nó " "được nhấn, nút có thể phát ra tín hiệu khi nhấn." #: ../../docs/getting_started/step_by_step/signals.rst:17 #, fuzzy msgid "" "You can read more about the observer pattern here: https://" "gameprogrammingpatterns.com/observer.html" msgstr "" "Bạn có thể đọc thêm về observer pattern ở đây: http://gameprogrammingpotypes." "com/observer.html" #: ../../docs/getting_started/step_by_step/signals.rst:19 msgid "" "Signals are a way to *decouple* your game objects, which leads to better " "organized and more manageable code. Instead of forcing game objects to " "expect other objects to always be present, they can instead emit signals " "that all interested objects can subscribe to and respond to." msgstr "" "Signal là một cách để * tách rời * các đối tượng trò chơi của bạn, điều này " "dẫn đến mã được tổ chức tốt hơn và dễ quản lý hơn. Thay vì buộc các đối " "tượng trò chơi phải mong đợi các đối tượng khác luôn có mặt, thay vào đó " "chúng có thể phát ra các tín hiệu mà tất cả các đối tượng quan tâm có thể " "đăng ký và phản hồi." #: ../../docs/getting_started/step_by_step/signals.rst:24 msgid "" "Below you can see some examples of how you can use signals in your own " "projects." msgstr "Dưới đây có vài ví dụ về cách dùng signal trong dự án của bạn." #: ../../docs/getting_started/step_by_step/signals.rst:27 msgid "Timer example" msgstr "Ví dụ timer" #: ../../docs/getting_started/step_by_step/signals.rst:29 #, fuzzy msgid "" "To see how signals work, let's try using a :ref:`Timer ` node. " "Create a new scene with a Node2D and two children: a Timer and a :ref:" "`Sprite `. In the Scene dock, rename Node2D to TimerExample." msgstr "" "Để xem signals hoạt động thế nào, hãy thử sử dụng một nút « Trọng tài ».Hãy " "tạo một scene mới với một Node và hai node con: một Timer và một tên :ref:" "`Sprite `. Ở màn hình scene, hãy thay đổi tên node thành điển " "TimerExample." #: ../../docs/getting_started/step_by_step/signals.rst:33 msgid "" "For the Sprite's texture, you can use the Godot icon, or any other image you " "like. Do so by selecting ``Load`` in the Sprite's Texture attribute drop-" "down menu. Attach a script to the root node, but don't add any code to it " "yet." msgstr "" "Đối với texture của Sprite, bạn có thể sử dụng icon Godot hoặc bất kỳ hình " "ảnh nào khác mà bạn thích. Làm như vậy bằng cách chọn `` Load`` trong menu " "thả xuống thuộc tính Texture của Sprite. Đính kèm script vào nút gốc, nhưng " "chưa thêm bất kỳ mã nào vào nó." #: ../../docs/getting_started/step_by_step/signals.rst:37 msgid "Your scene tree should look like this:" msgstr "Scene tree của bạn sẽ trông như thế này:" #: ../../docs/getting_started/step_by_step/signals.rst:41 msgid "" "In the Timer node's properties, check the \"On\" box next to *Autostart*. " "This will cause the timer to start automatically when you run the scene. You " "can leave the *Wait Time* at 1 second." msgstr "" "Trong bảng thuộc tính của nút Timer, đánh dấu vào ô \"On\" bên cạnh * " "Autostart *. Điều này sẽ khiến bộ hẹn giờ bắt đầu tự động khi bạn chạy cảnh. " "Bạn có thể để * Wait Time * trong 1 giây." #: ../../docs/getting_started/step_by_step/signals.rst:45 msgid "" "Next to the \"Inspector\" tab is a tab labeled \"Node\". Click on this tab " "and you'll see all of the signals that the selected node can emit. In the " "case of the Timer node, the one we're concerned with is \"timeout\". This " "signal is emitted whenever the Timer reaches ``0``." msgstr "" "Bên cạnh tab \"Inspector\" là một tab có nhãn \"Node\". Nhấp vào tab này và " "bạn sẽ thấy tất cả các signal mà nút được chọn có thể phát ra. Trong trường " "hợp node Timer, cái chúng ta quan tâm là \"timeout\". Tín hiệu này được phát " "ra bất cứ khi nào Timer đạt đến `` 0``." #: ../../docs/getting_started/step_by_step/signals.rst:52 #, fuzzy msgid "" "Click on the \"timeout()\" signal and click \"Connect...\" at the bottom of " "the signals panel. You'll see the following window, where you can define how " "you want to connect the signal:" msgstr "" "Nhấp vào tín hiệu \"timeout()\" signal và nhấp vào \"Connect...\". Bạn sẽ " "thấy cửa sổ sau, nơi bạn có thể xác định cách bạn muốn kết nối signal:" #: ../../docs/getting_started/step_by_step/signals.rst:58 #, fuzzy msgid "" "On the left side, you'll see the nodes in your scene and can select the node " "that you want to \"listen\" for the signal. Note that the Timer node is " "blue, this is a visual indication that it's the node that is emitting the " "signal. Select the root node." msgstr "" "Ở phía bên trái, bạn sẽ thấy các node trong scene của mình và có thể chọn " "node mà bạn muốn \"nghe\" cho tín hiệu. Lưu ý rằng node Timer có màu đỏ - " "đây không phải là * lỗi, nhưng là một dấu hiệu trực quan cho thấy đó là node " "phát ra signal. Chọn node gốc." #: ../../docs/getting_started/step_by_step/signals.rst:63 msgid "" "The target node *must* have a script attached or you'll receive an error " "message." msgstr "" "Node đích * phải * có script được đính kèm hoặc bạn sẽ nhận được thông báo " "lỗi." #: ../../docs/getting_started/step_by_step/signals.rst:66 msgid "" "If you toggle the Advanced menu, you'll see on the right side that you can " "bind an arbitrary number of arguments of (possibly) different types. This " "can be useful when you have more than one signal connected to the same " "method, as each signal propagation will result in different values for those " "extra call arguments." msgstr "" #: ../../docs/getting_started/step_by_step/signals.rst:70 #, fuzzy msgid "" "On the bottom of the window is a field labeled \"Receiver Method\". This is " "the name of the function in the target node's script that you want to use. " "By default, Godot will create this function using the naming convention " "``_on__`` but you can change it if you wish." msgstr "" "Ở dưới cùng của cửa sổ là một trường có nhãn \"Method In Node\" (phương thức " "trong nút). Đây là tên của hàm trong tập lệnh của node đích mà bạn muốn sử " "dụng. Theo mặc định, Godot sẽ tạo chức năng này bằng cách sử dụng quy ước " "đặt tên ``_on__`` nhưng bạn có thể thay đổi nó nếu " "muốn." #: ../../docs/getting_started/step_by_step/signals.rst:75 msgid "" "Click \"Connect\" and you'll see that the function has been created in the " "script:" msgstr "" "Nhấp vào \"Connect\" và bạn sẽ thấy rằng function (hàm) đã được tạo trong " "script:" #: ../../docs/getting_started/step_by_step/signals.rst:96 msgid "" "Now we can replace the placeholder code with whatever code we want to run " "when the signal is received. Let's make the Sprite blink:" msgstr "" "Bây giờ chúng tôi có thể thay thế mã giữ chỗ bằng bất kỳ mã nào chúng tôi " "muốn chạy khi nhận được signal. Hãy làm cho Sprite nhấp nháy:" #: ../../docs/getting_started/step_by_step/signals.rst:121 msgid "" "Run the scene and you'll see the Sprite blinking on and off every second. " "You can change the Timer's *Wait Time* property to alter this." msgstr "" "Chạy scene và bạn sẽ thấy Sprite nhấp nháy và tắt mỗi giây. Bạn có thể thay " "đổi thuộc tính *Wait Time* của Timer để thay đổi điều này." #: ../../docs/getting_started/step_by_step/signals.rst:125 msgid "Connecting signals in code" msgstr "Kết nối signal trong mã" #: ../../docs/getting_started/step_by_step/signals.rst:127 msgid "" "You can also make the signal connection in code rather than with the editor. " "This is usually necessary when you're instancing nodes via code and so you " "can't use the editor to make the connection." msgstr "" "Bạn cũng có thể thực hiện kết nối tín hiệu trong mã thay vì với trình chỉnh " "sửa. Điều này thường là cần thiết khi bạn kích hoạt các node thông qua mã và " "vì vậy bạn không thể sử dụng trình chỉnh sửa để tạo kết nối." #: ../../docs/getting_started/step_by_step/signals.rst:131 msgid "" "First, disconnect the signal by selecting the connection in the Timer's " "\"Node\" tab and clicking disconnect." msgstr "" "Đầu tiên, ngắt kết nối tín hiệu bằng cách chọn kết nối trong tab \"Node\" " "của Timer và nhấp vào disconnect." #: ../../docs/getting_started/step_by_step/signals.rst:136 msgid "" "To make the connection in code, we can use the ``connect`` function. We'll " "put it in ``_ready()`` so that the connection will be made on run. The " "syntax of the function is ``.connect(, " ", )``. Here is the code for our Timer " "connection:" msgstr "" "Để tạo kết nối trong mã, chúng ta có thể sử dụng hàm ``connect``. Chúng tôi " "sẽ đặt nó trong ``_ready()`` để kết nối sẽ được thực hiện khi chạy. Cú pháp " "của hàm là `` .connect (, , " ") ``. Đây là mã cho kết nối Timer của chúng tôi:" #: ../../docs/getting_started/step_by_step/signals.rst:171 msgid "Custom signals" msgstr "Tùy chỉnh signals (Custom signals)" #: ../../docs/getting_started/step_by_step/signals.rst:173 msgid "You can also declare your own custom signals in Godot:" msgstr "Bạn cũng có thể khai báo các custom signal của riêng bạn trong Godot:" #: ../../docs/getting_started/step_by_step/signals.rst:192 msgid "" "Once declared, your custom signals will appear in the Inspector and can be " "connected in the same way as a node's built-in signals." msgstr "" "Sau khi được khai báo, các tín hiệu tùy chỉnh của bạn sẽ xuất hiện trong " "Inspector và có thể được kết nối giống như các tín hiệu tích hợp của node." #: ../../docs/getting_started/step_by_step/signals.rst:195 msgid "To emit a signal via code, use the ``emit_signal`` function:" msgstr "Để phát signal qua mã, hãy sử dụng hàm ``emit_signal``:" #: ../../docs/getting_started/step_by_step/signals.rst:222 msgid "" "A signal can also optionally declare one or more arguments. Specify the " "argument names between parentheses:" msgstr "" #: ../../docs/getting_started/step_by_step/signals.rst:243 msgid "" "The signal arguments show up in the editor's node dock, and Godot can use " "them to generate callback functions for you. However, you can still emit any " "number of arguments when you emit signals. So it's up to you to emit the " "correct values." msgstr "" #: ../../docs/getting_started/step_by_step/signals.rst:248 #, fuzzy msgid "" "To pass values, add them as the second argument to the ``emit_signal`` " "function:" msgstr "Để phát signal qua mã, hãy sử dụng hàm ``emit_signal``:" #: ../../docs/getting_started/step_by_step/signals.rst:278 msgid "" "Many of Godot's built-in node types provide signals you can use to detect " "events. For example, an :ref:`Area2D ` representing a coin " "emits a ``body_entered`` signal whenever the player's physics body enters " "its collision shape, allowing you to know when the player collected it." msgstr "" "Nhiều loại node tích hợp của Godot cung cấp tín hiệu bạn có thể sử dụng để " "phát hiện các sự kiện. Ví dụ: an: ref: `Area2D ` đại diện cho " "một đồng xu sẽ phát ra tín hiệu `` body_entered`` bất cứ khi nào cơ thể vật " "lý của người chơi (nhân vật) đi vào hình dạng va chạm của nó (đồng xu), cho " "phép bạn biết khi nào đồng xu được thu thập." #: ../../docs/getting_started/step_by_step/signals.rst:283 #, fuzzy msgid "" "In the next section, :ref:`doc_your_first_game`, you'll build a complete " "game including several uses of signals to connect different game components." msgstr "" "Trong phần tiếp theo ,: ref: `doc_your_first_game`, bạn sẽ xây dựng một trò " "chơi hoàn chỉnh bao gồm một số cách sử dụng tín hiệu để kết nối các thành " "phần trò chơi khác nhau." #: ../../docs/getting_started/step_by_step/your_first_game.rst:4 #, fuzzy msgid "Your first game" msgstr "Trò chơi đầu tiên của bạn" #: ../../docs/getting_started/step_by_step/your_first_game.rst:7 #: ../../docs/getting_started/step_by_step/exporting.rst:7 #: ../../docs/tutorials/animation/introduction_2d.rst:7 #: ../../docs/tutorials/assetlib/using_assetlib.rst:10 msgid "Overview" msgstr "Tổng quan" #: ../../docs/getting_started/step_by_step/your_first_game.rst:9 msgid "" "This tutorial will guide you through making your first Godot project. You " "will learn how the Godot editor works, how to structure a project, and how " "to build a 2D game." msgstr "" "Hướng dẫn này sẽ chỉ bạn cách thực hiện dự án Godot đầu tiên của bạn. Bạn sẽ " "tìm hiểu cách trình soạn thảo Godot hoạt động, cách cấu trúc một dự án và " "cách xây dựng một trò chơi 2D." #: ../../docs/getting_started/step_by_step/your_first_game.rst:13 msgid "" "This project is an introduction to the Godot engine. It assumes that you " "have some programming experience already. If you're new to programming " "entirely, you should start here: :ref:`doc_scripting`." msgstr "" "Dự án này là một giới thiệu về Godot engine. Nó giả định rằng bạn đã có một " "số kinh nghiệm lập trình. Nếu bạn chưa quen với lập trình hoàn toàn, bạn nên " "bắt đầu ở đây :: ref: `doc_scripting`." #: ../../docs/getting_started/step_by_step/your_first_game.rst:18 #, fuzzy msgid "" "The game is called \"Dodge the Creeps!\". Your character must move and avoid " "the enemies for as long as possible. Here is a preview of the final result:" msgstr "" "Trò chơi có tên là \"Dodge the Creeps!\". Nhân vật của bạn phải di chuyển và " "tránh kẻ thù càng lâu càng tốt. Đây là bản xem trước của kết quả cuối cùng:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:24 #, fuzzy msgid "" "**Why 2D?** 3D games are much more complex than 2D ones. You should stick to " "2D until you have a good understanding of the game development process and " "how to use Godot." msgstr "" "**Tại sao 2D? ** Trò chơi 3D phức tạp hơn nhiều so với trò chơi 2D. Bạn nên " "bám sát 2D cho đến khi bạn hiểu rõ về quy trình phát triển trò chơi." #: ../../docs/getting_started/step_by_step/your_first_game.rst:29 #: ../../docs/getting_started/workflow/project_setup/index.rst:2 #: ../../docs/tutorials/2d/using_tilemaps.rst:21 #: ../../docs/tutorials/misc/state_design_pattern.rst:233 msgid "Project setup" msgstr "Thiết lập dự án" #: ../../docs/getting_started/step_by_step/your_first_game.rst:31 #, fuzzy msgid "" "Launch Godot and create a new project. Then, download :download:" "`dodge_assets.zip `. This contains the images and " "sounds you'll be using to make the game. Unzip these files in your project " "folder." msgstr "" "Khởi động Godot và tạo một dự án mới. Sau đó, tải xuống: download: " "`dodge_assets.zip ` - hình ảnh và âm thanh bạn sẽ " "sử dụng để tạo trò chơi. Giải nén các tệp này vào thư mục dự án của bạn." #: ../../docs/getting_started/step_by_step/your_first_game.rst:36 #, fuzzy msgid "" "For this tutorial, we will assume you are familiar with the Godot editor. If " "you haven't read :ref:`doc_scenes_and_nodes`, do so now for an explanation " "of setting up a project and using the editor." msgstr "" "Đối với hướng dẫn này, chúng tôi sẽ cho rằng bạn quen thuộc với trình soạn " "thảo. Nếu bạn chưa đọc: ref: `doc_scenes_and_nodes`, hãy làm ngay bây giờ để " "được giải thích về việc thiết lập dự án và sử dụng trình soạn thảo." #: ../../docs/getting_started/step_by_step/your_first_game.rst:40 #, fuzzy msgid "" "This game is designed for portrait mode, so we need to adjust the size of " "the game window. Click on Project -> Project Settings -> Display -> Window " "and set \"Width\" to ``480`` and \"Height\" to ``720``." msgstr "" "Trò chơi này sẽ sử dụng chế độ dọc, vì vậy chúng tôi cần điều chỉnh kích " "thước của cửa sổ trò chơi. Nhấp vào Project -> Project Settings -> Display -" "> Window và đặt \"Width\" thành `` 480`` và \"Height\" thành `` 720``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:44 msgid "" "Also in this section, under the \"Stretch\" options, set ``Mode`` to \"2d\" " "and ``Aspect`` to \"keep\". This ensures that the game scales consistently " "on different sized screens." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:49 #, fuzzy msgid "Organizing the project" msgstr "Tổ chức dự án" #: ../../docs/getting_started/step_by_step/your_first_game.rst:51 #, fuzzy msgid "" "In this project, we will make 3 independent scenes: ``Player``, ``Mob``, and " "``HUD``, which we will combine into the game's ``Main`` scene. In a larger " "project, it might be useful to create folders to hold the various scenes and " "their scripts, but for this relatively small game, you can save your scenes " "and scripts in the project's root folder, identified by ``res://``. You can " "see your project folders in the FileSystem Dock in the lower left corner:" msgstr "" "Trong dự án này, chúng tôi sẽ thực hiện 3 cảnh độc lập: `` Player``, `` " "Mob`` và `` HUD``, chúng tôi sẽ kết hợp vào cảnh `` Main`` của trò chơi. " "Trong một dự án lớn hơn, có thể hữu ích khi tạo các thư mục để chứa các cảnh " "khác nhau và tập lệnh của chúng, nhưng đối với trò chơi tương đối nhỏ này, " "bạn có thể lưu cảnh và tập lệnh của mình trong thư mục gốc của dự án, được " "gọi là `` res: // ``. Bạn có thể thấy các thư mục dự án của mình trong " "FileSystem Dock ở góc dưới bên trái:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:62 msgid "Player scene" msgstr "Cảnh người chơi" #: ../../docs/getting_started/step_by_step/your_first_game.rst:64 #, fuzzy msgid "" "The first scene we will make defines the ``Player`` object. One of the " "benefits of creating a separate Player scene is that we can test it " "separately, even before we've created other parts of the game." msgstr "" "Cảnh đầu tiên chúng ta sẽ định nghĩa đối tượng `` Player``. Một trong những " "lợi ích của việc tạo cảnh Người chơi riêng là chúng tôi có thể kiểm tra " "riêng, ngay cả trước khi chúng tôi tạo các phần khác của trò chơi." #: ../../docs/getting_started/step_by_step/your_first_game.rst:69 msgid "Node structure" msgstr "Cấu trúc node" #: ../../docs/getting_started/step_by_step/your_first_game.rst:71 msgid "" "To begin, we need to choose a root node for the player object. As a general " "rule, a scene's root node should reflect the object's desired functionality " "- what the object *is*. Click the \"Other Node\" button and add an :ref:" "`Area2D ` node to the scene." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:78 msgid "" "Godot will display a warning icon next to the node in the scene tree. You " "can ignore it for now. We will address it later." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:81 #, fuzzy msgid "" "With ``Area2D`` we can detect objects that overlap or run into the player. " "Change the node's name to ``Player`` by double-clicking on it. Now that " "we've set the scene's root node, we can add additional nodes to give it more " "functionality." msgstr "" "Với `` Area2D``, chúng ta có thể phát hiện các đối tượng chồng lấp hoặc chạy " "vào player. Thay đổi tên của nó thành `` Player`` bằng cách nhấp vào tên của " "node. Đây là node gốc của cảnh. Chúng tôi có thể thêm các node bổ sung cho " "player để thêm chức năng." #: ../../docs/getting_started/step_by_step/your_first_game.rst:86 msgid "" "Before we add any children to the ``Player`` node, we want to make sure we " "don't accidentally move or resize them by clicking on them. Select the node " "and click the icon to the right of the lock; its tooltip says \"Makes sure " "the object's children are not selectable.\"" msgstr "" "Trước khi chúng tôi thêm bất kỳ node con khác nào vào node `` Player``, " "chúng tôi muốn đảm bảo rằng chúng tôi không vô tình di chuyển hoặc thay đổi " "kích thước chúng bằng cách nhấp vào chúng. Chọn nút và nhấp vào biểu tượng ở " "bên phải của khóa; tooltip của nó nói \"Chắc chắn rằng con của đối tượng " "không thể chọn được.\"" #: ../../docs/getting_started/step_by_step/your_first_game.rst:93 #, fuzzy msgid "" "Save the scene. Click Scene -> Save, or press :kbd:`Ctrl + S` on Windows/" "Linux or :kbd:`Cmd + S` on macOS." msgstr "" "Lưu lại cảnh. Nhấp vào Scene -> Save hoặc nhấn `` Ctrl + S`` trên Windows / " "Linux hoặc `` Command + S`` trên Mac." #: ../../docs/getting_started/step_by_step/your_first_game.rst:95 msgid "For this project, we will be following the Godot naming conventions." msgstr "Đối với dự án này, chúng tôi sẽ tuân theo các quy ước đặt tên Godot." #: ../../docs/getting_started/step_by_step/your_first_game.rst:97 msgid "" "**GDScript**: Classes (nodes) use PascalCase, variables and functions use " "snake_case, and constants use ALL_CAPS (See :ref:`doc_gdscript_styleguide`)." msgstr "" "**GDScript**: Các lớp (node) sử dụng PascalCase, các biến và hàm sử dụng " "snake_case và các hằng sử dụng ALL_CAPS (Xem: ref: " "`doc_gdscript_styleguide`)." #: ../../docs/getting_started/step_by_step/your_first_game.rst:101 msgid "" "**C#**: Classes, export variables and methods use PascalCase, private fields " "use _camelCase, local variables and parameters use camelCase (See :ref:" "`doc_c_sharp_styleguide`). Be careful to type the method names precisely " "when connecting signals." msgstr "" "**C #**: Các lớp, biến xuất và phương thức sử dụng PascalCase, trường riêng " "sử dụng _camelCase, biến cục bộ và tham số sử dụng camelCase (Xem: ref: " "`doc_c_sharp_styleguide`). Hãy cẩn thận để nhập tên phương thức chính xác " "khi kết nối tín hiệu." #: ../../docs/getting_started/step_by_step/your_first_game.rst:108 msgid "Sprite animation" msgstr "Hoạt hình Sprite (Sprite animation)" #: ../../docs/getting_started/step_by_step/your_first_game.rst:110 #, fuzzy msgid "" "Click on the ``Player`` node and add an :ref:`AnimatedSprite " "` node as a child. The ``AnimatedSprite`` will handle " "the appearance and animations for our player. Notice that there is a warning " "symbol next to the node. An ``AnimatedSprite`` requires a :ref:`SpriteFrames " "` resource, which is a list of the animations it can " "display. To create one, find the ``Frames`` property in the Inspector and " "click \"[empty]\" -> \"New SpriteFrames\". Click again to open the " "\"SpriteFrames\" panel:" msgstr "" "Nhấp vào node ``Player`` và thêm node: ref: `AnimatedSprite " "` như là node con. ``AnimatedSprite`` sẽ xử lý sự xuất " "hiện và hình ảnh động cho player của chúng tôi. Lưu ý rằng có một biểu tượng " "cảnh báo bên cạnh node. Một``AnimatedSprite`` yêu cầu tài nguyên: ref: " "`SpriteFrames `, đây là danh sách các hình ảnh động mà " "nó có thể hiển thị. Để tạo một cái, hãy tìm thuộc tính ``Frames`` trong " "Inspector và bấm \"[empty]\" -> \"New SpriteFrames\". Điều này sẽ tự động " "mở bảng SpriteFrames." #: ../../docs/getting_started/step_by_step/your_first_game.rst:121 #, fuzzy msgid "" "On the left is a list of animations. Click the \"default\" one and rename it " "to \"walk\". Then click the \"New Animation\" button to create a second " "animation named \"up\". Find the player images in the \"FileSystem\" tab - " "they're in the ``art`` folder you unzipped earlier. Drag the two images for " "each animation, named ``playerGrey_up[1/2]`` and ``playerGrey_walk[1/2]``, " "into the \"Animation Frames\" side of the panel for the corresponding " "animation:" msgstr "" "Bên trái là danh sách các hình ảnh động. Nhấp vào \"default\" và đổi tên " "thành \"right\". Sau đó nhấp vào nút \"Add\" để tạo hình động thứ hai có tên " "\"up\". Kéo hai hình ảnh cho mỗi hình ảnh động, được đặt tên là " "``playerGrey_up [1/2] `` và ``playerGrey_walk [1/2] ``, vào bên cạnh " "\"Animation Frames\" vào bên cạnh của bảng:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:130 msgid "" "The player images are a bit too large for the game window, so we need to " "scale them down. Click on the ``AnimatedSprite`` node and set the ``Scale`` " "property to ``(0.5, 0.5)``. You can find it in the Inspector under the " "``Node2D`` heading." msgstr "" "Hình ảnh player hơi lớn so với cửa sổ trò chơi, vì vậy chúng tôi cần thu nhỏ " "chúng xuống. Nhấp vào node ``AnimatedSprite`` và đặt thuộc tính ``Scale`` " "thành `` (0,5, 0,5) ``. Bạn có thể tìm thấy nó trong Inspector dưới tiêu đề " "`` Node2D``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:137 msgid "" "Finally, add a :ref:`CollisionShape2D ` as a child " "of ``Player``. This will determine the player's \"hitbox\", or the bounds of " "its collision area. For this character, a ``CapsuleShape2D`` node gives the " "best fit, so next to \"Shape\" in the Inspector, click \"[empty]\"\" -> " "\"New CapsuleShape2D\". Using the two size handles, resize the shape to " "cover the sprite:" msgstr "" "Cuối cùng, thêm một: ref: `CollisionShape2D ` khi là " "con của `` Player``. Điều này sẽ xác định \"hitbox\" của player, hoặc giới " "hạn của khu vực va chạm của nó. Đối với nhân vật này, node `` " "CapsuleShape2D`` mang lại sự phù hợp nhất, vì vậy, bên cạnh \"Shape\" trong " "Inspector, nhấp vào \"[empty]\" \"->\"New CapsuleShape2D\". Sử dụng hai tay " "cầm kích thước, thay đổi kích thước hình dạng thành che sprite:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:146 #, fuzzy msgid "When you're finished, your ``Player`` scene should look like this:" msgstr "Khi bạn kết thúc, cảnh `` Player`` của bạn sẽ giống như thế này:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:150 msgid "Make sure to save the scene again after these changes." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:153 msgid "Moving the player" msgstr "Di chuyển player" #: ../../docs/getting_started/step_by_step/your_first_game.rst:155 #, fuzzy msgid "" "Now we need to add some functionality that we can't get from a built-in " "node, so we'll add a script. Click the ``Player`` node and click the " "\"Attach Script\" button:" msgstr "" "Bây giờ chúng tôi cần thêm một số chức năng mà chúng tôi không thể có được " "từ một node tích hợp, vì vậy chúng tôi sẽ thêm một tập lệnh. Nhấp vào nút `` " "Player`` và nhấp vào nút \"Thêm tập lệnh\":" #: ../../docs/getting_started/step_by_step/your_first_game.rst:161 msgid "" "In the script settings window, you can leave the default settings alone. " "Just click \"Create\":" msgstr "" "Trong cửa sổ cài đặt tập lệnh, bạn có thể để các cài đặt mặc định. Chỉ cần " "nhấp vào \"Create\":" #: ../../docs/getting_started/step_by_step/your_first_game.rst:164 msgid "" "If you're creating a C# script or other languages, select the language from " "the `language` drop down menu before hitting create." msgstr "" "Nếu bạn đang tạo tập lệnh C # hoặc các ngôn ngữ khác, hãy chọn ngôn ngữ từ " "trình đơn thả xuống `language 'trước khi nhấn tạo." #: ../../docs/getting_started/step_by_step/your_first_game.rst:169 msgid "" "If this is your first time encountering GDScript, please read :ref:" "`doc_scripting` before continuing." msgstr "" "Nếu đây là lần đầu tiên bạn làm việc với GDScript, vui lòng đọc: ref: " "`doc_scripting` trước khi tiếp tục." #: ../../docs/getting_started/step_by_step/your_first_game.rst:172 #, fuzzy msgid "Start by declaring the member variables this object will need:" msgstr "" "Bắt đầu bằng cách khai báo các biến thành viên mà đối tượng này sẽ cần:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:193 msgid "" "Using the ``export`` keyword on the first variable ``speed`` allows us to " "set its value in the Inspector. This can be handy for values that you want " "to be able to adjust just like a node's built-in properties. Click on the " "``Player`` node and you'll see the property now appears in the \"Script " "Variables\" section of the Inspector. Remember, if you change the value " "here, it will override the value written in the script." msgstr "" "Sử dụng từ khóa ``export`` trên biến đầu tiên ``speed`` cho phép chúng ta " "đặt giá trị của nó trong Inspector. Điều này có thể hữu ích cho các giá trị " "mà bạn muốn có thể điều chỉnh giống như các thuộc tính tích hợp của node. " "Nhấp vào node ``Player`` và bạn sẽ thấy thuộc tính hiện xuất hiện trong phần " "\"Script Variables\" của Inspector. Hãy nhớ rằng, nếu bạn thay đổi giá trị ở " "đây, nó sẽ ghi đè giá trị được ghi trong tập lệnh." #: ../../docs/getting_started/step_by_step/your_first_game.rst:200 msgid "" "If you're using C#, you need to (re)build the project assemblies whenever " "you want to see new export variables or signals. This build can be manually " "triggered by clicking the word \"Mono\" at the bottom of the editor window " "to reveal the Mono Panel, then clicking the \"Build Project\" button." msgstr "" "Nếu bạn đang sử dụng C #, bạn cần (tái) xây dựng các cụm dự án bất cứ khi " "nào bạn muốn xem các biến hoặc tín hiệu xuất mới. Bản dựng này có thể được " "kích hoạt thủ công bằng cách nhấp vào từ \"Mono\" ở dưới cùng của cửa sổ " "trình chỉnh sửa để hiển thị Bảng điều khiển Mono, sau đó nhấp vào nút " "\"Build Project\"." #: ../../docs/getting_started/step_by_step/your_first_game.rst:208 msgid "" "The ``_ready()`` function is called when a node enters the scene tree, which " "is a good time to find the size of the game window:" msgstr "" "Hàm ``_ready()`` được gọi khi một node đi vào scene tree, đây là thời điểm " "tốt để tìm kích thước của cửa sổ trò chơi:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:224 msgid "" "Now we can use the ``_process()`` function to define what the player will " "do. ``_process()`` is called every frame, so we'll use it to update elements " "of our game, which we expect will change often. For the player, we need to " "do the following:" msgstr "" "Bây giờ chúng ta có thể sử dụng hàm `` _ process () `` để xác định những gì " "player sẽ làm. `` _ process () `` được gọi trên mọi khung hình, vì vậy chúng " "tôi sẽ sử dụng nó để cập nhật các yếu tố trong trò chơi của chúng tôi, điều " "mà chúng tôi mong đợi sẽ thay đổi thường xuyên. Đối với player, chúng ta cần " "làm như sau:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:229 msgid "Check for input." msgstr "Kiểm tra đầu vào." #: ../../docs/getting_started/step_by_step/your_first_game.rst:230 msgid "Move in the given direction." msgstr "Di chuyển theo hướng đã cho." #: ../../docs/getting_started/step_by_step/your_first_game.rst:231 msgid "Play the appropriate animation." msgstr "Bật hoạt hình thích hợp." #: ../../docs/getting_started/step_by_step/your_first_game.rst:233 msgid "" "First, we need to check for input - is the player pressing a key? For this " "game, we have 4 direction inputs to check. Input actions are defined in the " "Project Settings under \"Input Map\". Here, you can define custom events and " "assign different keys, mouse events, or other inputs to them. For this demo, " "we will use the default events that are assigned to the arrow keys on the " "keyboard." msgstr "" "Đầu tiên, chúng ta cần kiểm tra các nút đầu vào - player có đang bấm 1 phím " "nào không ? Đối với trò chơi này, chúng tôi có 4 đầu vào hướng để kiểm tra. " "Các hành động đầu vào được xác định trong Project Settings trong \"Input Map" "\". Tại đây, bạn có thể xác định các sự kiện tùy chỉnh và gán các phím, sự " "kiện chuột hoặc các đầu vào khác cho chúng. Đối với bản demo này, chúng tôi " "sẽ sử dụng các sự kiện mặc định được gán cho các phím mũi tên trên bàn phím." #: ../../docs/getting_started/step_by_step/your_first_game.rst:240 #, fuzzy msgid "" "You can detect whether a key is pressed using ``Input.is_action_pressed()``, " "which returns ``true`` if it's pressed or ``false`` if it isn't." msgstr "" "Bạn có thể phát hiện liệu một phím được nhấn bằng cách sử dụng `` Input." "is_action_pressed ()``, sẽ trả về `` true`` nếu nó được nhấn hoặc `` false`` " "nếu không." #: ../../docs/getting_started/step_by_step/your_first_game.rst:302 #, fuzzy msgid "" "We start by setting the ``velocity`` to ``(0, 0)`` - by default, the player " "should not be moving. Then we check each input and add/subtract from the " "``velocity`` to obtain a total direction. For example, if you hold ``right`` " "and ``down`` at the same time, the resulting ``velocity`` vector will be " "``(1, 1)``. In this case, since we're adding a horizontal and a vertical " "movement, the player would move *faster* diagonally than if it just moved " "horizontally." msgstr "" "Chúng ta bắt đầu bằng cách đặt ``velocity`` thành ``(0, 0)`` - theo mặc " "định, player không nên di chuyển. Sau đó, chúng ta kiểm tra từng đầu vào và " "cộng / trừ từ ``velocity`` để có được tổng hướng. Ví dụ: nếu bạn giữ " "``right`` và ``down`` cùng một lúc, vectơ ``velocity`` sẽ là ``(1, 1)``. " "Trong trường hợp này, vì chúng ta đang thêm một chuyển động ngang và dọc, " "player sẽ di chuyển * nhanh hơn * so với khi nó chỉ di chuyển theo chiều " "ngang." #: ../../docs/getting_started/step_by_step/your_first_game.rst:309 #, fuzzy msgid "" "We can prevent that if we *normalize* the velocity, which means we set its " "*length* to ``1``, then multiply by the desired speed. This means no more " "fast diagonal movement." msgstr "" "Chúng ta có thể ngăn chặn điều đó nếu chúng ta *normalize* (bình thường hóa) " "vận tốc, có nghĩa là chúng ta đặt *length* (chiều dài) của nó thành `` 1`` " "và nhân với tốc độ mong muốn. Điều này có nghĩa là không có chuyển động chéo " "nhanh hơn." #: ../../docs/getting_started/step_by_step/your_first_game.rst:313 #, fuzzy msgid "" "If you've never used vector math before, or need a refresher, you can see an " "explanation of vector usage in Godot at :ref:`doc_vector_math`. It's good to " "know but won't be necessary for the rest of this tutorial." msgstr "" "Nếu bạn chưa bao giờ sử dụng toán học vectơ trước đây hoặc cần làm mới, bạn " "có thể xem giải thích về việc sử dụng vectơ trong Godot tại: ref: " "`doc_vector_math`. Thật tốt khi biết nhưng sẽ không cần thiết cho phần còn " "lại của hướng dẫn này." #: ../../docs/getting_started/step_by_step/your_first_game.rst:317 #, fuzzy msgid "" "We also check whether the player is moving so we can call ``play()`` or " "``stop()`` on the AnimatedSprite." msgstr "" "Chúng tôi cũng kiểm tra xem player có di chuyển hay không để chúng tôi có " "thể bắt đầu hoặc dừng hoạt hình AnimatedSprite." #: ../../docs/getting_started/step_by_step/your_first_game.rst:320 msgid "" "``$`` is shorthand for ``get_node()``. So in the code above, ``" "$AnimatedSprite.play()`` is the same as ``get_node(\"AnimatedSprite\")." "play()``." msgstr "" "``$`` là viết tắt của ``get_node ()``. Vì vậy, trong đoạn mã trên, ``$ " "AnimatedSprite.play ()`` giống như ``get_node (\"AnimatedSprite\"). Play " "()``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:323 msgid "" "In GDScript, ``$`` returns the node at the relative path from the current " "node, or returns ``null`` if the node is not found. Since AnimatedSprite is " "a child of the current node, we can use ``$AnimatedSprite``." msgstr "" "Trong GDScript, ``$`` trả về node tại đường dẫn tương đối từ node hiện tại " "hoặc trả về ``null`` nếu không tìm thấy node. Vì AnimatedSprite là con của " "node hiện tại, chúng ta có thể sử dụng ``$ AnimatedSprite``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:326 #, fuzzy msgid "" "Now that we have a movement direction, we can update the player's position. " "We can also use ``clamp()`` to prevent it from leaving the screen. " "*Clamping* a value means restricting it to a given range. Add the following " "to the bottom of the ``_process`` function (make sure it's not indented " "under the `else`):" msgstr "" "Bây giờ chúng ta đã có hướng di chuyển, chúng ta có thể cập nhật vị trí của " "player và sử dụng ``clamp()`` để ngăn không cho nó rời khỏi màn hình bằng " "cách thêm phần sau vào dưới cùng của hàm ``_ process``:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:347 msgid "" "The `delta` parameter in the `_process()` function refers to the *frame " "length* - the amount of time that the previous frame took to complete. Using " "this value ensures that your movement will remain consistent even if the " "frame rate changes." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:352 msgid "" "Click \"Play Scene\" (``F6``) and confirm you can move the player around the " "screen in all directions." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:355 msgid "If you get an error in the \"Debugger\" panel that says" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:357 msgid "" "``Attempt to call function 'play' in base 'null instance' on a null " "instance``" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:359 #, fuzzy msgid "" "this likely means you spelled the name of the AnimatedSprite node wrong. " "Node names are case-sensitive and ``$NodeName`` must match the name you see " "in the scene tree." msgstr "" "Nếu bạn gặp lỗi trong bảng \"Debugger\" đề cập đến \"null instance\", điều " "này có thể có nghĩa là bạn đã viết sai tên node. Tên node có phân biệt chữ " "hoa chữ thường và ``$NodeName`` hoặc ``get_node (\"NodeName\")`` phải khớp " "với tên bạn nhìn thấy trong scene tree." #: ../../docs/getting_started/step_by_step/your_first_game.rst:364 msgid "Choosing animations" msgstr "Chọn hình ảnh động (animation)" #: ../../docs/getting_started/step_by_step/your_first_game.rst:366 #, fuzzy msgid "" "Now that the player can move, we need to change which animation the " "AnimatedSprite is playing based on its direction. We have the \"walk\" " "animation, which shows the player walking to the right. This animation " "should be flipped horizontally using the ``flip_h`` property for left " "movement. We also have the \"up\" animation, which should be flipped " "vertically with ``flip_v`` for downward movement. Let's place this code at " "the end of the ``_process()`` function:" msgstr "" "Bây giờ player có thể di chuyển, chúng ta cần thay đổi hoạt hình nào mà " "AnimatedSprite đang phát dựa trên hướng mà player sẽ di chuyển. Chúng ta có " "một hình động \"right\", nên được lật theo chiều ngang bằng cách sử dụng " "thuộc tính ``flip_h`` cho chuyển động bên trái và một hình động \"up\", nên " "được lật theo chiều dọc với `` flip_v`` cho chuyển động đi xuống. Chúng ta " "hãy đặt mã này vào cuối hàm ``_ process ()`` của chúng ta:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:401 #, fuzzy msgid "" "The boolean assignments in the code above are a common shorthand for " "programmers. Since we're doing a comparison test (boolean) and also " "*assigning* a boolean value, we can do both at the same time. Consider this " "code versus the one-line boolean assignment above:" msgstr "" "Các phép gán boolean trong đoạn mã trên là một cách viết tắt phổ biến cho " "các lập trình viên. Xem xét mã này so với phép gán boolean rút gọn ở trên:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:425 msgid "" "Play the scene again and check that the animations are correct in each of " "the directions." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:428 msgid "" "A common mistake here is to type the names of the animations wrong. The " "animation names in the SpriteFrames panel must match what you type in the " "code. If you named the animation ``\"Walk\"``, you must also use a capital " "\"W\" in the code." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:433 #, fuzzy msgid "" "When you're sure the movement is working correctly, add this line to " "``_ready()``, so the player will be hidden when the game starts:" msgstr "" "Phát lại cảnh và kiểm tra xem các hình động có chính xác theo từng hướng " "không. Khi bạn chắc chắn rằng chuyển động đang hoạt động chính xác, hãy thêm " "dòng này vào ``_ready()``, để player sẽ bị ẩn khi trò chơi bắt đầu:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:446 msgid "Preparing for collisions" msgstr "Chuẩn bị va chạm" #: ../../docs/getting_started/step_by_step/your_first_game.rst:448 msgid "" "We want ``Player`` to detect when it's hit by an enemy, but we haven't made " "any enemies yet! That's OK, because we're going to use Godot's *signal* " "functionality to make it work." msgstr "" "Chúng ta muốn `` Player`` phát hiện khi nó tấn công kẻ thù, nhưng chúng tôi " "chưa tạo ra bất kỳ kẻ thù nào! Không sao, vì chúng ta sẽ sử dụng chức năng * " "signal * của Godot để làm cho nó hoạt động." #: ../../docs/getting_started/step_by_step/your_first_game.rst:452 msgid "Add the following at the top of the script, after ``extends Area2d``:" msgstr "Thêm phần sau vào đầu tập lệnh, sau ``extends Area2d``:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:466 msgid "" "This defines a custom signal called \"hit\" that we will have our player " "emit (send out) when it collides with an enemy. We will use ``Area2D`` to " "detect the collision. Select the ``Player`` node and click the \"Node\" tab " "next to the Inspector tab to see the list of signals the player can emit:" msgstr "" "Điều này xác định một tín hiệu tùy chỉnh được gọi là \"hit\" mà chúng ta sẽ " "có người chơi phát ra (gửi đi) khi nó va chạm với kẻ thù. Chúng tôi sẽ sử " "dụng ``Area2D`` để phát hiện va chạm. Chọn nút ``Player`` và nhấp vào tab " "\"Node\" bên cạnh tab Inspector để xem danh sách các signal mà player có thể " "phát ra:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:473 #, fuzzy msgid "" "Notice our custom \"hit\" signal is there as well! Since our enemies are " "going to be ``RigidBody2D`` nodes, we want the ``body_entered(body: Node)`` " "signal. This signal will be emitted when a body contacts the player. Click " "\"Connect..\" and the \"Connect a Signal\" window appears. We don't need to " "change any of these settings so click \"Connect\" again. Godot will " "automatically create a function in your player's script." msgstr "" "Lưu ý tín hiệu \"hit\" tùy chỉnh của chúng ta là có! Vì kẻ thù của chúng ta " "sẽ là các node `` RigidBody2D``, nên chúng ta muốn tín hiệu ``body_entered " "(Object body)``; điều này sẽ được phát ra khi một cơ thể tiếp xúc với " "player. Nhấp vào \"Connect..\" và sau đó \"Connect\" lại trên cửa sổ " "\"Connecting Signal\". Chúng ta không cần thay đổi bất kỳ cài đặt nào trong " "số này - Godot sẽ tự động tạo một chức năng trong tập lệnh củaplayer của " "bạn. Hàm này sẽ được gọi bất cứ khi nào tín hiệu được phát ra - nó * xử lý * " "tín hiệu." #: ../../docs/getting_started/step_by_step/your_first_game.rst:482 msgid "" "Note the green icon indicating that a signal is connected to this function. " "Add this code to the function:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:502 msgid "" "Each time an enemy hits the player, the signal is going to be emitted. We " "need to disable the player's collision so that we don't trigger the ``hit`` " "signal more than once." msgstr "" "Mỗi khi kẻ địch tấn công player, tín hiệu sẽ được phát ra. Chúng ta cần phải " "vô hiệu hóa va chạm của player để không kích hoạt tín hiệu `` hit`` nhiều " "lần." #: ../../docs/getting_started/step_by_step/your_first_game.rst:506 #, fuzzy msgid "" "Disabling the area's collision shape can cause an error if it happens in the " "middle of the engine's collision processing. Using ``set_deferred()`` tells " "Godot to wait to disable the shape until it's safe to do so." msgstr "" "Vô hiệu hóa hình dạng va chạm của khu vực có thể gây ra lỗi nếu nó xảy ra ở " "giữa quá trình xử lý va chạm của engine. Sử dụng ``set_deferred()`` cho phép " "chúng ta chờ Godot chờ để vô hiệu hóa hình dạng cho đến khi an toàn để làm " "như vậy." #: ../../docs/getting_started/step_by_step/your_first_game.rst:510 #, fuzzy msgid "" "The last piece is to add a function we can call to reset the player when " "starting a new game." msgstr "" "Phần cuối cùng cho player của chúng ta là thêm một chức năng mà chúng ta có " "thể gọi để đặt lại player khi bắt đầu trò chơi mới." #: ../../docs/getting_started/step_by_step/your_first_game.rst:531 msgid "Enemy scene" msgstr "Cảnh kẻ thù" #: ../../docs/getting_started/step_by_step/your_first_game.rst:533 #, fuzzy msgid "" "Now it's time to make the enemies our player will have to dodge. Their " "behavior will not be very complex: mobs will spawn randomly at the edges of " "the screen, choose a random direction, and move in a straight line." msgstr "" "Bây giờ là lúc để làm cho kẻ thù, player của chúng ta sẽ phải né tránh. Hành " "vi của chúng sẽ không phức tạp lắm: các mob sẽ sinh sản ngẫu nhiên ở các " "cạnh của màn hình và di chuyển theo hướng ngẫu nhiên theo một đường thẳng, " "sau đó biến mất khi chúng rời khỏi màn hình." #: ../../docs/getting_started/step_by_step/your_first_game.rst:537 #, fuzzy msgid "" "We'll create a ``Mob`` scene, which we can then *instance* to create any " "number of independent mobs in the game." msgstr "" "Chúng tôi sẽ xây dựng cảnh này thành một cảnh `` Mob``, sau đó chúng tôi có " "thể *instance* để tạo bất kỳ số lượng mob độc lập nào trong trò chơi." #: ../../docs/getting_started/step_by_step/your_first_game.rst:540 msgid "See :ref:`doc_instancing` to learn more about instancing." msgstr "Xem: ref:`doc_instancing` để tìm hiểu thêm về cách sử dụng instance." #: ../../docs/getting_started/step_by_step/your_first_game.rst:543 msgid "Node setup" msgstr "Thiết lập node" #: ../../docs/getting_started/step_by_step/your_first_game.rst:545 #, fuzzy msgid "Click Scene -> New Scene and add the following nodes:" msgstr "Nhấp vào Scene -> New Scene và chúng tôi sẽ tạo Mob." #: ../../docs/getting_started/step_by_step/your_first_game.rst:547 msgid ":ref:`RigidBody2D ` (named ``Mob``)" msgstr ":ref:`RigidBody2D ` (tên là `` Mob``)" #: ../../docs/getting_started/step_by_step/your_first_game.rst:549 msgid ":ref:`AnimatedSprite `" msgstr ":ref:`AnimatedSprite `" #: ../../docs/getting_started/step_by_step/your_first_game.rst:550 msgid ":ref:`CollisionShape2D `" msgstr ":ref:`CollisionShape2D `" #: ../../docs/getting_started/step_by_step/your_first_game.rst:551 #, fuzzy msgid ":ref:`VisibilityNotifier2D `" msgstr "" ":ref:`VisibilityNotifier2D ` (tên là " "``Visibility``)" #: ../../docs/getting_started/step_by_step/your_first_game.rst:553 msgid "" "Don't forget to set the children so they can't be selected, like you did " "with the Player scene." msgstr "" "Đừng quên đặt children để chúng không thể được chọn, giống như bạn đã làm " "với cảnh Player." #: ../../docs/getting_started/step_by_step/your_first_game.rst:556 msgid "" "In the :ref:`RigidBody2D ` properties, set ``Gravity " "Scale`` to ``0``, so the mob will not fall downward. In addition, under the " "``PhysicsBody2D`` section, click the ``Mask`` property and uncheck the first " "box. This will ensure the mobs do not collide with each other." msgstr "" "Trong các thuộc tính: ref:`RigidBody2D `, đặt ``Gravity " "Scale`` thành ``0``, vì vậy mob sẽ không rơi xuống. Ngoài ra, trong phần " "``ChemistryBody2D``, nhấp vào thuộc tính ``Mask`` và bỏ chọn hộp đầu tiên. " "Điều này sẽ đảm bảo các mob không va chạm với nhau." #: ../../docs/getting_started/step_by_step/your_first_game.rst:563 #, fuzzy msgid "" "Set up the :ref:`AnimatedSprite ` like you did for the " "player. This time, we have 3 animations: ``fly``, ``swim``, and ``walk``. " "There are two images for each animation in the art folder." msgstr "" "Thiết lập: ref: `AnimatedSprite ` giống như bạn đã làm " "cho player. Lần này, chúng ta có 3 hình ảnh động: ``fly``, ``swim`` và " "``walk``. Đặt thuộc tính ``Playing`` trong Inspector thành \"On\" và điều " "chỉnh cài đặt \"Speed (FPS)\" như hiển thị bên dưới. Chúng tôi sẽ chọn một " "trong những hình ảnh động này một cách ngẫu nhiên để mob sẽ có một số loại." #: ../../docs/getting_started/step_by_step/your_first_game.rst:567 msgid "Adjust the \"Speed (FPS)\" to ``3`` for all animations." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:571 msgid "Set the ``Playing`` property in the Inspector to “On”." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:573 msgid "" "We'll select one of these animations randomly so that the mobs will have " "some variety." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:575 msgid "" "Like the player images, these mob images need to be scaled down. Set the " "``AnimatedSprite``'s ``Scale`` property to ``(0.75, 0.75)``." msgstr "" "Giống như hình ảnh player, những hình ảnh mob này cần được thu nhỏ lại. Đặt " "thuộc tính ``Scale`` của ``AnimatedSprite`` thành `` (0,75, 0,75) ``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:578 #, fuzzy msgid "" "As in the ``Player`` scene, add a ``CapsuleShape2D`` for the collision. To " "align the shape with the image, you'll need to set the ``Rotation Degrees`` " "property to ``90`` (under \"Transform\" in the Inspector)." msgstr "" "Như trong cảnh ``Player``, thêm ``CapsuleShape2D`` cho việc va chạm. Để căn " "chỉnh hình dạng với hình ảnh, bạn sẽ cần đặt thuộc tính ``Rotation Độ 'thành " "``90`` bên dưới ``Node2D``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:582 #, fuzzy msgid "Save the scene." msgstr "Cảnh người chơi" #: ../../docs/getting_started/step_by_step/your_first_game.rst:585 msgid "Enemy script" msgstr "Kịch bản kẻ thù" #: ../../docs/getting_started/step_by_step/your_first_game.rst:587 #, fuzzy msgid "Add a script to the ``Mob`` and add the following member variables:" msgstr "Thêm một tập lệnh vào `` Mob`` và thêm các biến thành viên sau:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:611 #, fuzzy msgid "" "When we spawn a mob, we'll pick a random value between ``min_speed`` and " "``max_speed`` for how fast each mob will move (it would be boring if they " "were all moving at the same speed)." msgstr "" "Khi chúng ta sinh ra một mob, chúng ta sẽ chọn một giá trị ngẫu nhiên giữa " "``min_speed`` và ``max_speed`` cho mỗi mob sẽ di chuyển nhanh như thế nào " "(sẽ rất nhàm chán nếu tất cả chúng đều di chuyển với cùng tốc độ). Chúng ta " "cũng có một mảng chứa tên của ba hình ảnh động, chúng tôi sẽ sử dụng để chọn " "một hình ảnh ngẫu nhiên. Hãy chắc chắn rằng bạn đã đánh vần những thứ này " "giống nhau trong tập lệnh và trong tài nguyên SpriteFrames." #: ../../docs/getting_started/step_by_step/your_first_game.rst:615 msgid "" "Now let's look at the rest of the script. In ``_ready()`` we randomly choose " "one of the three animation types:" msgstr "" "Bây giờ hãy xem phần còn lại của kịch bản. Trong ``_ready()``, chúng ta chọn " "ngẫu nhiên một trong ba loại hoạt hình:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:635 msgid "" "First, we get the list of animation names from the AnimatedSprite's " "``frames`` property. This returns an Array containing all three animation " "names: ``[\"walk\", \"swim\", \"fly\"]``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:639 msgid "" "We then need to pick a random number between ``0`` and ``2`` to select one " "of these names from the list (array indices start at ``0``). ``randi() % n`` " "selects a random integer between ``0`` and ``n-1``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:643 #, fuzzy msgid "" "You must use ``randomize()`` if you want your sequence of \"random\" numbers " "to be different every time you run the scene. We're going to use " "``randomize()`` in our ``Main`` scene, so we won't need it here." msgstr "" "Bạn phải sử dụng ``Randomize()`` nếu bạn muốn chuỗi số \"ngẫu nhiên\" của " "mình khác nhau mỗi khi bạn chạy cảnh. Chúng ta sẽ sử dụng ``Randomize()`` " "trong cảnh ``Main`` của chúng ta, vì vậy chúng ta sẽ không cần nó ở đây. " "``randi ()% n`` là cách tiêu chuẩn để lấy một số nguyên ngẫu nhiên giữa " "``0`` và ``n-1``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:647 #, fuzzy msgid "" "The last piece is to make the mobs delete themselves when they leave the " "screen. Connect the ``screen_exited()`` signal of the " "``VisibilityNotifier2D`` node and add this code:" msgstr "" "Phần cuối cùng là làm cho mob tự xóa khi họ rời khỏi màn hình. Kết nối tín " "hiệu ``screen_exited()`` của node ``Visibility`` và thêm mã này:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:664 #, fuzzy msgid "This completes the `Mob` scene." msgstr "Điều này hoàn thành cảnh `Mob`." #: ../../docs/getting_started/step_by_step/your_first_game.rst:667 msgid "Main scene" msgstr "Cảnh chính" #: ../../docs/getting_started/step_by_step/your_first_game.rst:669 msgid "" "Now it's time to bring it all together. Create a new scene and add a :ref:" "`Node ` named ``Main``. Click the \"Instance\" button and select " "your saved ``Player.tscn``." msgstr "" "Bây giờ là lúc kết nối tất cả lại với nhau. Tạo một cảnh mới và thêm một: " "ref: `Node ` có tên ``Main``. Nhấp vào nút \"Instance\" và chọn " "`` Player.tscn`` đã lưu của bạn." #: ../../docs/getting_started/step_by_step/your_first_game.rst:675 msgid "" "Now, add the following nodes as children of ``Main``, and name them as shown " "(values are in seconds):" msgstr "" "Bây giờ, thêm các node sau dưới dạng con của ``Main`` và đặt tên cho chúng " "như được hiển thị (các giá trị được tính bằng giây):" #: ../../docs/getting_started/step_by_step/your_first_game.rst:678 msgid "" ":ref:`Timer ` (named ``MobTimer``) - to control how often mobs " "spawn" msgstr "" ":ref:`Timer ` (được đặt tên là ``MobTimer``) - để kiểm soát tần " "suất mob sinh sản" #: ../../docs/getting_started/step_by_step/your_first_game.rst:679 msgid "" ":ref:`Timer ` (named ``ScoreTimer``) - to increment the score " "every second" msgstr "" ":ref: `Timer ` (được đặt tên là ``ScoreTimer``) - để tăng điểm " "mỗi giây" #: ../../docs/getting_started/step_by_step/your_first_game.rst:680 msgid "" ":ref:`Timer ` (named ``StartTimer``) - to give a delay before " "starting" msgstr "" ":ref: `Timer ` (được đặt tên là ``StartTimer``) - để trì hoãn " "trước khi bắt đầu" #: ../../docs/getting_started/step_by_step/your_first_game.rst:681 msgid "" ":ref:`Position2D ` (named ``StartPosition``) - to indicate " "the player's start position" msgstr "" ":ref: `Position2D ` (được đặt tên là ``StartPocation``) - " "để chỉ vị trí bắt đầu của người chơi" #: ../../docs/getting_started/step_by_step/your_first_game.rst:683 msgid "" "Set the ``Wait Time`` property of each of the ``Timer`` nodes as follows:" msgstr "Đặt thuộc tính ``Wait Time`` của mỗi nút ``Timer`` như sau:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:686 msgid "``MobTimer``: ``0.5``" msgstr "``MobTimer``: ``0,5``" #: ../../docs/getting_started/step_by_step/your_first_game.rst:687 msgid "``ScoreTimer``: ``1``" msgstr "``ScoreTimer``: ``1``" #: ../../docs/getting_started/step_by_step/your_first_game.rst:688 msgid "``StartTimer``: ``2``" msgstr "``StartTimer``: ``2``" #: ../../docs/getting_started/step_by_step/your_first_game.rst:690 msgid "" "In addition, set the ``One Shot`` property of ``StartTimer`` to \"On\" and " "set ``Position`` of the ``StartPosition`` node to ``(240, 450)``." msgstr "" "Ngoài ra, đặt thuộc tính ``One Shot`` của ` `StartTimer`` thành \"On\" và " "đặt ` `Position`` của node ` `StartPocation`` thành` `(240, 450)` `." #: ../../docs/getting_started/step_by_step/your_first_game.rst:694 #, fuzzy msgid "Spawning mobs" msgstr "Mob sinh sản" #: ../../docs/getting_started/step_by_step/your_first_game.rst:696 msgid "" "The Main node will be spawning new mobs, and we want them to appear at a " "random location on the edge of the screen. Add a :ref:`Path2D " "` node named ``MobPath`` as a child of ``Main``. When you " "select ``Path2D``, you will see some new buttons at the top of the editor:" msgstr "" "Node Main sẽ sinh ra mob mới và chúng ta muốn chúng xuất hiện ở một vị trí " "ngẫu nhiên trên cạnh màn hình. Thêm một node: ref: `Path2D ` " "có tên `` MobPath`` như con của `` Main``. Khi bạn chọn ``Path2D``, bạn sẽ " "thấy một số nút mới ở đầu trình soạn thảo:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:703 #, fuzzy msgid "" "Select the middle one (\"Add Point\") and draw the path by clicking to add " "the points at the corners shown. To have the points snap to the grid, make " "sure \"Use Grid Snap\" is selected. This option can be found to the left of " "the \"Lock\" button, appearing as a magnet next to some intersecting lines." msgstr "" "Chọn điểm giữa (\"Add Point\") và vẽ đường dẫn bằng cách nhấp để thêm các " "điểm ở các góc được hiển thị. Để có các điểm được gắn vào grid (lưới), hãy " "đảm bảo đã chọn \"Snap to Grid\". Tùy chọn này có thể được tìm thấy dưới nút " "\"Snapping options\" ở bên trái nút \"Lock\", xuất hiện dưới dạng một loạt " "ba dấu chấm dọc." #: ../../docs/getting_started/step_by_step/your_first_game.rst:710 msgid "" "Draw the path in *clockwise* order, or your mobs will spawn pointing " "*outwards* instead of *inwards*!" msgstr "" "Vẽ đường dẫn theo thứ tự *clockwise* (*theo chiều kim đồng hồ*) hoặc mob của " "bạn sẽ sinh ra chỉ *ra ngoài* thay vì *vào trong*!" #: ../../docs/getting_started/step_by_step/your_first_game.rst:715 msgid "" "After placing point ``4`` in the image, click the \"Close Curve\" button and " "your curve will be complete." msgstr "" "Sau khi đặt điểm ``4`` trong ảnh, nhấp vào nút \"Close Curve\" và đường cong " "của bạn sẽ hoàn tất." #: ../../docs/getting_started/step_by_step/your_first_game.rst:718 msgid "" "Now that the path is defined, add a :ref:`PathFollow2D ` " "node as a child of ``MobPath`` and name it ``MobSpawnLocation``. This node " "will automatically rotate and follow the path as it moves, so we can use it " "to select a random position and direction along the path." msgstr "" "Bây giờ, đường dẫn đã được xác định, hãy thêm một node: ref: `PathFollow2D " "` làm con của ``MobPath`` và đặt tên cho nó là " "``MobSpawnLocation``. Node này sẽ tự động xoay và đi theo đường dẫn khi nó " "di chuyển, vì vậy chúng ta có thể sử dụng nó để chọn một vị trí và hướng " "ngẫu nhiên dọc theo đường dẫn." #: ../../docs/getting_started/step_by_step/your_first_game.rst:723 #, fuzzy msgid "Your scene should look like this:" msgstr "Scene tree của bạn sẽ trông như thế này:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:728 msgid "Main script" msgstr "Kịch bản cho Main scene" #: ../../docs/getting_started/step_by_step/your_first_game.rst:730 msgid "" "Add a script to ``Main``. At the top of the script, we use ``export " "(PackedScene)`` to allow us to choose the Mob scene we want to instance." msgstr "" "Thêm một tập lệnh vào ``Main``. Ở đầu tập lệnh, chúng tôi sử dụng ``export " "(PackedScene)`` để cho phép chúng ta chọn cảnh Mob mà chúng ta muốn." #: ../../docs/getting_started/step_by_step/your_first_game.rst:770 msgid "" "Click the ``Main`` node and you will see the ``Mob`` property in the " "Inspector under \"Script Variables\"." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:773 msgid "You can assign this property's value in two ways:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:775 #, fuzzy msgid "" "Drag ``Mob.tscn`` from the \"FileSystem\" panel and drop it in the ``Mob`` " "property ." msgstr "" "Kéo ``Mob.tscn`` từ bảng \"FileSystem\" và thả nó vào thuộc tính ``Mob`` " "trong Biến Script của nút `` Main``." #: ../../docs/getting_started/step_by_step/your_first_game.rst:777 msgid "" "Click the down arrow next to \"[empty]\" and choose \"Load\". Select ``Mob." "tscn``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:780 #, fuzzy msgid "" "Next, click on the Player and connect the ``hit`` signal. We want to make a " "new function named ``game_over``, which will handle what needs to happen " "when a game ends. Type \"game_over\" in the \"Receiver Method\" box at the " "bottom of the \"Connect a Signal\" window and click \"Connect\". Add the " "following code to the new function, as well as a ``new_game`` function that " "will set everything up for a new game:" msgstr "" "Tiếp theo, nhấp vào player và kết nối tín hiệu ``hit``. Chúng ta muốn tạo " "một hàm mới có tên ``game_over``, sẽ xử lý những gì cần xảy ra khi trò chơi " "kết thúc. Nhập \"game_over\" vào hộp \"Method In Node\" ở cuối cửa sổ " "\"Connecting Signal\". Thêm mã sau đây, cũng như hàm ``new_game`` để thiết " "lập mọi thứ cho trò chơi mới:" #: ../../docs/getting_started/step_by_step/your_first_game.rst:818 #, fuzzy msgid "" "Now connect the ``timeout()`` signal of each of the Timer nodes " "(``StartTimer``, ``ScoreTimer`` , and ``MobTimer``) to the main script. " "``StartTimer`` will start the other two timers. ``ScoreTimer`` will " "increment the score by 1." msgstr "" "Bây giờ kết nối tín hiệu ``timeout()`` của từng node Timer (``StartTimer``, " "``ScoreTimer`` và ``MobTimer``) với tập lệnh main. ``StartTimer`` sẽ bắt đầu " "hai bộ định thời khác. ``ScoreTimer`` sẽ tăng số điểm lên 1." #: ../../docs/getting_started/step_by_step/your_first_game.rst:845 msgid "" "In ``_on_MobTimer_timeout()``, we will create a mob instance, pick a random " "starting location along the ``Path2D``, and set the mob in motion. The " "``PathFollow2D`` node will automatically rotate as it follows the path, so " "we will use that to select the mob's direction as well as its position." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:851 msgid "" "Note that a new instance must be added to the scene using ``add_child()``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:899 msgid "" "Why ``PI``? In functions requiring angles, GDScript uses *radians*, not " "degrees. If you're more comfortable working with degrees, you'll need to use " "the ``deg2rad()`` and ``rad2deg()`` functions to convert between the two." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:905 #, fuzzy msgid "Testing the scene" msgstr "Script một scene" #: ../../docs/getting_started/step_by_step/your_first_game.rst:907 msgid "" "Let's test the scene to make sure everything is working. Add this to " "``_ready()``:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:924 msgid "" "Let's also assign ``Main`` as our \"Main Scene\" - the one that runs " "automatically when the game launches. Press the \"Play\" button and select " "``Main.tscn`` when prompted." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:928 msgid "" "You should be able to move the player around, see mobs spawning, and see the " "player disappear when hit by a mob." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:931 msgid "" "When you're sure everything is working, remove the call to ``new_game()`` " "from ``_ready()``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:935 msgid "HUD" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:937 msgid "" "The final piece our game needs is a UI: an interface to display things like " "score, a \"game over\" message, and a restart button. Create a new scene, " "and add a :ref:`CanvasLayer ` node named ``HUD``. \"HUD\" " "stands for \"heads-up display\", an informational display that appears as an " "overlay on top of the game view." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:943 msgid "" "The :ref:`CanvasLayer ` node lets us draw our UI elements " "on a layer above the rest of the game, so that the information it displays " "isn't covered up by any game elements like the player or mobs." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:947 msgid "The HUD needs to display the following information:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:949 msgid "Score, changed by ``ScoreTimer``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:950 msgid "A message, such as \"Game Over\" or \"Get Ready!\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:951 msgid "A \"Start\" button to begin the game." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:953 msgid "" "The basic node for UI elements is :ref:`Control `. To create " "our UI, we'll use two types of :ref:`Control ` nodes: :ref:" "`Label ` and :ref:`Button `." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:957 msgid "Create the following as children of the ``HUD`` node:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:959 msgid ":ref:`Label ` named ``ScoreLabel``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:960 msgid ":ref:`Label ` named ``Message``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:961 msgid ":ref:`Button ` named ``StartButton``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:962 msgid ":ref:`Timer ` named ``MessageTimer``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:964 msgid "" "Click on the ``ScoreLabel`` and type a number into the ``Text`` field in the " "Inspector. The default font for ``Control`` nodes is small and doesn't scale " "well. There is a font file included in the game assets called \"Xolonium-" "Regular.ttf\". To use this font, do the following:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:969 msgid "Under \"Custom Fonts\", choose \"New DynamicFont\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:973 msgid "" "Click on the \"DynamicFont\" you added, and under \"Font/Font Data\", choose " "\"Load\" and select the \"Xolonium-Regular.ttf\" file. You must also set the " "font's ``Size``. A setting of ``64`` works well." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:979 msgid "" "Once you've done this on the ``ScoreLabel``, you can click the down arrow " "next to the DynamicFont property and choose \"Copy\", then \"Paste\" it in " "the same place on the other two Control nodes." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:983 msgid "" "**Anchors and Margins:** ``Control`` nodes have a position and size, but " "they also have anchors and margins. Anchors define the origin - the " "reference point for the edges of the node. Margins update automatically when " "you move or resize a control node. They represent the distance from the " "control node's edges to its anchor. See :ref:" "`doc_design_interfaces_with_the_control_nodes` for more details." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:990 msgid "" "Arrange the nodes as shown below. Click the \"Layout\" button to set a " "Control node's layout:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:995 msgid "" "You can drag the nodes to place them manually, or for more precise " "placement, use the following settings:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:999 msgid "ScoreLabel" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1001 msgid "*Layout* : \"Top Wide\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1002 msgid "*Text* : ``0``" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1003 #: ../../docs/getting_started/step_by_step/your_first_game.rst:1010 msgid "*Align* : \"Center\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1006 msgid "Message" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1008 msgid "*Layout* : \"HCenter Wide\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1009 msgid "*Text* : ``Dodge the Creeps!``" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1011 msgid "*Autowrap* : \"On\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1014 msgid "StartButton" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1016 msgid "*Text* : ``Start``" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1017 msgid "*Layout* : \"Center Bottom\"" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1018 msgid "*Margin* :" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1020 msgid "Top: ``-200``" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1021 msgid "Bottom: ``-100``" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1023 msgid "" "On the ``MessageTimer``, set the ``Wait Time`` to ``2`` and set the ``One " "Shot`` property to \"On\"." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1026 msgid "Now add this script to ``HUD``:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1045 msgid "" "The ``start_game`` signal tells the ``Main`` node that the button has been " "pressed." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1067 msgid "" "This function is called when we want to display a message temporarily, such " "as \"Get Ready\"." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1100 msgid "" "This function is called when the player loses. It will show \"Game Over\" " "for 2 seconds, then return to the title screen and, after a brief pause, " "show the \"Start\" button." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1104 msgid "" "When you need to pause for a brief time, an alternative to using a Timer " "node is to use the SceneTree's ``create_timer()`` function. This can be very " "useful to add delays such as in the above code, where we want to wait some " "time before showing the \"Start\" button." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1122 msgid "This function is called by ``Main`` whenever the score changes." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1124 msgid "" "Connect the ``timeout()`` signal of ``MessageTimer`` and the ``pressed()`` " "signal of ``StartButton`` and add the following code to the new functions:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1152 msgid "Connecting HUD to Main" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1154 msgid "" "Now that we're done creating the ``HUD`` scene, go back to ``Main``. " "Instance the ``HUD`` scene in ``Main`` like you did the ``Player`` scene. " "The scene tree should look like this, so make sure you didn't miss anything:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1160 msgid "" "Now we need to connect the ``HUD`` functionality to our ``Main`` script. " "This requires a few additions to the ``Main`` scene:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1163 msgid "" "In the Node tab, connect the HUD's ``start_game`` signal to the " "``new_game()`` function of the Main node by typing \"new_game\" in the " "\"Receiver Method\" in the \"Connect a Signal\" window. Verify that the " "green connection icon now appears next to ``func new_game()`` in the script." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1168 msgid "" "In ``new_game()``, update the score display and show the \"Get Ready\" " "message:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1183 msgid "In ``game_over()`` we need to call the corresponding ``HUD`` function:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1194 msgid "" "Finally, add this to ``_on_ScoreTimer_timeout()`` to keep the display in " "sync with the changing score:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1206 msgid "" "Now you're ready to play! Click the \"Play the Project\" button. You will be " "asked to select a main scene, so choose ``Main.tscn``." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1210 msgid "Removing old creeps" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1212 msgid "" "If you play until \"Game Over\" and then start a new game right away, the " "creeps from the previous game may still be on the screen. It would be better " "if they all disappeared at the start of a new game. We just need a way to " "tell *all* the mobs to remove themselves. We can do this with the \"group\" " "feature." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1217 msgid "" "In the ``Mob`` scene, select the root node and click the \"Node\" tab next " "to the Inspector (the same place where you find the node's signals). Next to " "\"Signals\", click \"Groups\" and you can type a new group name and click " "\"Add\"." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1223 msgid "" "Now all mobs will be in the \"mobs\" group. We can then add the following " "line to the ``game_over()`` function in ``Main``:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1236 msgid "" "The ``call_group()`` function calls the named function on every node in a " "group - in this case we are telling every mob to delete itself." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1240 msgid "Finishing up" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1242 msgid "" "We have now completed all the functionality for our game. Below are some " "remaining steps to add a bit more \"juice\" to improve the game experience. " "Feel free to expand the gameplay with your own ideas." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1247 #: ../../docs/tutorials/3d/environment_and_post_processing.rst:59 msgid "Background" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1249 msgid "" "The default gray background is not very appealing, so let's change its " "color. One way to do this is to use a :ref:`ColorRect ` " "node. Make it the first node under ``Main`` so that it will be drawn behind " "the other nodes. ``ColorRect`` only has one property: ``Color``. Choose a " "color you like and select \"Layout\" -> \"Full Rect\" so that it covers the " "screen." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1255 msgid "" "You could also add a background image, if you have one, by using a " "``TextureRect`` node instead." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1259 msgid "Sound effects" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1261 msgid "" "Sound and music can be the single most effective way to add appeal to the " "game experience. In your game assets folder, you have two sound files: " "\"House In a Forest Loop.ogg\" for background music, and \"gameover.wav\" " "for when the player loses." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1266 msgid "" "Add two :ref:`AudioStreamPlayer ` nodes as children " "of ``Main``. Name one of them ``Music`` and the other ``DeathSound``. On " "each one, click on the ``Stream`` property, select \"Load\", and choose the " "corresponding audio file." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1271 msgid "" "To play the music, add ``$Music.play()`` in the ``new_game()`` function and " "``$Music.stop()`` in the ``game_over()`` function." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1274 msgid "Finally, add ``$DeathSound.play()`` in the ``game_over()`` function." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1277 msgid "Keyboard shortcut" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1279 msgid "" "Since the game is played with keyboard controls, it would be convenient if " "we could also start the game by pressing a key on the keyboard. We can do " "this with the \"Shortcut\" property of the ``Button`` node." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1283 msgid "" "In the ``HUD`` scene, select the ``StartButton`` and find its *Shortcut* " "property in the Inspector. Select \"New Shortcut\" and click on the " "\"Shortcut\" item. A second *Shortcut* property will appear. Select \"New " "InputEventAction\" and click the new \"InputEventAction\". Finally, in the " "*Action* property, type the name ``ui_select``. This is the default input " "event associated with the spacebar." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1291 msgid "" "Now when the start button appears, you can either click it or press :kbd:" "`Space` to start the game." msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1295 msgid "Project files" msgstr "" #: ../../docs/:1 msgid "You can find a completed version of this project at these locations:" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1298 msgid "https://github.com/kidscancode/Godot3_dodge/releases" msgstr "" #: ../../docs/getting_started/step_by_step/your_first_game.rst:1299 msgid "https://github.com/godotengine/godot-demo-projects" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:4 #: ../../docs/getting_started/editor/command_line_tutorial.rst:257 msgid "Exporting" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:9 msgid "" "Now that you have a working game, you probably want to share your success " "with others. However, it's not practical to ask your friends to download " "Godot just so they can open your project. Instead, you can *export* your " "project, converting it into a \"package\" that can be run by anyone." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:14 msgid "" "The way you export your game depends on what platform you are targeting. In " "this tutorial, you'll learn how to export the \"Dodge the Creeps\" game for " "a variety of platforms. First, however, we need to make some changes to the " "way the game works." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:19 msgid "" "If you haven't made \"Dodge the Creeps\" yourself yet, please read :ref:" "`doc_your_first_game` before continuing with this tutorial." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:23 msgid "Preparing the project" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:25 msgid "" "In \"Dodge the Creeps\" we used keyboard controls to move the player's " "character. This is fine if your game is being played on a PC platform, but " "on a phone or tablet, you need to support touchscreen input. Because a click " "event can be treated the same as a touch event, we'll convert the game to a " "click-and-move input style." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:31 msgid "" "By default Godot emulates mouse input from touch input. That means if " "anything is coded to happen on a mouse event, touch will trigger it as well. " "Godot can also emulate touch input from mouse clicks, which we will need to " "be able to keep playing our game on our computer after we switch to touch " "input. In the \"Project Settings\" under *Input Devices* and *Pointing*, set " "*Emulate Touch From Mouse* to \"On\"." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:39 msgid "" "We also want to ensure that the game scales consistently on different-sized " "screens, so in the project settings go to *Display*, then click on *Window*. " "In the *Stretch* options, set *Mode* to \"2d\" and *Aspect* to \"keep\"." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:43 msgid "" "Since we are already in the *Window* settings, we should also set under " "*Handheld* the *Orientation* to \"portrait\"." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:48 msgid "" "Next, we need to modify the ``Player.gd`` script to change the input method. " "We'll remove the key inputs and make the player move towards a \"target\" " "that's set by the touch (or click) event." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:52 msgid "" "Here is the full script for the player, with comments noting what we've " "changed:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:240 #, fuzzy msgid "Setting a main scene" msgstr "Script một scene" #: ../../docs/getting_started/step_by_step/exporting.rst:242 msgid "" "The main scene is the one that your game will start in. In *Project -> " "Project Settings -> Application -> Run*, set *Main Scene* to \"Main.tscn\" " "by clicking the folder icon and selecting it." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:247 #: ../../docs/getting_started/workflow/export/exporting_projects.rst:92 #: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:295 #: ../../docs/development/compiling/compiling_with_mono.rst:167 msgid "Export templates" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:249 msgid "" "In order to export, you need to download the *export templates* from the " "http://godotengine.org/download. These templates are optimized versions of " "the engine without the editor pre-compiled for each platform . You can also " "download them in Godot by clicking on *Editor -> Manage Export Templates*:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:256 msgid "" "In the window that appears, you can click \"Download\" to get the template " "version that matches your version of Godot." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:261 msgid "" "If you upgrade Godot, you must download templates that match the new version " "or your exported projects may not work correctly." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:265 msgid "Export presets" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:267 msgid "" "Next, you can configure the export settings by clicking on *Project -> " "Export*." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:269 msgid "" "Create a new export preset by clicking \"Add...\" and selecting a platform. " "You can make as many presets as you like with different settings." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:274 msgid "" "At the bottom of the window are two buttons. \"Export PCK/ZIP\" only creates " "a packed version of your project's data. This doesn't include an executable " "so the project can't be run on its own." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:278 msgid "" "The second button, \"Export Project\", creates a complete executable version " "of your game, such as an `.apk` for Android or an `.exe` for Windows." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:281 msgid "" "In the \"Resources\" and \"Features\" tabs, you can customize how the game " "is exported for each platform. We can leave those settings alone for now." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:285 msgid "Exporting by platform" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:287 msgid "" "In this section, we'll walk through the process for each platform, including " "any additional software or requirements you'll need." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:291 msgid "PC (Linux/macOS/Windows)" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:293 msgid "" "Exporting PC platforms works the same across the three supported operating " "systems. Open the export window and click \"Add..\" to create the preset(s) " "you want to make. Then click \"Export Project\" and choose a name and " "destination folder. Choose a location *outside* of your project folder." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:298 msgid "Click \"Save\" and the engine will build the export files." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:300 msgid "" "When exporting for macOS, if you export on a macOS computer, you'll end up " "with a `.dmg` file, while using Linux or Windows produces a `.zip`. In " "either case, the compressed file contains a macOS `.app` that you can double-" "click and run." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:305 msgid "" "On Windows, if you want your exported executable to have a different icon " "than the default one, you need to change it manually. See: :ref:" "`doc_changing_application_icon_for_windows`." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:312 msgid "" "Mobile devices come with a wide variety of capabilities. In most cases, " "Godot's default settings will work, but mobile development is sometimes more " "art than science, and you may need to do some experimenting and searching " "for help in order to get everything working." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:318 msgid "" "Before you can export your project for Android, you must download the " "following software:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:321 msgid "Android SDK: https://developer.android.com/studio/" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:322 msgid "" "Open JDK(version 8 is required, more recent versions won't work): https://" "adoptopenjdk.net/index.html" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:324 msgid "" "When you run Android Studio for the first time, click on *Configure -> SDK " "Manager* and install \"Android SDK Platform Tools\". This installs the `adb` " "command-line tool that Godot uses to communicate with your device." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:328 msgid "" "Next, create a debug keystore by running the following command on your " "system's command line:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:335 msgid "" "Click on *Editor -> Editor Settings* in Godot and select the *Export/" "Android* section. Here, you need to set the paths to the Android SDK " "applications on your system and the location of the keystore you just " "created." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:341 msgid "" "Now you're ready to export. Click on *Project -> Export* and add a preset " "for Android (see above). Select the Android Presets and under *Options* go " "to *Screen* and set *Orientation* to \"Portrait\"." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:345 msgid "" "Click the \"Export Project\" button and Godot will build an APK you can " "download on your device. To do this on the command line, use the following:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:352 msgid "" "Your device may need to be in *developer mode*. Consult your device's " "documentation for details." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:355 msgid "" "If your system supports it, connecting a compatible Android device will " "cause a \"One-click Deploy\" button to appear in Godot's playtest button " "area:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:360 msgid "" "Clicking this button builds the APK and copies it onto your device in one " "step." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:365 msgid "" "In order to build your game for iOS, you must have a computer running macOS " "with Xcode installed." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:368 msgid "" "Before exporting, there are some settings that you *must* complete for the " "project to export successfully. First, the \"App Store Team Id\", which you " "can find by logging in to your Apple developer account and looking in the " "\"Membership\" section." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:372 msgid "You must also provide icons and splash screen images as shown below:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:376 msgid "Click \"Export Project\" and select a destination folder." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:378 msgid "" "Once you have successfully exported the project, you'll find the following " "folders and files have been created in your selected location:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:383 msgid "" "You can now open the project in Xcode and build the project for iOS. Xcode " "build procedure is beyond the scope of this tutorial. See https://help.apple." "com/xcode/mac/current/#/devc8c2a6be1 for more information." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:389 msgid "HTML5 (web)" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:391 msgid "" "Click \"Export Project\" on the HTML5 preset. We don't need to change any of " "the default settings." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:394 msgid "" "When the export is complete, you'll have a folder containing the following " "files:" msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:399 msgid "" "Viewing the `.html` file in your browser lets you play the game. However, " "you can't open the file directly, it needs to be served by a web server. If " "you don't have one set up on your computer, you can search online to find " "suggestions for your specific OS." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:404 msgid "" "Point your browser at the URL where you've placed the html file. You may " "have to wait a few moments while the game loads before you see the start " "screen." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:409 msgid "" "The console window beneath the game tells you if anything goes wrong. You " "can disable it by setting \"Export With Debug\" off when you export the " "project." msgstr "" #: ../../docs/getting_started/step_by_step/exporting.rst:414 msgid "" "While WASM is supported in all major browsers, it is still an emerging " "technology and you may find some things that don't work. Make sure you have " "updated your browser to the most recent version, and report any bugs you " "find at the `Godot GitHub repository `_." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:4 msgid "Godot's design philosophy" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:6 msgid "Now that you've gotten your hands wet, let's talk about Godot's design." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:8 msgid "" "**Every game engine is different and fits different needs.** Not only do " "they offer a range of features, but the design of each engine is unique. " "This leads to different workflows and different ways to form your games' " "structures. This all stems from their respective design philosophies." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:13 msgid "" "This page is here to help you understand how Godot works, starting with some " "of its core pillars. It is not a list of available features, nor is it an " "engine comparison. To know if any engine can be a good fit for your project, " "you need to try it out for yourself and understand its design and " "limitations." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:19 msgid "" "Please watch `Discover Godot 3, the Free game engine `_ if you're looking for an overview of the engine's features." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:23 msgid "Object-oriented design and composition" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:25 msgid "" "Godot embraces object-oriented design at its core with its flexible scene " "system and Node hierarchy. It tries to stay away from strict programming " "patterns to offer an intuitive way to structure your game." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:29 msgid "" "For one, Godot lets you **compose or aggregate** scenes. It's like nested " "prefabs: you can create a BlinkingLight scene and a BrokenLantern scene that " "uses the BlinkingLight. Then, create a city filled with BrokenLanterns. " "Change the BlinkingLight's color, save, and all the BrokenLanterns in the " "city will update instantly." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:36 msgid "On top of that, you can **inherit** from any scene." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:38 msgid "" "A Godot scene could be a Weapon, a Character, an Item, a Door, a Level, part " "of a level… anything you'd like. It works like a class in pure code, except " "you're free to design it by using the editor, using only the code, or mixing " "and matching the two." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:43 msgid "" "It's different from prefabs you find in several 3D engines, as you can then " "inherit from and extend those scenes. You may create a Magician that extends " "your Character. Modify the Character in the editor and the Magician will " "update as well. It helps you build your projects so that their structure " "matches the game's design." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:49 #: ../../docs/tutorials/assetlib/using_assetlib.rst:16 #: ../../docs/tutorials/assetlib/uploading_to_assetlib.rst:82 msgid "|image0|" msgstr "| hình ảnh0 |" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:51 msgid "" "Also note that Godot offers many different types of objects called nodes, " "each with a specific purpose. Nodes are part of a tree and always inherit " "from their parents up to the Node class. Although the engine does feature " "components like collision shapes, they're the exception, not the norm." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:57 #: ../../docs/tutorials/assetlib/using_assetlib.rst:48 msgid "|image1|" msgstr "|hình1|" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:59 msgid "" "Sprite is a Node2D, a CanvasItem and a Node. It has all the properties and " "features of its three parent classes, like transforms or the ability to draw " "custom shapes and render with a custom shader." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:64 msgid "All-inclusive package" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:66 msgid "" "Godot tries to provide its own tools to answer most common needs. It has a " "dedicated scripting workspace, an animation editor, a tilemap editor, a " "shader editor, a debugger, a profiler, the ability to hot-reload locally and " "on remote devices, etc." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:71 #: ../../docs/tutorials/assetlib/using_assetlib.rst:58 msgid "|image2|" msgstr "|hình2|" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:73 msgid "" "The goal is to offer a full package to create games and a continuous user " "experience. You can still work with external programs as long as there is an " "import plugin for it. Or you can create one, like the `Tiled Map Importer " "`__." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:78 msgid "" "That is also partly why Godot offers its own programming languages GDscript " "and VisualScript, along with C#. They're designed for the needs of game " "developers and game designers, and they're tightly integrated in the engine " "and the editor." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:83 msgid "" "GDscript lets you write simple code using Python-like syntax, yet it detects " "types and offers a static language's quality of auto-completion. It is also " "optimized for gameplay code with built-in types like Vectors and Colors." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:87 msgid "" "Note that with GDNative, you can write high-performance code using compiled " "languages like C, C++, Rust, or Python (using the Cython compiler) without " "recompiling the engine." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:91 #: ../../docs/tutorials/assetlib/using_assetlib.rst:81 msgid "|image3|" msgstr "|hình3|" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:93 msgid "" "*VisualScript is a node-based programming language that integrates well in " "the editor. You can drag and drop nodes or resources into the graph to " "create new code blocks.*" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:97 msgid "" "Note that the 3D workspace doesn't feature as many tools as the 2D " "workspace. You'll need external programs or add-ons to edit terrains, " "animate complex characters, and so on. Godot provides a complete API to " "extend the editor's functionality using game code. See `The Godot editor is " "a Godot game`_ below." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:102 #: ../../docs/tutorials/assetlib/using_assetlib.rst:86 msgid "|image4|" msgstr "| hình ảnh4 |" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:104 msgid "" "*A State Machine editor plugin in Godot 2 by kubecz3k. It lets you manage " "states and transitions visually.*" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:108 msgid "Open source" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:110 msgid "" "Godot offers a fully open source codebase under the **MIT license**. This " "means all the technologies that ship with it have to be Free (as in freedom) " "as well. For the most part, they're developed from the ground up by " "contributors." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:115 msgid "" "Anyone can plug in proprietary tools for the needs of their projects — they " "just won't ship with the engine. This may include Google AdMob, or FMOD. Any " "of these can come as third-party plugins instead." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:120 msgid "" "On the other hand, an open codebase means you can **learn from and extend " "the engine** to your heart's content. You can also debug games easily, as " "Godot will print errors with a stack trace, even if they come from the " "engine itself." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:126 msgid "" "This **does not affect the work you do with Godot** in any way: there's no " "strings attached to the engine or anything you make with it." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:130 msgid "Community-driven" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:132 msgid "" "**Godot is made by its community, for the community, and for all game " "creators out there.** It's the needs of the users and open discussions that " "drive the core updates. New features from the core developers often focus on " "what will benefit the most users first." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:137 msgid "" "That said, although a handful of core developers work on it full-time, the " "project has over 600 contributors at the time of writing. Benevolent " "programmers work on features they may need themselves, so you'll see " "improvements in all corners of the engine at the same time in every major " "release." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:144 msgid "The Godot editor is a Godot game" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:146 msgid "" "The Godot editor runs on the game engine. It uses the engine's own UI " "system, it can hot-reload code and scenes when you test your projects, or " "run game code in the editor. This means you can **use the same code** and " "scenes for your games, or **build plugins and extend the editor.**" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:151 msgid "" "This leads to a reliable and flexible UI system, as it powers the editor " "itself. With the ``tool`` keyword, you can run any game code in the editor." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:154 #: ../../docs/tutorials/assetlib/using_assetlib.rst:90 msgid "|image5|" msgstr "| hình ảnh 5 |" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:156 msgid "" "*RPG in a Box is a voxel RPG editor made with Godot 2. It uses Godot's UI " "tools for its node-based programming system and for the rest of the " "interface.*" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:160 msgid "" "Put the ``tool`` keyword at the top of any GDScript file and it will run in " "the editor. This lets you import and export plugins, create plugins like " "custom level editors, or create scripts with the same nodes and API you use " "in your projects." msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:166 msgid "Separate 2D and 3D engines" msgstr "" #: ../../docs/getting_started/step_by_step/godot_design_philosophy.rst:168 msgid "" "Godot offers dedicated 2D and 3D rendering engines. As a result, **the base " "unit for 2D scenes is pixels.** Even though the engines are separate, you " "can render 2D in 3D, 3D in 2D, and overlay 2D sprites and interfaces over " "your 3D world." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:4 msgid "Design interfaces with the Control nodes" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:6 msgid "" "Computer displays, mobile phones, and TV screens come in all shapes and " "sizes. To ship a game, you'll need to support different screen ratios and " "resolutions. It can be hard to build responsive interfaces that adapt to all " "platforms. Thankfully, Godot comes with robust tools to design and manage a " "responsive User Interface." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:14 msgid "Godot's editor is made with the engine's UI framework" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:16 msgid "This guide will get you started with UI design. You will learn:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:18 msgid "The five most useful control nodes to build your games' interface" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:19 msgid "How to work with the anchor of UI elements" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:20 msgid "" "How to efficiently place and arrange your user interface using containers" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:22 msgid "" "The five most common containers (you can learn more about containers in the :" "ref:`GUI Containers ` documentation page)." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:25 msgid "" "To learn how to control the interface and connect it to other scripts, read :" "ref:`Build your first game UI in Godot `." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:28 msgid "" "To design your UI, you'll use the Control nodes. These are the nodes with " "green icons in the editor. There are dozens of them, for creating anything " "from life bars to complex applications. Godot's editor itself is built using " "Control nodes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:32 msgid "" "Control nodes have unique properties that allow them to work well with one " "another. Other visual nodes, like Node2D and Sprite don't have these " "capabilities. So to make your life easier use Control nodes wherever " "possible when building your UIs." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:36 msgid "All control nodes share the same main properties:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:38 msgid "Anchor" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:39 msgid "Bounding rectangle" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:40 msgid "Focus and focus neighbor" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:41 #: ../../docs/tutorials/gui/gui_containers.rst:38 msgid "Size flags" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:42 msgid "Margin" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:43 msgid "The optional UI theme" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:45 msgid "" "Once you understand the basics of the Control node, it will take you less " "time to learn all the nodes that derive from it." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:50 msgid "The 5 most common UI elements" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:52 msgid "" "Godot ships with dozens of Control nodes. A lot of them are here to help you " "build editor plugins and applications." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:55 msgid "" "For most games, you'll only need five types of UI elements, and a few " "Containers. These five Control nodes are:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:58 msgid "Label: for displaying text" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:59 msgid "" "TextureRect: used mostly for backgrounds, or everything that should be a " "static image" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:61 msgid "" "TextureProgress: for lifebars, loading bars, horizontal, vertical or radial" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:63 msgid "NinePatchRect: for scalable panels" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:64 msgid "TextureButton: to create buttons" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:68 msgid "The 5 most common Control nodes for UI design" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:71 msgid "TextureRect" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:73 msgid "" "**TextureRect** displays a texture or image inside a UI. It seems similar to " "the Sprite node, but it offers multiple scaling modes. Set the Stretch Mode " "property to change its behavior:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:77 msgid "" "``Scale On Expand (compat)`` scales the texture to fit the node's bounding " "rectangle, only if ``expand`` property is ``true``; otherwise, it behaves " "like ``Keep`` mode. Default mode for backwards compatibility." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:80 msgid "``Scale`` scales the texture to fit the node's bounding rectangle." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:81 msgid "``Tile`` makes the texture repeat, but it won't scale." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:82 msgid "" "``Keep`` and ``Keep Centered`` force the texture to remain at its original " "size, in the top left corner or the center of the frame respectively." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:85 msgid "" "``Keep Aspect`` and ``Keep Aspect Centered`` scales the texture but force it " "to remain its original aspect ratio, in the top left corner or the center of " "the frame respectively." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:87 msgid "" "``Keep Aspect Covered`` works just like ``Keep Aspect Centered`` but the " "shorter side fits the bounding rectangle and the other one clips to the " "node's limits." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:90 msgid "" "As with Sprite nodes, you can modulate the TextureRect's color. Click the " "``Modulate`` property and use the color picker." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:95 msgid "TextureRect modulated with a red color" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:98 msgid "TextureButton" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:100 msgid "" "**TextureButton** is like TextureRect, except it has 5 texture slots: one " "for each of the button's states. Most of the time, you'll use the Normal, " "Pressed, and Hover textures. Focused is useful if your interface listens to " "the keyboard's input. The sixth image slot, the Click Mask, lets you define " "the clickable area using a 1-bit, pure black and white image." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:107 msgid "" "In the Base Button section, you'll find a few checkboxes that change how the " "button behaves. When ``Toggle Mode`` is on, the button will toggle between " "active and normal states when you press it. ``Disabled`` makes it disabled " "by default, in which case it will use the ``Disabled`` texture. " "TextureButton shares a few properties with the texture frame: it has a " "``modulate`` property, to change its color, and ``Resize`` and ``Stretch`` " "modes to change its scale behavior." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:117 msgid "TextureButton and its 5 texture slots" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:120 msgid "TextureProgress" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:122 msgid "" "**TextureProgress** layers up to 3 sprites to create a progress bar. The " "Under and Over textures sandwich the Progress one, which displays the bar's " "value." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:126 msgid "" "The ``Mode`` property controls the direction in which the bar grows: " "horizontally, vertically, or radially. If you set it to radial, the " "``Initial Angle`` and ``Fill Degrees`` properties let you limit the range of " "the gauge." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:131 msgid "" "To animate the bar, you'll want to look at the Range section. Set the " "``Min`` and ``Max`` properties to define the range of the gauge. For " "instance, to represent a character's life, you'll want to set ``Min`` to ``0," "`` and ``Max`` to the character's maximum life. Change the ``Value`` " "property to update the bar. If you leave the ``Min`` and ``Max`` values to " "the default of ``0`` and ``100,`` and set the ``Value`` property to ``40``, " "40% of the ``Progress`` texture will show up, and 60% of it will stay hidden." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:141 msgid "TextureProgress bar, two thirds filled" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:146 msgid "" "**Label** prints text to the screen. You'll find all its properties in the " "Label section, in the Inspector. Write the text in the ``Text`` property, " "and check Autowrap if you want it to respect the textbox's size. If Autowrap " "is off, you won't be able to scale the node. You can align the text " "horizontally and vertically with Align and Valign, respectively." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:155 msgid "Picture of a Label" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:158 msgid "NinePatchRect" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:160 msgid "" "**NinePatchRect** takes a texture split in 3 rows and 3 columns. The center " "and the sides tile when you scale the texture, but it never scales the " "corners. It is useful to build panels, dialog boxes and scalable backgrounds " "for your UI." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:167 msgid "NinePatchRect scaled with the min\\_size property" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:170 msgid "There are two workflows to build responsive UIs" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:172 msgid "" "There are two workflows to build scalable and flexible interfaces in Godot:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:174 msgid "" "You have many container nodes at your disposal that scale and place UI " "elements for you. They take control over their children." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:175 msgid "" "On the other side, you have the layout menu. It helps you to anchor, place " "and resize a UI element within its parent." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:177 msgid "" "The two approaches are not always compatible. Because a container controls " "its children, you cannot use the layout menu on them. Each container has a " "specific effect, so you may need to nest several of them to get a working " "interface. With the layout approach you work from the bottom up, on the " "children. As you don't insert extra containers in the scene it can make for " "cleaner hierarchies, but it's harder to arrange items in a row, column, " "grid, etc." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:179 msgid "" "As you create UIs for your games and tools, you'll develop a sense for what " "fits best in each situation." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:183 msgid "Place UI elements precisely with anchors" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:185 msgid "" "Control nodes have a position and size, but they also have anchors and " "margins. Anchors define the origin, or the reference point, for the Left, " "Top, Right and Bottom edges of the node. Change any of the 4 anchors to " "change the reference point of the margins." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:192 msgid "The anchor property" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:195 msgid "How to change the anchor" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:197 msgid "" "Like any properties, you can edit the 4 anchor points in the Inspector, but " "this is not the most convenient way. When you select a control node, the " "layout menu appears above the viewport, in the toolbar. It gives you a list " "of icons to set all 4 anchors with a single click, instead of using the " "inspector's 4 properties. The layout menu will only show up when you select " "a control node." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:206 msgid "The layout menu in the viewport" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:209 msgid "Anchors are relative to the parent container" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:211 msgid "" "Each anchor is a value between 0 and 1. For the left and top anchors, a " "value of 0 means that without any margin, the node's edges will align with " "the left and top edges of its parent. For the right and bottom edges, a " "value of 1 means they'll align with the parent container's right and bottom " "edges. On the other hand, margins represent a distance to the anchor " "position in pixels, while anchors are relative to the parent container's " "size." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:221 msgid "" "Margins are relative to the anchor position, which is relative to the " "anchors. In practice, you'll often let the container update margins for you" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:226 msgid "Margins change with the anchor" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:228 msgid "" "Margins update automatically when you move or resize a control node. They " "represent the distance from the control node's edges to its anchor, which is " "relative to the parent control node or container. That's why your control " "nodes should always be inside a container, as we'll see in a moment. If " "there's no parent, the margins will be relative to the node's own bounding " "Rectangle, set in the Rect section, in the inspector." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:238 msgid "Margins on a CenterContainer set to the \"Full Rect\" anchor" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:240 msgid "" "Try to change the anchors or nest your Control nodes inside Containers: the " "margins will update. You'll rarely need to edit the margins manually. Always " "try to find a container to help you first; Godot comes with nodes to solve " "all the common cases for you. Need to add space between a lifebar and the " "border of the screen? Use the MarginContainer. Want to build a vertical " "menu? Use the VBoxContainer. More on these below." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:249 msgid "Use size tags to change how UI elements fill the available space" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:251 msgid "" "Every control node has Size Flags. They tell containers how the UI elements " "should scale. If you add the \"Fill\" flag to the Horizontal or Vertical " "property, the node's bounding box will take all the space it can, but it'll " "respect its siblings and retain its size. If there are 3 TextureRect nodes " "in an HBoxContainer, with the \"Fill\" flags on both axes, they'll each take " "up to a third of the available space, but no more. The container will take " "over the node and resize it automatically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:261 msgid "3 UI elements in an HBoxContainer, they align horizontally" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:263 msgid "" "The \"Expand\" flag lets the UI element take all the space it can, and push " "against its siblings. Its bounding rectangle will grow against the edges of " "its parent, or until it's blocked by another UI node." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:269 msgid "" "The same example as above, but the center node has the \"Expand\" size flag" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:272 msgid "" "You'll need some practice to understand the size tags, as their effect can " "change quite a bit depending on how you set up your interface." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:276 msgid "Arrange control nodes automatically with containers" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:278 msgid "" "Containers automatically arrange all children Control nodes including other " "containers in rows, columns, and more. Use them to add padding around your " "interface or center nodes in their bounding rectangles. All built-in " "containers update in the editor, so you can see the effect instantly." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:284 msgid "" "Containers have a few special properties to control how they arrange UI " "elements. To change them, navigate down to the Custom Constants section in " "the Inspector." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:289 msgid "The 5 most useful containers" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:291 msgid "" "If you build tools, you might need all of the containers. But for most " "games, a handful will be enough:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:294 msgid "MarginContainer, to add margins around part of the UI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:295 msgid "CenterContainer, to center its children in its bounding box" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:296 msgid "" "VboxContainer and HboxContainer, to arrange UI elements in rows or columns" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:298 msgid "GridContainer, to arrange Controls nodes in a grid-like pattern" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:300 msgid "" "CenterContainer centers all its children inside of its bounding rectangle. " "It's one you typically use for title screens, if you want the options to " "stay in the center of the viewport. As it centers everything, you'll often " "want a single container nested inside it. If you use textures and buttons " "instead, they'll stack up." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:308 msgid "" "CenterContainer in action. The life bar centers inside its parent container." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:311 msgid "" "The MarginContainer adds a margin on any side of the child nodes. Add a " "MarginContainer that encompasses the entire viewport to add a separation " "between the edge of the window and the UI. You can set a margin on the top, " "left, right, or bottom side of the container. No need to tick the checkbox: " "click the corresponding value box and type any number. It will activate " "automatically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:320 msgid "The MarginContainer adds a 40px margin around the Game User Interface" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:322 msgid "" "There are two BoxContainers: VBoxContainer and HBoxContainer. You cannot add " "the BoxContainer node itself, as it is a helper class, but you can use " "vertical and horizontal box containers. They arrange nodes either in rows or " "columns. Use them to line up items in a shop, or to build complex grids with " "rows and columns of different sizes, as you can nest them to your heart's " "content." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:331 msgid "The HBoxContainer horizontally aligns UI elements" msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:333 msgid "" "VBoxContainer automatically arranges its children into a column. It puts " "them one after the other. If you use the separation parameter, it will leave " "a gap between its children. HBoxContainer arranges UI elements in a row. " "It's similar to the VBoxContainer, with an extra ``add_spacer`` method to " "add a spacer control node before its first child or after its last child, " "from a script." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:340 msgid "" "The GridContainer lets you arrange UI elements in a grid-like pattern. You " "can only control the number of columns it has, and it will set the number of " "rows by itself, based on its children's count. If you have nine children and " "three columns, you will have 9÷3 = 3 rows. Add three more children and " "you'll have four rows. In other words, it will create new rows as you add " "more textures and buttons. Like the box containers, it has two properties to " "set the vertical and horizontal separation between the rows and columns " "respectively." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:351 msgid "A GridContainer with 2 columns. It sizes each column automatically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:353 msgid "" "Godot's UI system is complex, and has a lot more to offer. To learn how to " "design more advanced interfaces, head to the :ref:`GUI section ` of the docs." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:4 msgid "Design a title screen" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:6 msgid "" "In the next two tutorials, you will build two responsive UI (user interface) " "scenes step-by-step using the engine's UI system:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:9 msgid "A main menu." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:10 msgid "A game UI with a health bar, energy bar, bomb and money counters." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:12 msgid "" "You will learn how to design game UIs efficiently, and how to use Godot's " "Control nodes. This page focuses on the visual part: everything you do from " "the editor. To learn how to code a life bar, read :doc:`ui_code_a_life_bar`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:20 msgid "The GUI you're going to create." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:22 msgid "" "Download the project files: :download:`ui_main_menu_design.zip ` and extract the archive. Import the ``start/`` " "project in Godot to follow this tutorial. The ``end/`` folder contains the " "final result. You'll find all the sprites in the ``start/assets/main_menu`` " "folder." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:30 msgid "" "Read the :doc:`ui_introduction_to_the_ui_system` first to learn how Godot's " "UI system works." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:34 msgid "How to design your game UI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:36 msgid "" "To design a good UI, you want to come up with a rough mockup first: a plain " "drawing version that focuses on the placement of your UI components, their " "size, and user interaction. Pen and paper is all you need. You shouldn't use " "fancy and final graphics at this stage. Then, you only need simple " "placeholder sprites and you're good to jump into Godot. You want to make " "sure the players can find their way around the interface using those " "placeholders." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:46 msgid "The UI's rough plan or mockup" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:48 msgid "" "Placeholder doesn't have to mean ugly, but you should keep the graphics " "simple and clean. Avoid special effects, animation, and detailed " "illustration before you have players playtest your UI. Otherwise:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:52 msgid "" "The graphics might skew the players' perception of the experience and you'll " "miss out on valuable feedback." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:54 msgid "If the User Experience doesn't work, you'll have to redo some sprites." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:58 msgid "" "Always try to make the interface work with simple text and boxes first. It's " "easy to replace the textures later. Professional UX designers often work " "with plain outlines and boxes in greyscale. When you take colors and fancy " "visuals away, it's a lot easier to size and place UI elements properly. It " "helps you refine the design foundation you'll build upon." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:65 msgid "There are two ways to design your UI in Godot. You can:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:67 msgid "" "Build it all in a single scene, and eventually save some branches as " "reusable scenes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:69 msgid "" "Build template scenes for reusable components and create specific components " "that inherit from your base scenes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:72 msgid "" "We will use the first approach, because the first version of your UI may not " "work as well as you'd like. You're likely to throw parts away and redesign " "components as you go. When you're sure everything works, it's easy to make " "some parts reusable, as you'll see below." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:79 msgid "" "The files you'll find in Godot. The graphics look cleaner than on the rough " "design, but they're still placeholders." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:83 msgid "Design the main menu" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:85 msgid "" "Before we jump into the editor, we want to plan how we'll nest containers " "based on our mockup image." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:89 #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:282 msgid "Break down the UI mockup" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:91 msgid "Here are my three rules of thumb to find the right containers:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:93 msgid "" "Break down the UI into nested boxes, from the largest that contains " "everything, to the smallest ones, that encompass one widget, like a bar with " "its label, a panel or a button." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:96 msgid "If there's some padding around an area, use a ``MarginContainer``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:97 msgid "" "If the elements are arranged in rows or columns, use an ``HBoxContainer`` or " "``VBoxContainer``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:100 msgid "" "These rules are enough to get us started, and work well for simple " "interfaces." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:103 msgid "" "For the main menu, the largest box is the entire game window. There's " "padding between the edges of the window and the first components: this " "should be a ``MarginContainer``. Then, the screen is split into two columns, " "so we'll use an ``HBoxContainer``. In the left column, we'll manage the rows " "with a ``VBoxContainer``. And in the right column, we'll center the " "illustration with a ``CenterContainer``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:112 msgid "Interface building blocks, broken down using the three rules of thumb." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:116 msgid "" "Containers adapt to the window's resolution and width-to-height ratio. " "Although we could place UI elements by hand, containers are faster, more " "precise, and **responsive**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:121 msgid "Prepare the Main Menu scene" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:123 msgid "" "Let's create the main menu. We'll build it in a single scene. To create an " "empty scene, click on **Scene > New Scene**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:126 msgid "" "We have to add a root node before we can save the scene. Your UI's root " "should be the outermost container or element. In this case it's a " "``MarginContainer``. ``MarginContainer`` is a good starting point for most " "interfaces, as you often need padding around the UI. Press :kbd:`Ctrl + S` (:" "kbd:`Cmd + S` on macOS) to save the scene to the disk. Name it *MainMenu*." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:132 msgid "" "Select the ``MarginContainer`` again, and head to the inspector to define " "the margins' size. Scroll down the ``Control`` class, to the ``Custom " "Constants`` section. Unfold it. Set the margins as such:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:136 msgid "Margin Right: *120*" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:137 msgid "Margin Top: *80*" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:138 msgid "Margin Left: *120*" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:139 msgid "Margin Bottom: *80*" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:141 msgid "" "We want the container to fit the window. In the toolbar above the Viewport, " "open the **Layout** menu and select the last option, **Full Rect**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:145 msgid "Add the UI sprites" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:147 msgid "" "Select the ``MarginContainer``, and create the UI elements as " "``TextureRect`` nodes. We need:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:150 msgid "the title or logo," msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:151 msgid "the three text options as individual nodes," msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:152 msgid "the version note," msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:153 msgid "and the main menu's illustration." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:155 msgid "" "Click the **Add Node** button or press :kbd:`Ctrl + A` (:kbd:`Cmd + A` on " "macOS) on your keyboard. Start to type ``TextureRect`` to find the " "corresponding node and press enter. With the new node selected, press :kbd:" "`Ctrl + D` (:kbd:`Cmd + D` on macOS) five times to create five extra " "``TextureRect`` instances." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:160 msgid "" "Click each of the nodes to select it. In the inspector, find the **Texture** " "property and click **[empty] > Load**. A file browser opens and lets you " "pick a sprite to load into the texture slot." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:166 msgid "The file browser lets you find and load textures." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:168 msgid "" "Repeat the operation for all ``TextureRect`` nodes. You should have the " "logo, the illustration, the three menu options and the version note, each as " "a separate node. Then, double click on each of the nodes in the Scene tab to " "rename them. Nothing has been placed in containers yet so this should look " "messy." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:176 msgid "The six nodes with textures loaded." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:180 msgid "" "If you want to support localization in your game, use ``Labels`` for menu " "options instead of ``TextureRect``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:184 msgid "Add containers to place UI elements automatically" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:186 msgid "" "Our main menu has some margin around the edges of the screen. It is split in " "two parts: on the left, you have the logo and the menu options. On the " "right, you have the characters. We can use one of two containers to achieve " "this: ``HSplitContainer`` or ``HBoxContainer``. Split containers split the " "area into two: a left and a right side or a top and a bottom side. They also " "allow the user to resize the left and right areas using an interactive bar. " "On the other hand, ``HBoxContainer`` just splits itself into as many columns " "as it has children. Although you can deactivate the split container's resize " "behavior, I recommend to favor box containers." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:197 msgid "" "Select the ``MarginContainer`` and add an ``HBoxContainer``. Then, we need " "two containers as children of our ``HBoxContainer``: a ``VBoxContainer`` for " "the menu options on the left, and a ``CenterContainer`` for the illustration " "on the right." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:204 msgid "" "You should have four nested containers and the TextureRect nodes sitting " "aside from it." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:207 msgid "" "In the node tree, select all the ``TextureRect`` nodes that should go on the " "left side: the logo, the menu options (Continue, NewGame, Options), and the " "version note. Drag and drop them into the ``VBoxContainer``. The nodes " "should position automatically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:214 msgid "Containers automatically place and resize textures" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:216 msgid "We're left with two problems to solve:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:218 msgid "The characters on the right aren't centered." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:219 msgid "There's no space between the logo and the other UI elements." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:221 msgid "" "To center the characters on the right, first select the ``CenterContainer``. " "Then in the Inspector, scroll down to the **Size Flags** category and click " "on the field to the right of the **Vertical** property, and check **Expand** " "in addition to **Fill**. Do the same for the **Horizontal** property. This " "makes the ``CenterContainer`` expand into all available space while " "respecting its neighbour ``VBoxContainer``. Finally, drag and drop the " "Characters node into the ``CenterContainer``. The Characters element will " "center automatically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:232 msgid "" "The character node centers inside the right half of the screen as soon as " "you place it inside the CenterContainer." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:235 msgid "" "To space out the menu options and the logo on the left, we'll use one final " "container and its size flags. Select the ``VBoxContainer`` and press :kbd:" "`Ctrl + A` (:kbd:`Cmd + A` on macOS) to add a new node inside it. Add a " "second ``VBoxContainer`` and name it *MenuOptions*. Select all three menu " "options, ``Continue``, ``NewGame`` and ``Options``, and drag and drop them " "inside the new ``VBoxContainer``. The UI's layout should barely change, if " "at all." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:245 msgid "" "Place the new container between the other two nodes to retain the UI's " "layout." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:248 msgid "" "Now we grouped the menu options together, we can tell their container to " "expand to take as much vertical space as possible. Select the " "``MenuOptions`` node. In the Inspector, scroll down to the **Size Flags** " "category. Click on the field to the right of the **Vertical** property, and " "check **Expand** in addition to **Fill**. The container expands to take all " "the available vertical space while respecting its neighbors, the ``Logo`` " "and ``Version`` elements." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:256 msgid "" "To center the nodes in the ``VBoxContainer``, scroll to the top of the " "Inspector and change the **Alignment** property to **Center**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:261 msgid "The menu options should center vertically in the UI's left column." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:263 msgid "" "To wrap things up, let's add some separation between the menu options. " "Expand the **Custom Constants** category below **Size Flags**, and click the " "field next to the **Separation** parameter. Set it to 30. Once you press " "enter, the **Separation** property becomes active and Godot adds 30 pixels " "between menu options." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:271 #, fuzzy msgid "The final interface." msgstr "Sửa đổi giao diện" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:273 msgid "" "Without a single line of code, we have a precise and responsive main menu." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:276 msgid "" "Congratulations for getting there! You can download the final menu :download:" "`ui_main_menu_design.zip ` to compare with " "your own. In the next tutorial, you'll create a Game User Interface with " "bars and item counters." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:284 msgid "" "A responsive User Interface is all about making sure our UIs scale well on " "all screen types. TV screens and computer displays have different sizes and " "ratios. In Godot, we use containers to control the position and the size of " "UI elements." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:289 msgid "" "The order in which you nest matters. To see if your UI adapts nicely to " "different screen ratios, select the root node, press :kbd:`Q` to activate " "the Select Mode, select the container and click and drag on one of the " "container's corners to resize it. The UI components should flow inside of it." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:295 msgid "" "You'll notice that although containers move sprites around, they don't scale " "them. This is normal. We want the UI system to handle different screen " "ratios, but we also need the entire game to adapt to different screen " "resolutions. To do this, Godot scales the entire window up and down." msgstr "" #: ../../docs/getting_started/step_by_step/ui_main_menu.rst:301 msgid "" "You can change the scale mode in the project settings: click **Project > " "Project Settings** in the top menu. In the window's left column, look for " "the **Display** category. Click on the **Window** sub-category. On the right " "side of the window, you'll find a **Stretch** section. The three settings, " "**Mode**, **Aspect**, and **Shrink**, control the screen size. For more " "information, see :ref:`doc_multiple_resolutions`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:4 msgid "Design the GUI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:6 msgid "" "Now that you've nailed the basics, we're going to see how to build a game " "Graphical User Interface (GUI) with reusable UI components: a life bar, an " "energy bar, and bomb and emerald counters. By the end of this tutorial, " "you'll have a game GUI, ready to control with GDscript or VisualScript:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:13 #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:621 msgid "The final result" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:15 msgid "You'll also learn to:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:17 msgid "Create flexible UI components" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:18 msgid "Use scene inheritance" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:19 msgid "Build a complex UI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:21 msgid "" "Download the project files: :download:`ui_gui_design.zip ` and extract the archive. Import the `start/` project in " "Godot to follow this tutorial. The `end/` folder contains the final result." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:25 msgid "" "You can watch this tutorial as a `video on YouTube `_." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:28 msgid "Breaking down the UI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:30 msgid "" "Let's break down the final UI and plan the containers we'll use. As in the :" "doc:`ui_main_menu`, it starts with a ``MarginContainer``. Then, we can see " "up to three columns:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:34 msgid "The life and energy counters on the left" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:35 msgid "The life and energy bars" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:36 #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:42 msgid "The bomb and emerald counters on the right" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:38 msgid "" "But the bar's label and the gauge are two parts of the same UI element. If " "we think of them this way, we're left with two columns:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:41 msgid "The life and energy bars on the left" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:44 msgid "" "This makes it easier to nest containers: we have some margins around the " "border of the screen using a ``MarginContainer``, followed by an " "``HBoxContainer`` to manage our two columns. The two bars stack on top of " "one another inside a ``VBoxContainer``. And we'll need a last " "``HBoxContainer`` in the right column to place the bomb and emerald counters " "side-by-side." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:53 msgid "We get a clean UI layout with only 4 containers" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:55 msgid "" "We will need extra containers inside the individual UI components, but this " "gives us the main GUI scene's structure. With this plan in place, we can " "jump into Godot and create our GUI." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:60 msgid "Create the base GUI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:62 msgid "" "There are two possible approaches to the GUI: we can design elements in " "separate scenes and put them together, or prototype everything in a single " "scene and break it down later. I recommend working with a single scene as " "you can play with your UI's placement and proportions faster this way. Once " "it looks good, you can save entire sections of the node tree as reusable sub-" "scenes. We'll do that in a moment." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:69 msgid "For now, let's start with a few containers." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:71 msgid "" "Create a new scene and add a ``MarginContainer``. Select the node and name " "it ``GUI``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:74 msgid "" "We want our interface to anchor to the top of the screen. Select the ``GUI`` " "node and click the Layout button at the top of the viewport. Select the " "``Top Wide`` option. The ``GUI`` node will anchor to the top edge of its " "parent, the viewport by default. It will resize automatically on the " "vertical axis to make space for its child UI components." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:80 msgid "Save the scene as ``GUI.tscn``. We will put the entire GUI in it." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:82 msgid "" "With the ``MarginContainer`` selected, head to the inspector and scroll down " "to the custom constants section. Unfold it and click the field next to each " "of the ``Margin`` properties. Set them all to ``20`` pixels. Next, add an " "``HBoxContainer`` node. This one will contain our two bars on the left and " "separate them from the two counters on the right." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:88 msgid "" "We want to stack the bars vertically inside the ``HBoxContainer``. Add a " "``VBoxContainer`` as a child of ``HBoxContainer`` and name it ``Bars``. " "Select the parent ``HBoxContainer`` again and this time, add another " "``HBoxContainer`` as a child of it. Call it ``Counters``. With these four " "containers, we have the base for our GUI scene." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:95 msgid "You should have 4 containers that look like this" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:99 msgid "" "We can work this way because we first broke down our UI design and took a " "few moments to think about the containers we'd use. When you follow a " "tutorial like this, it may seem weird. But once you're working on real " "games, you'll see it's an efficient workflow." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:105 msgid "Create the bars' base" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:107 msgid "" "Each bar is split into two sub-elements that align horizontally: the label " "with the health count on the left, and the gauge on the right. Once again, " "the ``HBoxContainer`` is the perfect tool for the job. Select the ``Bars`` " "node and add a new ``HBoxContainer`` inside of it. Name it ``Bar``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:113 msgid "" "The label itself requires at least three nodes: a ``NinePatchRect`` for the " "background, on top of which we'll add a texture on the left, either ``HP`` " "or ``EP``, and a ``Label`` on the right for the value. We can nest " "``Control`` nodes however we want. We could use the ``NinePatchRect`` as a " "parent for the two other elements, as it encompasses them. In general, you " "want to use containers instead, as their role is to help organize UI " "components. We'll need a ``MarginContainer`` later anyway to add some space " "between the life count and the gauge. Select the ``Bar`` and add a " "``MarginContainer``. Name it ``Count``. Inside of it, add three nodes:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:124 msgid "A ``NinePatchRect`` named ``Background``" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:125 msgid "A ``TextureRect`` named ``Title``" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:126 msgid "And a ``Label`` named ``Number``" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:128 msgid "To add the nodes as siblings, always select the ``Count`` node first." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:132 msgid "" "Your scene tree should look like this. We're ready to throw in some textures" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:135 msgid "" "Our scene is still empty. It's time to throw in some textures. To load the " "textures, head to the FileSystem dock to the left of the viewport. Browse " "down to the res://assets/GUI folder." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:141 msgid "You should see a list of textures that we'll use to skin our interface." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:144 msgid "" "Select the ``Background`` in the Scene dock. In the Inspector, you should " "see a ``Texture`` property. In the FileSystem tab, click and drag " "``label_HP_bg.png`` onto the ``Texture`` slot. It stays squashed. The parent " "MarginContainer will force its size down to 0 until we force elements inside " "the container to have a minimum size. Select the ``Background`` node. In the " "Inspector, scroll down to the Rect section. Set ``Min Size`` to (100, 40). " "You should see the ``Background`` resize along with its parent containers." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:153 msgid "" "Next, select the ``Title`` and drag and drop ``label_HP.png`` into its " "``Texture`` slot. Select the ``Number`` node, click the field next to the " "``Text`` property and type ``10``. This way, we can see both nodes in the " "viewport. They should stack up in the top-left corner of their parent " "``MarginContainer``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:161 msgid "If you select both nodes, you should see something like this" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:163 msgid "" "As they have a container as their direct parent, we cannot move them freely: " "the ``Count`` node will always reset their anchors, their size and position. " "Try to move and resize the nodes in the viewport. Then, select any of the " "three textures and press :kbd:`Ctrl + Up` or :kbd:`Ctrl + Down` to reorder " "them in the Scene dock. They'll snap back to their previous size and " "position." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:170 msgid "" "Parent containers control the size, the scale, the margins, and the anchors " "of their direct children. To modify the nodes, you must nest them inside a " "regular Control or another UI element. We'll use the ``Background`` as a " "parent for the ``Title`` and ``Number``. Select both the ``Title`` and " "``Number``, and drag and drop them onto ``Background``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:179 msgid "" "By using the Background node as the two textures' parent, we take control " "away from the Count MarginContainer" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:182 msgid "" "Select the ``Title`` and in the Inspector, change its ``Stretch Mode`` " "property to ``Keep Centered``. Next find the ``Rect`` category in the " "Inspector and change the ``Size`` property to (50, 40) so it only takes the " "left half of the background. Next, select the ``Number`` node. In the " "viewport, click the ``Layout`` menu and click ``Full Rect``. The node will " "resize to fit the ``Background``. Head to the Inspector and change its " "``Align`` property to ``Right``, and the ``Valign`` property to ``Center``. " "The text should snap to the center of the ``Background``'s right edge. " "Resize the node horizontally, so it takes the right half of the " "``Background`` and there's a bit of padding with the right edge." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:195 msgid "" "Here's how the nodes' bounding boxes should look in the viewport. Keep it " "rough, you don't need to place them too precisely for now." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:199 msgid "Replace the Label's font" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:201 msgid "" "The label's font is too small. We need to replace it. Select the ``Number`` " "node and in the Inspector, scroll down to the ``Control`` class, and find " "the ``Custom Font`` category. Click the field next to the ``Font`` property " "and click on ``New Dynamic Font``. Click on the field again and select Edit." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:207 msgid "" "You will enter the ``Dynamic Font`` resource. Unfold the ``Font`` category " "and click the field next to ``Font Data``. Click the ``Load`` button. In the " "file browser, navigate down to the assets/font folder and double click " "``Comfortaa-Bold.ttf`` to open it. You should see the font update in the " "viewport. Unfold the settings category to change the font size. Set the " "``Size`` property to a higher value, like ``24`` or ``28``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:215 msgid "" "We now need the text's baseline, the number's lower edge, to align with the " "HP texture on the left. To do so, still in the ``DynamicFont`` resource, you " "can tweak the ``Bottom`` property under the ``Extra Spacing`` category. It " "adds some bottom padding to the text. Click the ``Number`` node in the Scene " "tab to go back to the node's properties and change the ``Valign`` to " "``Bottom``. To adjust the text's baseline, click on the font field under the " "``Custom Font`` category again and tweak the ``Bottom`` property until the " "text aligns with the ``Title`` node. I used a value of ``2`` pixels." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:227 msgid "With a Bottom value of 2 pixels, the Number aligns with the Title" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:229 msgid "" "With this, we finished the hardest part of the GUI. Congratulations! Let's " "move on to the simpler nodes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:233 msgid "Add the progress bar" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:235 msgid "" "We need one last element to complete our life bar: the gauge itself. Godot " "ships with a ``TextureProgress`` node that has everything we need." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:238 msgid "" "Select the Bar node and add a ``TextureProgress`` inside of it. Name it " "``Gauge``. In the inspector unfold the ``Textures`` section. Head to the " "FileSystem dock and drag and drop the ``lifebar_bg.png`` texture onto the " "``Under`` slot. Do the same with the ``lifebar_fill.png`` image and drop it " "onto the ``Progress`` slot. Under the ``Range`` class in the inspector, " "change the ``Value`` property to ``50`` to see the gauge fill up." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:246 msgid "With only five ``Control`` nodes, our first bar is ready to use." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:250 msgid "" "That's it, our life bar is ready. This last part was quick, wasn't it? " "That's thanks to our robust container setup." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:254 msgid "Design the bomb and emerald counters" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:256 msgid "" "The bomb and emerald counters are like the bar's ``Count`` node. So we'll " "duplicate it and use it as a template." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:259 msgid "" "Under the ``Bar`` node, select ``Count`` and press :kbd:`Ctrl + D` to " "duplicate it. Drag and drop the new node under the ``Counters`` " "``HBoxContainer`` at the bottom of the scene tree. You should see it resize " "automatically. Don't worry about this for now, we'll fix the size soon." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:264 msgid "" "Rename the ``Count2`` node to ``Counter``. Unlike the bars, we want the " "number to be on the left, and an icon to sit on the right. The setup is the " "same: we need a background (a ``NinePatchRect``), the title, and the number " "nodes. The ``Title`` node is a ``TextureRect``, so it's what we need to " "display the icon. In the scene tree, select the ``Title`` node, and rename " "it to ``Icon``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:273 msgid "Here's how your node tree should look so far" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:275 msgid "" "With the ``Icon`` node selected, in the inspector, scroll to the top to see " "the ``Texture`` slot. Head to the FileSystem dock on the left and select the " "``bombs_icon.png``. Drag and drop it onto the ``Texture`` slot. In the Scene " "Tab select both the ``Icon`` and the ``Number`` nodes. Click the Layout menu " "in the toolbar at the top of the viewport and select ``Full Rect``. Both " "nodes will update to fit the size of the ``Background``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:285 msgid "The nodes anchor to the entire Background, but their position is off" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:287 msgid "" "Let's change the ``Number``'s align properties to move it to the left and " "center of the ``Background``. Select the ``Number`` node, change its " "``Align`` property to left and the ``Valign`` property to centre. Then " "resize its left edge a bit to add some padding between the left edge of the " "``Background`` and the text." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:295 msgid "The Number node aligned to the left and centre" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:297 msgid "" "To overlap the Icon and the background, we need a few tweaks. First, our " "background is a bit too tall. It's because it's inside a margin container " "that is controlled by the top-most GUI node. Select the GUI node at the top " "of the scene tree and downsize it vertically so that it's as thin as " "possible. You'll see the gauge prevents you from making it too small. A " "container cannot be smaller than the minimal size of its children. The " "container's margins also weigh in." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:305 msgid "" "Select the Icon, click the Layout menu, and select ``Full Rect`` to re-" "center it. We need it to anchor to the ``Background``'s right edge. Open the " "Layout menu again and select ``Center Right``. Move the icon up so it is " "centered vertically with the ``Background``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:313 msgid "" "The bomb icon anchors to the Background's right edge. Resize the Counter " "container to see the Icon node stick to its right side" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:316 msgid "" "Because we duplicated the ``Counter`` from the bar's ``Count``, the " "``Number`` node's font is off. Select the ``Number`` node again, head to the " "``Font`` property, and click it to access the ``DynamicFont`` resource. In " "the ``Extra Spacing`` section, change the ``Bottom`` value to ``0`` to reset " "the font's baseline. Our counter now works as expected." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:323 msgid "" "Let's make the ``Counters`` anchor to the right edge of the viewport. To do " "so, we need to set the ``Bars`` container take all the available horizontal " "space it can. Select the ``Bars`` node and scroll down to the ``Size Flags`` " "category. In the ``Horizontal`` category, check the ``Expand`` value. The " "``Bars`` node should resize and push the counter to the right side of the " "screen." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:331 msgid "" "An expanding container eats all the space it can from its parent, pushing " "everything else along the way" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:335 msgid "Turn the bar and counter into reusable UI components" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:337 msgid "" "We have one bar and one counter widget. But we need two of each. We may need " "to change the bars' design or their functionality later on. It'd be great if " "we could have a single scene to store a UI element's template, and child " "scenes to work on variations. Godot lets us do this with Inherited Scenes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:343 msgid "" "Let's save both the ``Counter`` and the ``Bar`` branches as separate scenes " "that we'll reduce to create the ``LifeBar``, the ``EnergyBar``, the " "``BombCounter``, and the ``EmeraldCounter``. Select the ``Bar`` " "HBoxContainer. Right click on it and click on ``Save Branch as Scene``. Save " "the scene as ``Bar.tscn``. You should see the node branch turn it to a " "single ``Bar`` node." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:352 msgid "" "A scene is a tree of nodes. The topmost node is the tree's **root**, and the " "children at the bottom of the hierarchy are **leaves**. Any node other than " "the root along with one or more children is a **branch**. We can encapsulate " "node branches into separate scenes, or load and merge them from other scenes " "into the active one. Right click on any node in the Scene dock and select " "``Save Branch as Scene`` or ``Merge from Scene``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:360 msgid "" "Then, select the ``Counter`` node and do the same. Right click, ``Save " "Branch as Scene``, and save it as ``Counter.tscn``. A new edit scene icon " "appears to the right of the nodes in the scene tree. Click on the one next " "to ``Bar`` to open the corresponding scene. Resize the ``Bar`` node so that " "its bounding box fits its content. The way we named and placed the Control " "nodes, we're ready to inherit this template and create the life bar. It's " "the same for the ``Counter``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:370 msgid "With no extra changes, our Bar is ready to use" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:373 msgid "Use scene inheritance to create the remaining elements" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:375 msgid "" "We need two bars that work the same way: they should feature a label on the " "left, with some value, and a horizontal gauge on the right. The only " "difference is that one has the HP label and is green, while the other is " "called EP and is yellow. Godot gives us a powerful tool to create a common " "base to reuse for all bars in the game: **inherited scenes**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:383 msgid "" "Inherited scenes help us keep the GUI scene clean. In the end, we will only " "have containers and one node for each UI component." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:386 msgid "" "On an inherited scene, you can change any property of every node in the " "inspector, aside from its name. If you modify and save the parent scene, all " "the inherited scenes update to reflect the changes. If you change a value in " "the inherited scene, it will always override the parent's property. It's " "useful for UIs, as they often require variations of the same elements. In " "general, in UI design, buttons, panels etc. share a common base style and " "interactions. We don't want to copy it over to all variations manually." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:395 msgid "" "A reload icon will appear next to the properties you override. Click it to " "reset the value to the parent scene's default." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:400 msgid "" "Think of scene inheritance like the node tree, or the ``extends`` keyword in " "GDScript. An inherited scene does everything like its parent, but you can " "override properties, resources and add extra nodes and scripts to extend its " "functionality." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:406 msgid "Inherit the Bar Scene to build the LifeBar" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:408 msgid "" "Go to ``Scene -> New Inherited Scene`` to create a new type of ``Bar``. " "Select the Bar scene and open it. You should see a new [unsaved] tab, that's " "like your ``Bar``, but with all nodes except the root in grey. Press :kbd:" "`Ctrl + S` (:kbd:`Cmd + S` on macOS) to save the new inherited scene and " "name it ``LifeBar``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:416 msgid "You can't rename grey nodes. This tells you they have a parent scene" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:418 msgid "" "First, rename the root or top level node to ``LifeBar``. We always want the " "root to describe exactly what this UI component is. The name differentiates " "this bar from the ``EnergyBar`` we'll create next. The other nodes inside " "the scene should describe the component's structure with broad terms, so it " "works with all inherited scenes. Like our ``TextureProgress`` and ``Number`` " "nodes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:427 msgid "" "If you've ever done web design, it's the same spirit as working with CSS: " "you create a base class, and add variations with modifier classes. From a " "base button class, you'll have button-green and button-red variations for " "the user to accept and refuse prompts. The new class contains the name of " "the parent element and an extra keyword to explain how it modifies it. When " "we create an inherited scene and change the name of the top level node, " "we're doing the same thing." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:436 msgid "Design the EnergyBar" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:438 msgid "" "We already setup the ``LifeBar``'s design with the main ``Bar`` scene. Now " "we need the ``EnergyBar``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:441 msgid "" "Let's create a new inherited scene, and once again select the ``Bar.tscn`` " "scene and open it. Double-click on the ``Bar`` root node and rename it to " "``EnergyBar``. Save the new scene as ``EnergyBar.tscn``. We need to replace " "the HP texture with EP one, and to change the textures on the gauge." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:447 msgid "" "Head to the FileSystem dock on the left, select the ``Title`` node in the " "Scene tree and drag and drop the ``label_EP.png`` file onto the texture " "slot. Select the ``Number`` node and change the ``Text`` property to a " "different value like ``14``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:452 msgid "" "You'll notice the EP texture is smaller than the HP one. We should update " "the ``Number``'s font size to better fit it. A font is a resource. All the " "nodes in the entire project that use this resource will be affected by any " "property we change. You can try to change the size to a huge value like " "``40`` and switch back to the ``LifeBar`` or the ``Bar`` scenes. You will " "see the text increased in size." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:461 msgid "If we change the font resource, all the nodes that use it are affected" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:464 msgid "" "To change the font size on this node only, we must create a copy of the font " "resource. Select the ``Number`` node again and click on the wrench and " "screwdriver icon on the top right of the inspector. In the drop-down menu, " "select the ``Make Sub-Resources Unique`` option. Godot will find all the " "resources this node uses and create unique copies for us." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:472 msgid "Use this option to create unique copies of the resources for one node" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:476 msgid "" "When you duplicate a node from the Scene tree, with :kbd:`Ctrl + D` (:kbd:" "`Cmd + D` on macOS), it shares its resources with the original node. You " "need to use ``Make Sub-Resources Unique`` before you can tweak the resources " "without affecting the source node." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:481 msgid "" "Scroll down to the ``Custom Font`` section and open ``Font``. Lower the " "``Size`` to a smaller value like ``20`` or ``22``. You may also need to " "adjust the ``Bottom`` spacing value to align the text's baseline with the EP " "label on the left." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:488 msgid "The EP Count widget, with a smaller font than its HP counterpart" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:490 msgid "" "Now, select the ``TextureProgress`` node. Drag the ``energy_bar_bg.png`` " "file onto the ``Under`` slot and do the same for ``energy_bar_fill.png`` and " "drop it onto the ``Progress`` texture slot." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:494 msgid "" "You can resize the node vertically so that its bounding rectangle fits the " "gauge. Do the same with the ``Count`` node until its size aligns with that " "of the bar. Because the minimal size of ``TextureProgress`` is set based on " "its textures, you won't be able to downsize the ``Count`` node below that. " "That is also the size the ``Bar`` container will have. You may downscale " "this one as well." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:501 msgid "" "Last but not least, the ``Background`` container has a minimum size that " "makes it a bit large. Select it and in the ``Rect`` section, change the " "``Min Size`` property down to ``80`` pixels. It should resize automatically " "and the ``Title`` and ``Number`` nodes should reposition as well." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:509 msgid "The Count looks better now it's a bit smaller" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:513 msgid "" "The Count node's size affects the position of the TextureProgress. As we'll " "align our bars vertically in a moment, we're better off using the Counter's " "left margin to resize our EP label. This way both the EnergyBar's Count and " "the LifeBar's Count nodes are one hundred pixels wide, so both gauges will " "align perfectly." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:520 msgid "Prepare the bomb and emerald counters" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:522 msgid "" "Let us now take care of the counters. Go to ``Scene -> New Inherited Scene`` " "and select the ``Counter.tscn`` as a base. Rename the root node as " "``BombCounter`` too. Save the new scene as ``BombCounter.tscn``. That's all " "for this scene." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:529 msgid "The bomb counter is the same as the original Counter scene" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:531 msgid "" "Go to ``Scene -> New Inherited Scene`` again and select ``Counter.tscn`` " "once more. Rename the root node ``EmeraldCounter`` and save the scene as " "``EmeraldCounter.tscn``. For this one, we mainly need to replace the bomb " "icon with the emerald icon. In the FileSystem tab, drag the ``emeralds_icon." "png`` onto the ``Icon`` node's ``Texture`` slot. ``Icon`` already anchors to " "the right edge of the ``Background`` node so we can change its position and " "it will scale and reposition with the ``EmeraldCounter`` container. Shift " "the emerald icon a bit to the right and down. Use the Arrow Keys on the " "keyboard to nudge its position. Save, and we're done with all the UI " "elements." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:544 msgid "The emerald counter should look something like this" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:547 msgid "Add the UI components to the final GUI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:549 msgid "" "Time to add all the UI elements to the main GUI scene. Open the ``GUI.tscn`` " "scene again, and delete the ``Bar`` and ``Counter`` nodes. In the FileSystem " "dock, find the ``LifeBar.tscn`` and drag and drop it onto the ``Bars`` " "container in the scene tree. Do the same for the ``EnergyBar``. You should " "see them align vertically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:557 msgid "The LifeBar and the EnergyBar align automatically" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:559 msgid "" "Now, drag and drop the ``BombCounter.tscn`` and ``EmeraldCounter.tscn`` " "scenes onto the ``Counters`` node. They'll resize automatically." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:564 msgid "The nodes resize to take all the available vertical space" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:566 msgid "" "To let the ``EmeraldCounter`` and ``BombCounter`` use the size we defined in " "``Counter.tscn``, we need to change the ``Size Flags`` on the ``Counters`` " "container. Select the ``Counters`` node and unfold the ``Size Flags`` " "section in the Inspector. Uncheck the ``Fill`` tag for the ``Vertical`` " "property, and check ``Shrink Center`` so the container centers inside the " "``HBoxContainer``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:575 msgid "Now both counters have a decent size" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:579 msgid "" "Change the ``Min Size`` property of the ``Counters`` container to control " "the height of the counters' background." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:582 msgid "" "We have one small issue left with the EP label on the EnergyBar: the 2 bars " "should align vertically. Click the icon next to the ``EnergyBar`` node to " "open its scene. Select the ``Count`` node and scroll down to the ``Custom " "Constants`` section. Add a ``Margin Left`` of ``20``. In the ``Rect`` " "section set the node's ``Min Size`` back to 100, the same value as on the " "LifeBar. The ``Count`` should now have some margin on the left. If you save " "and go back to the GUI scene, it will be aligned vertically with the " "``LifeBar``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:593 msgid "The 2 bars align perfectly" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:597 msgid "" "We could have set up the ``EnergyBar`` this way a few moments ago. But this " "shows you that you can go back to any scene anytime, tweak it, and see the " "changes propagate through the project!" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:602 msgid "Place the GUI onto the game's mockup" msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:604 msgid "" "To wrap up the tutorial we're going to insert the GUI onto the game's mockup " "scene." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:607 msgid "Head to the FileSystem dock and open ``LevelMockup.tscn``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:609 msgid "" "Drag-and-drop the ``GUI.tscn`` scene right below the ``bg`` node and above " "the ``Characters``. The GUI will scale to fit the entire viewport. Head to " "the Layout menu and select the ``Center Top`` option so it anchors to the " "top edge of the game window. Then resize the GUI to make it as small as " "possible vertically. Now you can see how the interface looks in the context " "of the game." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:616 msgid "" "Congratulations for getting to the end of this long tutorial. You can find " "the final project here: :download:`ui_gui_design.zip `." msgstr "" #: ../../docs/getting_started/step_by_step/ui_game_user_interface.rst:625 msgid "" "**A final note about Responsive Design**. If you resize the GUI, you'll see " "the nodes move, but the textures and text won't scale. The GUI also has a " "minimum size, based on the textures inside of it. In games, we don't need " "the interface to be as flexible as that of a website. You almost never want " "to support both landscape and portrait screen orientations. It's one or the " "other. In landscape orientation, the most common ratios range from 4:3 to " "16:9. They are close to one another. That's why it's enough for the GUI " "elements to only move horizontally when we change the window size." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:4 msgid "Control the game's UI with code" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:7 #: ../../docs/tutorials/2d/particle_systems_2d.rst:7 msgid "Intro" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:9 msgid "" "In this tutorial, you will connect a character to a life bar and animate the " "health loss." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:14 msgid "" "Here's what you'll create: the bar and the counter animate when the " "character takes a hit. They fade when it dies." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:18 msgid "You will learn:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:20 msgid "How to **connect** a character to a GUI with signals" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:21 msgid "How to **control** a GUI with GDscript" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:22 msgid "How to **animate** a life bar with the :ref:`Tween ` node" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:25 msgid "" "If you want to learn how to set up the interface instead, check out the step-" "by-step UI tutorials:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:28 msgid "Create a main menu screen" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:29 msgid "Create a game user interface" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:32 msgid "" "When you code a game, you want to build the core gameplay first: the main " "mechanics, player input, win and loss conditions. The UI comes a bit later. " "You want to keep all the elements that make up your project separate if " "possible. Each character should be in its own scene, with its own scripts, " "and so should the UI elements. This prevents bugs, keeps your project " "manageable, and allows different team members to work on different parts of " "the game." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:40 msgid "" "Once the core gameplay and the UI are ready, you'll need to connect them " "somehow. In our example, we have the Enemy who attacks the Player at " "constant time intervals. We want the life bar to update when the Player " "takes damage." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:45 msgid "To do this, we will use **signals**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:49 msgid "" "Signals are Godot's version of the Observer pattern. They allow us to send " "out some message. Other nodes can connect to the object that **emits** the " "signal and receive the information. It's a powerful tool we use a lot for " "User Interface and achievement systems. You don't want to use them " "everywhere, though. Connecting two nodes adds some coupling between them. " "When there's a lot of connections, they become hard to manage. For more " "information, check out the `signals video tutorial `_ on GDquest." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:53 msgid "Download and explore the start project" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:55 msgid "" "Download the Godot project: :download:`ui_code_life_bar.zip `. It contains all the assets and scripts you need to " "get started. Extract the .zip archive to get two folders: `start` and `end`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:58 msgid "" "Load the ``start`` project in Godot. In the ``FileSystem`` dock, double " "click on LevelMockup.tscn to open it. It's an RPG game's mockup where 2 " "characters face each other. The pink enemy attacks and damages the green " "square at regular time intervals, until its death. Feel free to try out the " "game: the basic combat mechanics already work. But as the character isn't " "connected to the life bar, the ``GUI`` doesn't do anything." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:68 msgid "" "This is typical of how you'd code a game: you implement the core gameplay " "first, handle the player's death, and only then you'll add the interface. " "That's because the UI listens to what's happening in the game. So it can't " "work if other systems aren't in place yet. If you design the UI before you " "prototype and test the gameplay, chances are it won't work well and you'll " "have to re-create it from scratch." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:71 msgid "The scene contains a background sprite, a GUI, and two characters." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:75 msgid "The scene tree, with the GUI scene set to display its children" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:77 msgid "" "The GUI scene encapsulates all of the game's Graphical User Interface. It " "comes with a barebones script where we get the path to nodes that exist " "inside the scene:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:105 msgid "" "``number_label`` displays a life count as a number. It's a ``Label`` node" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:107 msgid "``bar`` is the life bar itself. It's a ``TextureProgress`` node" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:108 msgid "" "``tween`` is a component-style node that can animate and control any value " "or method from any other node" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:113 msgid "" "The project uses a simple organization that works for game jams and tiny " "games." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:115 msgid "" "At the root of the project, in the `res://` folder, you will find the " "`LevelMockup`. That's the main game scene and the one we will work with. All " "the components that make up the game are in the `scenes/` folder. The " "`assets/` folder contains the game sprites and the font for the HP counter. " "In the `scripts/` folder you will find the enemy, the player, and the GUI " "controller scripts." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:117 msgid "" "Click the edit scene icon to the right of the node in the scene tree to open " "the scene in the editor. You'll see the LifeBar and EnergyBar are sub-scenes " "themselves." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:121 msgid "The scene tree, with the Player scene set to display its children" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:124 msgid "Set up the Lifebar with the Player's max\\_health" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:126 msgid "" "We have to tell the GUI somehow what the player's current health is, to " "update the lifebar's texture, and to display the remaining health in the HP " "counter in the top left corner of the screen. To do this we send the " "player's health to the GUI every time they take damage. The GUI will then " "update the ``Lifebar`` and ``Number`` nodes with this value." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:132 msgid "" "We could stop here to display the number, but we need to initialize the " "bar's ``max_value`` for it to update in the right proportions. The first " "step is thus to tell the ``GUI`` what the green character's ``max_health`` " "is." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:139 msgid "" "The bar, a `TextureProgress`, has a `max_value` of `100` by default. If you " "don't need to display the character's health with a number, you don't need " "to change its `max_value` property. You send a percentage from the `Player` " "to the `GUI` instead: `health / max_health * 100`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:143 msgid "" "Click the script icon to the right of the ``GUI`` in the Scene dock to open " "its script. In the ``_ready`` function, we're going to store the " "``Player``'s ``max_health`` in a new variable and use it to set the " "``bar``'s ``max_value``:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:164 msgid "" "Let's break it down. ``$\"../Characters/Player\"`` is a shorthand that goes " "one node up in the scene tree, and retrieves the ``Characters/Player`` node " "from there. It gives us access to the node. The second part of the " "statement, ``.max_health``, accesses the ``max_health`` on the Player node." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:170 msgid "" "The second line assigns this value to ``bar.max_value``. You could combine " "the two lines into one, but we'll need to use ``player_max_health`` again " "later in the tutorial." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:174 msgid "" "``Player.gd`` sets the ``health`` to ``max_health`` at the start of the " "game, so we could work with this. Why do we still use ``max_health``? There " "are two reasons:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:178 msgid "" "We don't have the guarantee that ``health`` will always equal " "``max_health``: a future version of the game may load a level where the " "player already lost some health." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:184 msgid "" "When you open a scene in the game, Godot creates nodes one by one, following " "the order in your Scene dock, from top to bottom. `GUI` and `Player` are not " "part of the same node branch. To make sure they both exist when we access " "each other, we have to use the `_ready` function. Godot calls `_ready` right " "after it loaded all nodes, before the game starts. It's the perfect function " "to set everything up and prepare the game session. Learn more about _ready: :" "doc:`scripting_continued`" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:188 msgid "Update health with a signal when the player takes a hit" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:190 msgid "" "Our GUI is ready to receive the ``health`` value updates from the " "``Player``. To achieve this we're going to use **signals**." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:195 msgid "" "There are many useful built-in signals like `enter_tree` and `exit_tree`, " "that all nodes emit when they are respectively created and destroyed. You " "can also create your own using the `signal` keyword. On the `Player` node, " "you'll find two signals we created for you: `died` and `health_changed`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:197 msgid "" "Why don't we directly get the ``Player`` node in the ``_process`` function " "and look at the health value? Accessing nodes this way creates tight " "coupling between them. If you did it sparingly it may work. As your game " "grows bigger, you may have many more connections. If you get nodes this way " "it gets complex quickly. Not only that: you need to listen to the state " "change constantly in the ``_process`` function. This check happens 60 times " "a second and you'll likely break the game because of the order in which the " "code runs." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:206 msgid "" "On a given frame you may look at another node's property *before* it was " "updated: you get a value from the last frame. This leads to obscure bugs " "that are hard to fix. On the other hand, a signal is emitted right after a " "change happened. It **guarantees** you're getting a fresh piece of " "information. And you will update the state of your connected node *right " "after* the change happened." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:215 msgid "" "The Observer pattern, that signals derive from, still adds a bit of coupling " "between node branches. But it's generally lighter and more secure than " "accessing nodes directly to communicate between two separate classes. It can " "be okay for a parent node to get values from its children. But you'll want " "to favor signals if you're working with two separate branches. Read Game " "Programming Patterns for more information on the `Observer pattern `_. The `full book `_ is available online for free." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:219 msgid "" "With this in mind, let's connect the ``GUI`` to the ``Player``. Click on the " "``Player`` node in the scene dock to select it. Head down to the Inspector " "and click on the Node tab. This is the place to connect nodes to listen to " "the one you selected." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:224 msgid "The first section lists custom signals defined in ``Player.gd``:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:226 msgid "" "``died`` is emitted when the character died. We will use it in a moment to " "hide the UI." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:228 msgid "``health_changed`` is emitted when the character got hit." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:232 msgid "We're connecting to the health\\_changed signal" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:234 msgid "" "Select ``health_changed`` and click on the Connect button in the bottom " "right corner to open the Connect Signal window. On the left side you can " "pick the node that will listen to this signal. Select the ``GUI`` node. The " "right side of the screen lets you pack optional values with the signal. We " "already took care of it in ``Player.gd``. In general I recommend not to add " "too many arguments using this window as they're less convenient than doing " "it from the code." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:244 msgid "The Connect Signal window with the GUI node selected" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:248 msgid "" "You can optionally connect nodes from the code. However doing it from the " "editor has two advantages:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:250 msgid "Godot can write new callback functions for you in the connected script" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:251 msgid "" "An emitter icon appears next to the node that emits the signal in the Scene " "dock" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:253 msgid "" "At the bottom of the window you will find the path to the node you selected. " "We're interested in the second row called \"Method in Node\". This is the " "method on the ``GUI`` node that gets called when the signal is emitted. This " "method receives the values sent with the signal and lets you process them. " "If you look to the right, there is a \"Make Function\" radio button that is " "on by default. Click the connect button at the bottom of the window. Godot " "creates the method inside the ``GUI`` node. The script editor opens with the " "cursor inside a new ``_on_Player_health_changed`` function." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:265 msgid "" "When you connect nodes from the editor, Godot generates a method name with " "the following pattern: ``_on_EmitterName_signal_name``. If you wrote the " "method already, the \"Make Function\" option will keep it. You may replace " "the name with anything you'd like." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:272 msgid "Godot writes the callback method for you and takes you to it" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:274 msgid "" "Inside the parentheses after the function name, add a ``player_health`` " "argument. When the player emits the ``health_changed`` signal, it will send " "its current ``health`` alongside it. Your code should look like:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:292 msgid "" "The engine does not convert PascalCase to snake_case, for C# examples we'll " "be using PascalCase for method names & camelCase for method parameters, " "which follows the official `C# naming conventions. `_" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:299 msgid "" "In Player.gd, when the Player emits the health\\_changed signal, it also " "sends its health value" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:302 msgid "" "Inside ``_on_Player_health_changed``, let's call a second function called " "``update_health`` and pass it the ``player_health`` variable." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:307 msgid "" "We could directly update the health value on `LifeBar` and `Number`. There " "are two reasons to use this method instead:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:309 msgid "" "The name makes it clear for our future selves and teammates that when the " "player took damage, we update the health count on the GUI" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:310 msgid "We will reuse this method a bit later" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:312 msgid "" "Create a new ``update_health`` method below ``_on_Player_health_changed``. " "It takes a new\\_value as its only argument:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:327 msgid "This method needs to:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:329 msgid "" "set the ``Number`` node's ``text`` to ``new_value`` converted to a string" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:331 msgid "set the ``TextureProgress``'s ``value`` to ``new_value``" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:350 msgid "" "``str`` is a built-in function that converts about any value to text. " "``Number``'s ``text`` property requires a string, so we can't assign it to " "``new_value`` directly" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:354 msgid "" "Also call ``update_health`` at the end of the ``_ready`` function to " "initialize the ``Number`` node's ``text`` with the right value at the start " "of the game. Press :kbd:`F5` to test the game: the life bar updates with " "every attack!" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:361 msgid "" "Both the Number node and the TextureProgress update when the Player takes a " "hit" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:365 msgid "Animate the loss of life with the Tween node" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:367 msgid "" "Our interface is functional, but it could use some animation. That's a good " "opportunity to introduce the ``Tween`` node, an essential tool to animate " "properties. ``Tween`` animates anything you'd like from a start to an end " "state over a certain duration. For example, it can animate the health on the " "``TextureProgress`` from its current level to the ``Player``'s new " "``health`` when the character takes damage." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:374 msgid "" "The ``GUI`` scene already contains a ``Tween`` child node stored in the " "``tween`` variable. Let's now use it. We have to make some changes to " "``update_health``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:378 msgid "" "We will use the ``Tween`` node's ``interpolate_property`` method. It takes " "seven arguments:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:381 msgid "A reference to the node who owns the property to animate" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:382 msgid "The property's identifier as a string" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:383 msgid "The starting value" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:384 msgid "The end value" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:385 msgid "The animation's duration in seconds" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:386 msgid "The type of the transition" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:387 msgid "The easing to use in combination with the equation." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:389 msgid "" "The last two arguments combined correspond to an easing equation. This " "controls how the value evolves from the start to the end point." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:393 msgid "" "Click the script icon next to the ``GUI`` node to open it again. The " "``Number`` node needs text to update itself, and the ``Bar`` needs a float " "or an integer. We can use ``interpolate_property`` to animate a number, but " "not to animate text directly. We're going to use it to animate a new ``GUI`` " "variable named ``animated_health``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:399 msgid "" "At the top of the script, define a new variable, name it " "``animated_health``, and set its value to 0. Navigate back to the " "``update_health`` method and clear its content. Let's animate the " "``animated_health`` value. Call the ``Tween`` node's " "``interpolate_property`` method:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:421 msgid "Let's break down the call:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:427 msgid "" "We target ``animated_health`` on ``self``, that is to say the ``GUI`` node. " "``Tween``'s interpolate\\_property takes the property's name as a string. " "That's why we write it as ``\"animated_health\"``." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:435 msgid "" "The starting point is the current value the bar's at. We still have to code " "this part, but it's going to be ``animated_health``. The end point of the " "animation is the ``Player``'s ``health`` after the ``health_changed``: " "that's ``new_value``. And ``0.6`` is the animation's duration in seconds." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:445 msgid "" "The last two arguments are constants from the ``Tween`` class. " "``TRANS_LINEAR`` means the animation should be linear. ``EASE_IN`` doesn't " "do anything with a linear transition, but we must provide this last argument " "or we'll get an error." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:450 msgid "" "The animation will not play until we activated the ``Tween`` node with " "``tween.start()``. We only have to do this once if the node is not active. " "Add this code after the last line:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:469 msgid "" "Although we could animate the `health` property on the `Player`, we " "shouldn't. Characters should lose life instantly when they get hit. It makes " "it a lot easier to manage their state, like to know when one died. You " "always want to store animations in a separate data container or node. The " "`tween` node is perfect for code-controlled animations. For hand-made " "animations, check out `AnimationPlayer`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:472 msgid "Assign the animated\\_health to the LifeBar" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:474 msgid "" "Now the ``animated_health`` variable animates but we don't update the actual " "``Bar`` and ``Number`` nodes anymore. Let's fix this." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:477 msgid "So far, the update\\_health method looks like this:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:501 msgid "" "In this specific case, because ``number_label`` takes text, we need to use " "the ``_process`` method to animate it. Let's now update the ``Number`` and " "``TextureProgress`` nodes like before, inside of ``_process``:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:523 msgid "" "`number_label` and `bar` are variables that store references to the `Number` " "and `TextureProgress` nodes." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:525 msgid "" "Play the game to see the bar animate smoothly. But the text displays decimal " "number and looks like a mess. And considering the style of the game, it'd be " "nice for the life bar to animate in a choppier fashion." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:531 msgid "The animation is smooth, but the number is broken" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:533 msgid "" "We can fix both problems by rounding out ``animated_health``. Use a local " "variable named ``round_value`` to store the rounded ``animated_health``. " "Then assign it to ``number_label.text`` and ``bar.value``:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:555 msgid "Try the game again to see a nice blocky animation." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:559 msgid "By rounding out animated\\_health, we kill two birds with one stone" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:563 msgid "" "Every time the player takes a hit, the ``GUI`` calls " "``_on_Player_health_changed``, which in turn calls ``update_health``. This " "updates the animation and the ``number_label`` and ``bar`` follow in " "``_process``. The animated life bar that shows the health going down " "gradually is a trick. It makes the GUI feel alive. If the ``Player`` takes 3 " "damage, it happens in an instant." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:571 msgid "Fade the bar when the Player dies" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:573 msgid "" "When the green character dies, it plays a death animation and fades out. At " "this point, we shouldn't show the interface anymore. Let's fade the bar as " "well when the character died. We will reuse the same ``Tween`` node as it " "manages multiple animations in parallel for us." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:578 msgid "" "First, the ``GUI`` needs to connect to the ``Player``'s ``died`` signal to " "know when it died. Press :kbd:`F1` to jump back to the 2D Workspace. Select " "the ``Player`` node in the Scene dock and click on the Node tab next to the " "Inspector." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:583 msgid "Find the ``died`` signal, select it, and click the Connect button." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:587 msgid "The signal should already have the Enemy connected to it" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:589 msgid "" "In the Connecting Signal window, connect to the ``GUI`` node again. The Path " "to Node should be ``../../GUI`` and the Method in Node should show " "``_on_Player_died``. Leave the Make Function option on and click Connect at " "the bottom of the window. This will take you to the ``GUI.gd`` file in the " "Script Workspace." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:597 msgid "You should get these values in the Connecting Signal window" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:601 msgid "" "You should see a pattern by now: every time the GUI needs a new piece of " "information, we emit a new signal. Use them wisely: the more connections you " "add, the harder they are to track." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:603 msgid "" "To animate a fade on a UI element, we have to use its ``modulate`` property. " "``modulate`` is a ``Color`` that multiplies the colors of our textures." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:609 msgid "" "`modulate` comes from the `CanvasItem` class, All 2D and UI nodes inherit " "from it. It lets you toggle the visibility of the node, assign a shader to " "it, and modify it using a color with `modulate`." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:611 msgid "" "``modulate`` takes a ``Color`` value with 4 channels: red, green, blue and " "alpha. If we darken any of the first three channels it darkens the " "interface. If we lower the alpha channel, our interface fades out." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:615 msgid "" "We're going to tween between two color values: from a white with an alpha of " "``1``, that is to say at full opacity, to a pure white with an alpha value " "of ``0``, completely transparent. Let's add two variables at the top of the " "``_on_Player_died`` method and name them ``start_color`` and ``end_color``. " "Use the ``Color()`` constructor to build two ``Color`` values." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:637 msgid "" "``Color(1.0, 1.0, 1.0)`` corresponds to white. The fourth argument, " "respectively ``1.0`` and ``0.0`` in ``start_color`` and ``end_color``, is " "the alpha channel." msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:641 msgid "" "We then have to call the ``interpolate_property`` method of the ``Tween`` " "node again:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:654 msgid "" "This time, we change the ``modulate`` property and have it animate from " "``start_color`` to the ``end_color``. The duration is of one second, with a " "linear transition. Here again, because the transition is linear, the easing " "does not matter. Here's the complete ``_on_Player_died`` method:" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:679 msgid "And that is it. You may now play the game to see the final result!" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:683 msgid "The final result. Congratulations for getting there!" msgstr "" #: ../../docs/getting_started/step_by_step/ui_code_a_life_bar.rst:687 msgid "" "Using the exact same techniques, you can change the color of the bar when " "the Player gets poisoned, turn the bar red when its health drops low, shake " "the UI when they take a critical hit... the principle is the same: emit a " "signal to forward the information from the `Player` to the `GUI` and let the " "`GUI` process it." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:4 msgid "Splash screen" msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:7 msgid "Tutorial" msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:9 msgid "" "This is a simple tutorial to establish the basic idea of how the GUI " "subsystem works. The goal is to create a simple, static splash screen." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:15 msgid "" "Following is a file with the assets that will be used. The extracted files " "can be placed directly in your project folder and Godot will import them " "automatically." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:18 msgid ":download:`robisplash_assets.zip `." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:21 #: ../../docs/tutorials/3d/reflection_probes.rst:21 #: ../../docs/tutorials/3d/gi_probes.rst:36 #: ../../docs/tutorials/3d/baked_lightmaps.rst:40 #: ../../docs/tutorials/shading/your_first_shader/your_first_spatial_shader.rst:53 msgid "Setting up" msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:23 msgid "" "Set the display resolution to 800x450 in Project Settings, and set up a new " "scene like this:" msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:27 msgid "" "The nodes \"background\" and \"logo\" are of :ref:`TextureRect " "` type. To display an image, drag the corresponding asset " "to the texture property." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:32 msgid "" "The node \"start\" is a :ref:`TextureButton `. It takes " "several images for different states, but only the normal and pressed will be " "supplied in this example:" msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:38 msgid "Finally, the node \"copyright\" is a :ref:`Label `." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:40 msgid "Your final scene should look something like this." msgstr "" #: ../../docs/getting_started/step_by_step/splash_screen.rst:44 msgid "" "Go ahead and run the project. If you're satisfied with the results, " "continue to the next tutorial." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:4 msgid "Animations" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:9 msgid "Godot's animation system is extremely powerful and flexible." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:11 msgid "" "To begin, let's use the scene from the previous tutorial (:ref:" "`doc_splash_screen`). The goal is to add a \"fade-in\" animation to the " "splash image. Here's a copy just in case: :download:`robisplash.zip `." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:16 msgid "Add an animation player" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:18 msgid "" "First of all, add an :ref:`AnimationPlayer ` node to " "the scene as a child of \"background\" (the root node):" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:23 msgid "" "When a node of this type is selected, the animation editor panel will appear:" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:28 msgid "The animation editor panel stays visible until manually hidden." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:31 msgid "Creating the animation" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:33 msgid "" "It's time to create a new animation! Press the Animation button then select " "new from the menu. Name the animation \"intro\" when the dialog appears." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:40 msgid "" "Now that we have an animation, the property editor enters \"animation editing" "\" mode. In this mode, a key icon appears next to every property of the " "property editor. In Godot, any property of an object can be animated:" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:48 msgid "Editing the animation" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:50 msgid "The logo will appear from the top of the screen." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:52 msgid "" "With the animation editor panel open, select the \"logo\" node and set the " "\"Rect / Position\" property to ``(118, -400)`` and press the key button " "next to the property to add a keyframe:" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:58 msgid "When the dialog appears, confirm that you are creating a new track." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:60 msgid "The keyframe will be added in the animation player editor:" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:64 msgid "Move the editor cursor forward in time by clicking here:" msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:68 msgid "" "Change the logo position to ``(118, 0)`` and add a keyframe again. With two " "keyframes with different values, the animation happens." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:73 msgid "" "Pressing \"Play selected animation from start\" button on the animation " "panel (or :kbd:`Shift + D` on keyboard) will make the logo descend." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:78 msgid "" "Click the \"Autoplay on Load\" button to set the animation to start " "automatically when the scene starts." msgstr "" #: ../../docs/getting_started/step_by_step/animations.rst:83 msgid "" "And finally, when running the scene, the animation should look like this:" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:4 #: ../../docs/tutorials/threads/thread_safe_apis.rst:58 #: ../../docs/development/file_formats/tscn.rst:257 #: ../../docs/community/tutorials.rst:53 msgid "Resources" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:7 msgid "Nodes and resources" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:9 msgid "" "Up to this tutorial, we focused on the :ref:`Node ` class in " "Godot as that's the one you use to code behavior and most of the engine's " "features rely on it. There is another datatype that is just as important: :" "ref:`Resource `." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:15 msgid "" "*Nodes* give you functionality: they draw sprites, 3D models, simulate " "physics, arrange user interfaces, etc. **Resources** are **data " "containers**. They don't do anything on their own: instead, nodes use the " "data contained in resources." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:19 msgid "" "Anything Godot saves or loads from disk is a resource. Be it a scene (a ``." "tscn`` or an ``.scn`` file), an image, a script... Here are some " "``Resource`` examples: :ref:`Texture `, :ref:`Script " "`, :ref:`Mesh `, :ref:`Animation " "`, :ref:`AudioStream `, :ref:`Font " "`, :ref:`Translation `." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:26 msgid "" "When the engine loads a resource from disk, **it only loads it once**. If a " "copy of that resource is already in memory, trying to load the resource " "again will return the same copy every time. As resources only contain data, " "there is no need to duplicate them." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:31 msgid "" "Every object, be it a Node or a Resource, can export properties. There are " "many types of Properties, like String, integer, Vector2, etc., and any of " "these types can become a resource. This means that both nodes and resources " "can contain resources as properties:" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:39 msgid "External vs built-in" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:41 msgid "There are two ways to save resources. They can be:" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:43 msgid "**External** to a scene, saved on the disk as individual files." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:44 msgid "" "**Built-in**, saved inside the ``.tscn`` or the ``.scn`` file they're " "attached to." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:46 msgid "" "To be more specific, here's a :ref:`Texture ` in a :ref:" "`Sprite ` node:" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:51 msgid "" "Clicking the resource preview allows us to view and edit the resource's " "properties." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:55 msgid "" "The path property tells us where the resource comes from. In this case, it " "comes from a PNG image called ``robi.png``. When the resource comes from a " "file like this, it is an external resource. If you erase the path or this " "path is empty, it becomes a built-in resource." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:60 msgid "" "The switch between built-in and external resources happens when you save the " "scene. In the example above, if you erase the path ``\"res://robi.png\"`` " "and save, Godot will save the image inside the ``.tscn`` scene file." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:66 msgid "" "Even if you save a built-in resource, when you instance a scene multiple " "times, the engine will only load one copy of it." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:70 msgid "Loading resources from code" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:72 msgid "" "There are two ways to load resources from code. First, you can use the " "``load()`` function anytime:" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:90 msgid "" "You can also ``preload`` resources. Unlike ``load``, this function will read " "the file from disk and load it at compile-time. As a result, you cannot call " "preload with a variable path: you need to use a constant string." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:106 msgid "Loading scenes" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:108 msgid "" "Scenes are also resources, but there is a catch. Scenes saved to disk are " "resources of type :ref:`PackedScene `. The scene is " "packed inside a resource." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:112 msgid "" "To get an instance of the scene, you have to use the :ref:`PackedScene." "instance() ` method." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:133 msgid "" "This method creates the nodes in the scene's hierarchy, configures them, and " "returns the root node of the scene. You can then add it as a child of any " "other node." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:137 msgid "" "The approach has several advantages. As the :ref:`PackedScene.instance() " "` function is fast, you can create new " "enemies, bullets, effects, etc. without having to load them again from disk " "each time. Remember that, as always, images, meshes, etc. are all shared " "between the scene instances." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:144 msgid "Freeing resources" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:146 msgid "" "When a ``Resource`` is no longer in use, it will automatically free itself. " "Since, in most cases, Resources are contained in Nodes, when you free a " "node, the engine frees all the resources it owns as well if no other node " "uses them." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:151 msgid "Creating your own resources" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:153 msgid "" "Like any Object in Godot, users can also script Resources. Resource scripts " "inherit the ability to freely translate between object properties and " "serialized text or binary data (/*.tres, /*.res). They also inherit the " "reference-counting memory management from the Reference type." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:158 msgid "" "This comes with many distinct advantages over alternative data structures, " "such as JSON, CSV, or custom TXT files. Users can only import these assets " "as a :ref:`Dictionary ` (JSON) or as a :ref:`File " "` to parse. What sets Resources apart is their inheritance of :" "ref:`Object `, :ref:`Reference `, and :ref:" "`Resource ` features:" msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:165 msgid "" "They can define constants, so constants from other data fields or objects " "are not needed." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:167 msgid "" "They can define methods, including setter/getter methods for properties. " "This allows for abstraction and encapsulation of the underlying data. If the " "Resource script's structure needs to change, the game using the Resource " "need not also change." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:169 msgid "" "They can define signals, so Resources can trigger responses to changes in " "the data they manage." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:171 msgid "" "They have defined properties, so users know 100% that their data will exist." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:173 msgid "" "Resource auto-serialization and deserialization is a built-in Godot Engine " "feature. Users do not need to implement custom logic to import/export a " "resource file's data." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:175 msgid "" "Resources can even serialize sub-Resources recursively, meaning users can " "design even more sophisticated data structures." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:177 msgid "" "Users can save Resources as version-control-friendly text files (\\*.tres). " "Upon exporting a game, Godot serializes resource files as binary files (\\*." "res) for increased speed and compression." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:179 msgid "" "Godot Engine's Inspector renders and edits Resource files out-of-the-box. As " "such, users often do not need to implement custom logic to visualize or edit " "their data. To do so, double-click the resource file in the FileSystem dock " "or click the folder icon in the Inspector and open the file in the dialog." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:181 msgid "" "They can extend **other** resource types besides just the base Resource." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:183 msgid "Godot makes it easy to create custom Resources in the Inspector." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:185 msgid "" "Create a plain Resource object in the Inspector. This can even be a type " "that derives Resource, so long as your script is extending that type." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:186 msgid "Set the ``script`` property in the Inspector to be your script." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:188 msgid "" "The Inspector will now display your Resource script's custom properties. If " "one edits those values and saves the resource, the Inspector serializes the " "custom properties too! To save a resource from the Inspector, click the " "Inspector's tools menu (top right), and select \"Save\" or \"Save As...\"." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:193 msgid "" "If the script's language supports :ref:`script classes " "`, then it streamlines the process. " "Defining a name for your script alone will add it to the Inspector's " "creation dialog. This will auto-add your script to the Resource object you " "create." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:198 msgid "Let's see some examples." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:271 msgid "" "Resource scripts are similar to Unity's ScriptableObjects. The Inspector " "provides built-in support for custom resources. If desired though, users can " "even design their own Control-based tool scripts and combine them with an :" "ref:`EditorPlugin ` to create custom visualizations and " "editors for their data." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:277 msgid "" "Unreal Engine 4's DataTables and CurveTables are also easy to recreate with " "Resource scripts. DataTables are a String mapped to a custom struct, similar " "to a Dictionary mapping a String to a secondary custom Resource script." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:313 msgid "" "Instead of just inlining the Dictionary values, one could also, " "alternatively..." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:315 msgid "" "Import a table of values from a spreadsheet and generate these key-value " "pairs, or..." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:317 msgid "" "Design a visualization within the editor and create a simple plugin that " "adds it to the Inspector when you open these types of Resources." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:320 msgid "" "CurveTables are the same thing, except mapped to an Array of float values or " "a :ref:`Curve `/:ref:`Curve2D ` resource object." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:325 msgid "" "Beware that resource files (\\*.tres/\\*.res) will store the path of the " "script they use in the file. When loaded, they will fetch and load this " "script as an extension of their type. This means that trying to assign a " "subclass, i.e. an inner class of a script (such as using the ``class`` " "keyword in GDScript) won't work. Godot will not serialize the custom " "properties on the script subclass properly." msgstr "" #: ../../docs/getting_started/step_by_step/resources.rst:331 msgid "" "In the example below, Godot would load the ``Node`` script, see that it " "doesn't extend ``Resource``, and then determine that the script failed to " "load for the Resource object since the types are incompatible." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:4 msgid "File system" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:9 msgid "" "A file system manages how assets are stored and how they are accessed. A " "well-designed file system also allows multiple developers to edit the same " "source files and assets while collaborating. Godot stores all assets as " "files in its file system." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:15 msgid "Implementation" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:17 msgid "" "The file system stores resources on disk. Anything, from a script, to a " "scene or a PNG image is a resource to the engine. If a resource contains " "properties that reference other resources on disk, the paths to those " "resources are also included. If a resource has sub-resources that are built-" "in, the resource is saved in a single file together with all the bundled sub-" "resources. For example, a font resource is often bundled together with the " "font textures." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:24 msgid "" "The Godot file system avoids using metadata files. Existing asset managers " "and VCSs are better than anything we can implement, so Godot tries its best " "to play along with SVN, Git, Mercurial, Perforce, etc." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:28 msgid "Example of file system contents:" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:39 msgid "project.godot" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:41 msgid "" "The project.godot file is the project description file, and it is always " "found at the root of the project. In fact, its location defines where the " "root is. This is the first file that Godot looks for when opening a project." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:45 msgid "" "This file contains the project configuration in plain text, using the win." "ini format. Even an empty project.godot can function as a basic definition " "of a blank project." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:50 msgid "Path delimiter" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:52 msgid "" "Godot only supports ``/`` as a path delimiter. This is done for portability " "reasons. All operating systems support this, even Windows, so a path such as " "``c:\\project\\project.godot`` needs to be typed as ``c:/project/project." "godot``." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:58 #: ../../docs/tutorials/io/data_paths.rst:16 msgid "Resource path" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:60 msgid "" "When accessing resources, using the host OS file system layout can be " "cumbersome and non-portable. To solve this problem, the special path ``res://" "`` was created." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:64 msgid "" "The path ``res://`` will always point at the project root (where project." "godot is located, so ``res://project.godot`` is always valid)." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:68 msgid "" "This file system is read-write only when running the project locally from " "the editor. When exported or when running on different devices (such as " "phones or consoles, or running from DVD), the file system will become read-" "only and writing will no longer be permitted." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:74 msgid "User path" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:76 msgid "" "Writing to disk is still needed for tasks such as saving game state or " "downloading content packs. To this end, the engine ensures that there is a " "special path ``user://`` that is always writable." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:81 msgid "Host file system" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:83 msgid "" "Alternatively host file system paths can also be used, but this is not " "recommended for a released product as these paths are not guaranteed to work " "on all platforms. However, using host file system paths can be useful when " "writing development tools in Godot." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:89 msgid "Drawbacks" msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:91 msgid "" "There are some drawbacks to this simple file system design. The first issue " "is that moving assets around (renaming them or moving them from one path to " "another inside the project) will break existing references to these assets. " "These references will have to be re-defined to point at the new asset " "location." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:96 msgid "" "To avoid this, do all your move, delete and rename operations from within " "Godot, on the FileSystem dock. Never move assets from outside Godot, or " "dependencies will have to be fixed manually (Godot detects this and helps " "you fix them anyway, but why go the hard route?)." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:101 msgid "" "The second is that, under Windows and macOS, file and path names are case " "insensitive. If a developer working in a case insensitive host file system " "saves an asset as \"myfile.PNG\", but then references it as \"myfile.png\", " "it will work fine on their platform, but not on other platforms, such as " "Linux, Android, etc. This may also apply to exported binaries, which use a " "compressed package to store all files." msgstr "" #: ../../docs/getting_started/step_by_step/filesystem.rst:107 msgid "" "It is recommended that your team clearly define a naming convention for " "files when working with Godot. One simple fool-proof convention is to only " "allow lowercase file and path names." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:4 #: ../../docs/getting_started/step_by_step/scene_tree.rst:33 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:288 msgid "SceneTree" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:9 msgid "" "In previous tutorials, everything revolved around the concept of nodes. " "Scenes are collections of nodes. They become active once they enter the " "*scene tree*." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:14 msgid "MainLoop" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:16 msgid "" "The way Godot works internally is as follows. There is the :ref:`OS " "` class, which is the only instance that runs at the beginning. " "Afterwards, all drivers, servers, scripting languages, scene system, etc are " "loaded." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:21 msgid "" "When initialization is complete, :ref:`OS ` needs to be supplied " "a :ref:`MainLoop ` to run. Up to this point, all this is " "internals working (you can check main/main.cpp file in the source code if " "you are ever interested to see how this works internally)." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:27 msgid "" "The user program, or game, starts in the MainLoop. This class has a few " "methods, for initialization, idle (frame-synchronized callback), fixed " "(physics-synchronized callback), and input. Again, this is low level and " "when making games in Godot, writing your own MainLoop seldom makes sense." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:35 msgid "" "One of the ways to explain how Godot works is that it's a high level game " "engine over a low level middleware." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:38 msgid "" "The scene system is the game engine, while the :ref:`OS ` and " "servers are the low level API." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:41 msgid "" "The scene system provides its own main loop to OS, :ref:`SceneTree " "`. This is automatically instanced and set when running a " "scene, no need to do any extra work." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:46 msgid "" "It's important to know that this class exists because it has a few important " "uses:" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:49 msgid "" "It contains the root :ref:`Viewport `, to which a scene is " "added as a child when it's first opened to become part of the *Scene Tree* " "(more on that next)." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:52 msgid "" "It contains information about the groups and has the means to call all nodes " "in a group or get a list of them." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:54 msgid "" "It contains some global state functionality, such as setting pause mode or " "quitting the process." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:57 msgid "" "When a node is part of the Scene Tree, the :ref:`SceneTree " "` singleton can be obtained by calling :ref:`Node." "get_tree() `." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:63 msgid "Root viewport" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:65 msgid "" "The root :ref:`Viewport ` is always at the top of the scene. " "From a node, it can be obtained in two different ways:" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:80 msgid "" "This node contains the main viewport. Anything that is a child of a :ref:" "`Viewport ` is drawn inside of it by default, so it makes " "sense that the top of all nodes is always a node of this type otherwise " "nothing would be seen." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:85 msgid "" "While other viewports can be created in the scene (for split-screen effects " "and such), this one is the only one that is never created by the user. It's " "created automatically inside SceneTree." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:90 #: ../../docs/tutorials/threads/thread_safe_apis.rst:22 msgid "Scene tree" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:92 msgid "" "When a node is connected, directly or indirectly, to the root viewport, it " "becomes part of the *scene tree*." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:95 msgid "" "This means that as explained in previous tutorials, it will get the " "_enter_tree() and _ready() callbacks (as well as _exit_tree())." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:100 msgid "" "When nodes enter the *Scene Tree*, they become active. They get access to " "everything they need to process, get input, display 2D and 3D visuals, " "receive and send notifications, play sounds, etc. When they are removed from " "the *scene tree*, they lose these abilities." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:106 msgid "Tree order" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:108 msgid "" "Most node operations in Godot, such as drawing 2D, processing, or getting " "notifications are done in tree order. This means that parents and siblings " "with a lower rank in the tree order will get notified before the current " "node." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:116 msgid "\"Becoming active\" by entering the *Scene Tree*" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:118 msgid "A scene is loaded from disk or created by scripting." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:119 msgid "" "The root node of that scene (only one root, remember?) is added as either a " "child of the \"root\" Viewport (from SceneTree), or to any child or " "grandchild of it." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:122 msgid "" "Every node of the newly added scene, will receive the \"enter_tree\" " "notification ( _enter_tree() callback in GDScript) in top-to-bottom order." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:125 msgid "" "An extra notification, \"ready\" ( _ready() callback in GDScript) is " "provided for convenience, when a node and all its children are inside the " "active scene." msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:128 msgid "" "When a scene (or part of it) is removed, they receive the \"exit scene\" " "notification ( _exit_tree() callback in GDScript) in bottom-to-top order" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:133 msgid "Changing current scene" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:135 msgid "" "After a scene is loaded, it is often desired to change this scene for " "another one. The simple way to do this is to use the :ref:`SceneTree." "change_scene() ` function:" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:153 msgid "" "Rather than using file paths, one can also use ready-made :ref:`PackedScene " "` resources using the equivalent function :ref:`SceneTree." "change_scene_to(PackedScene scene) `:" msgstr "" #: ../../docs/getting_started/step_by_step/scene_tree.rst:174 msgid "" "These are quick and useful ways to switch scenes but have the drawback that " "the game will stall until the new scene is loaded and running. At some point " "in the development of your game, it may be preferable to create proper " "loading screens with progress bar, animated indicators or thread " "(background) loading. This must be done manually using autoloads (see next " "chapter) and :ref:`doc_background_loading`." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:4 msgid "Singletons (AutoLoad)" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:9 msgid "" "Godot's scene system, while powerful and flexible, has a drawback: there is " "no method for storing information (e.g. a player's score or inventory) that " "is needed by more than one scene." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:13 msgid "" "It's possible to address this with some workarounds, but they come with " "their own limitations:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:16 msgid "" "You can use a \"master\" scene that loads and unloads other scenes as its " "children. However, this means you can no longer run those scenes " "individually and expect them to work correctly." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:19 msgid "" "Information can be stored to disk in ``user://`` and then loaded by scenes " "that require it, but frequently saving and loading data is cumbersome and " "may be slow." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:23 msgid "" "The `Singleton Pattern `_ " "is a useful tool for solving the common use case where you need to store " "persistent information between scenes. In our case it is possible re-use the " "same scene or class for multiple singletons, so long as they have different " "names." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:29 msgid "Using this concept, you can create objects that:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:31 msgid "Are always loaded, no matter which scene is currently running" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:32 msgid "Can store global variables, such as player information" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:33 msgid "Can handle switching scenes and between-scene transitions" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:34 msgid "" "Act like a singleton, since GDScript does not support global variables by " "design" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:36 msgid "Autoloading nodes and scripts can give us these characteristics." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:39 msgid "AutoLoad" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:41 msgid "" "You can use AutoLoad to load a scene or a script that inherits from :ref:" "`Node `. Note: when autoloading a script, a Node will be created " "and the script will be attached to it. This node will be added to the root " "viewport before any other scenes are loaded." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:48 msgid "" "To autoload a scene or script, select ``Project -> Project Settings`` from " "the menu and switch to the \"AutoLoad\" tab." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:53 msgid "" "Here you can add any number of scenes or scripts. Each entry in the list " "requires a name, which is assigned as the node's ``name`` property. The " "order of the entries as they are added to the global scene tree can be " "manipulated using the up/down arrow keys." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:60 msgid "" "This means that any node can access a singleton named \"PlayerVariables\" " "with:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:73 msgid "" "If the \"Enable\" column is checked (default ``true``) then the singleton " "can simply be accessed directly:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:86 msgid "" "Note that autoload objects (scripts and/or scenes) are accessed just like " "any other node in the scene tree. In fact, if you look at the running scene " "tree, you'll see the autoloaded nodes appear:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:93 msgid "Custom scene switcher" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:95 msgid "" "This tutorial will demonstrate building a scene switcher using autoload. For " "basic scene switching, you can use the :ref:`SceneTree.change_scene() " "` method (see :ref:`doc_scene_tree` for " "details). However, if you need more complex behavior when changing scenes, " "this method provides more functionality." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:101 msgid "" "To begin, download the template from here: :download:`autoload.zip ` and open it in Godot." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:104 msgid "" "The project contains two scenes: ``Scene1.tscn`` and ``Scene2.tscn``. Each " "scene contains a label displaying the scene name and a button with its " "``pressed()`` signal connected. When you run the project, it starts in " "``Scene1.tscn``. However, pressing the button does nothing." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:110 msgid "Global.gd" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:112 msgid "" "Switch to the \"Script\" tab and create a new script called Global.gd. Make " "sure it inherits from ``Node``:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:117 msgid "" "The next step is to add this script to the autoLoad list. Open ``Project > " "Project Settings`` from the menu, switch to the \"AutoLoad\" tab and select " "the script by clicking the browse button or typing its path: ``res://Global." "gd``. Press \"Add\" to add it to the autoload list:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:124 msgid "" "Now whenever we run any scene in the project, this script will always be " "loaded." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:126 msgid "" "Returning to the script, it needs to fetch the current scene in the " "`_ready()` function. Both the current scene (the one with the button) and " "``global.gd`` are children of root, but autoloaded nodes are always first. " "This means that the last child of root is always the loaded scene." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:158 msgid "" "Now we need a function for changing the scene. This function needs to free " "the current scene and replace it with the requested one." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:227 msgid "" "Using :ref:`Object.call_deferred() `, the " "second function will only run once all code from the current scene has " "completed. Thus, the current scene will not be removed while it is still " "being used (i.e. its code is still running)." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:232 msgid "" "Finally, we need to fill the empty callback functions in the two scenes:" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:252 #: ../../docs/tutorials/math/vector_math.rst:264 msgid "and" msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:272 msgid "" "Run the project and test that you can switch between scenes by pressing the " "button." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:275 msgid "" "Note: When scenes are small, the transition is instantaneous. However, if " "your scenes are more complex, they may take a noticeable amount of time to " "appear. To learn how to handle this, see the next tutorial: :ref:" "`doc_background_loading`" msgstr "" #: ../../docs/getting_started/editor/index.rst:2 msgid "Editor manual" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:8 #, fuzzy msgid "From Unity to Godot Engine" msgstr "Về Godot Engine" #: ../../docs/getting_started/editor/unity_to_godot.rst:10 msgid "" "This guide provides an overview of Godot Engine from the viewpoint of a " "Unity user, and aims to help you migrate your existing Unity experience into " "the world of Godot." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:15 msgid "" "This article talks about older versions of Unity. Nestable prefabs ('Nested " "prefabs') were added to Unity 2018.3. Nestable prefabs are analogous to " "Godot's scenes, and allow a more Godot-like approach to scene organization." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:18 msgid "Differences" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:21 msgid "Unity" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:21 msgid "Godot" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:23 #: ../../docs/community/contributing/documentation_guidelines.rst:133 msgid "License" msgstr "Cấp phép" #: ../../docs/getting_started/editor/unity_to_godot.rst:23 msgid "" "Proprietary, closed, free license with revenue caps and usage restrictions" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:23 msgid "MIT license, free and fully open source without any restriction" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:25 msgid "OS (editor)" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:25 msgid "Windows, macOS, Linux" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:25 msgid "Windows, macOS, X11 (Linux, \\*BSD)" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:27 msgid "OS (export)" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:27 msgid "**Desktop:** Windows, macOS, Linux" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:28 msgid "**Mobile:** Android, iOS, Windows Phone, Tizen" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:29 msgid "**Web:** WebAssembly or asm.js" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:30 msgid "**Consoles:** PS4, PS Vita, Xbox One, Xbox 360, Wii U, Nintendo 3DS" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:31 msgid "" "**VR:** Oculus Rift, SteamVR, Google Cardboard, PlayStation VR, Gear VR, " "HoloLens" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:32 msgid "**TV:** Android TV, Samsung SMART TV, tvOS" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:27 msgid "**Desktop:** Windows, macOS, X11" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:28 msgid "**Mobile:** Android, iOS" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:29 msgid "**Web:** WebAssembly" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:30 msgid "**Console:** See :ref:`doc_consoles`" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:31 msgid "**VR:** Oculus Rift, SteamVR" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:34 msgid "Scene system" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:34 msgid "Component/Scene (GameObject > Component)" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:35 msgid "Prefabs" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:34 msgid "" ":ref:`Scene tree and nodes `, allowing scenes to be " "nested and/or inherit other scenes" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:37 msgid "Third-party tools" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:37 msgid "Visual Studio or VS Code" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:37 msgid ":ref:`External editors are possible `" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:38 msgid ":ref:`Android SDK for Android export `" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:40 msgid "Notable advantages" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:40 msgid "Huge community" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:41 msgid "Large assets store" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:40 msgid "Scene System" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:41 msgid ":ref:`Animation Pipeline `" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:42 msgid ":ref:`Easy to write Shaders `" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:43 msgid "Debug on Device" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:50 msgid "The editor" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:52 msgid "" "Godot Engine provides a rich-featured editor that allows you to build your " "games. The pictures below display the default layouts of both editors with " "colored blocks to indicate common functionalities." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:58 msgid "" "While both editors may seem similar, there are many differences below the " "surface. Both let you organize the project using the filesystem, but Godot's " "approach is simpler with a single configuration file, minimalist text " "format, and no metadata. This makes Godot more friendly to VCS systems, such " "as Git, Subversion, or Mercurial." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:63 msgid "" "Godot's Scene panel is similar to Unity's Hierarchy panel but, as each node " "has a specific function, the approach used by Godot is more visually " "descriptive. It's easier to understand what a scene does at a glance." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:67 msgid "" "The Inspector in Godot is more minimal, it shows only properties. Thanks to " "this, objects can expose more useful parameters to the user without having " "to hide functionality in language APIs. As a plus, Godot allows animating " "any of those properties visually. Changing colors, textures, enumerations, " "or even links to resources in real-time is possible without needing to write " "code." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:72 msgid "" "The Toolbar at the top of the screen is similar in both editors, offering " "control over project playback. Projects in Godot run in a separate window, " "rather than inside the editor (but the tree and objects can still be " "explored in the debugger window)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:76 msgid "This approach has several advantages:" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:78 msgid "" "Running the project and closing it is fast (Unity has to save, run the " "project, close the project, and then reload the previous state)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:79 msgid "" "Live editing is a lot more useful because changes done to the editor take " "effect immediately in the game and are not lost (nor have to be synced) when " "the game is closed. This allows fantastic workflows, like creating levels " "while you play them." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:80 msgid "The editor is more stable because the game runs in a separate process." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:81 msgid "" "The running game can be explored from different angles by toggling the " "\"Camera Override\" button in the editor viewport, which will switch between " "using the editor view and the game camera view." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:83 msgid "" "Finally, Godot's top toolbar includes a menu for remote debugging. These " "options allow deployment to a device (connected phone, tablet, or browser " "via HTML5), and debugging/live editing on it after the game is exported." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:88 msgid "The scene system" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:90 msgid "" "This is the most important difference between Unity and Godot and the " "favorite feature of most Godot users." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:92 msgid "" "Working on a 'level' in Unity usually means embedding all the required " "assets in a scene and linking them together with components and scripts." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:95 msgid "" "Godot's scene system is superficially similar to Unity. A 'level' consists " "of a collection of nodes, each with its own purpose: Sprite, Mesh, Light, " "etc. However, in Godot the nodes are arranged in a tree. Each node can have " "multiple children, which makes each a subscene of the main scene. This means " "you can compose a whole scene with different scenes stored in different " "files." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:98 msgid "" "For example, think of a platformer level. You would compose it with multiple " "elements:" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:100 msgid "Bricks" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:101 msgid "Coins" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:102 msgid "The player" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:103 msgid "The enemies" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:105 msgid "" "In Unity, you would put all the GameObjects in the scene: the player, " "multiple instances of enemies, bricks everywhere to form the ground of the " "level and then multiple instances of coins all over the level. You would " "then add various components to each element to link them and add logic in " "the level: For example, you'd add a BoxCollider2D to all the elements of the " "scene so that they can collide. This principle is different in Godot." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:110 msgid "" "In Godot, you would split your whole scene into three separate, smaller " "scenes, and instance them in the main scene." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:112 msgid "**A scene for the Player alone.**" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:114 msgid "" "Consider the player as an element we'd like to use in different parent " "scenes (for instance 'level' scenes). In our case, the player element needs " "at least an AnimatedSprite node. This node contains the sprite textures " "necessary for various animations (for example, a walking animation)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:116 msgid "**A scene for the Enemy.**" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:118 msgid "" "An enemy is also an element we'd like to use in several scenes. It's almost " "the same as the Player node. The only differences are the script (it needs " "'AI' routines to generate the enemy's behavior) and the sprite textures used " "by the AnimatedSprite node." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:122 msgid "**A Level scene.**" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:124 msgid "" "A Level scene is composed of Bricks (for platforms), Coins (for the player " "to collect) and a number of instances of the Enemy scene. Each instance is a " "node in the Level scene tree. These instances are separate enemies, which " "initially have shared behavior and appearance as defined in the Enemy scene. " "You can set different properties for each Enemy node (to change its color, " "for example)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:128 msgid "" "4. **A Main scene.** The Main scene would be composed of one root node with " "2 children: a Player instance node, and a Level instance node. The root node " "can be anything, generally a \"root\" type such as \"Node\" which is the " "most global type, or \"Node2D\" (root type of all 2D-related nodes), " "\"Spatial\" (root type of all 3D-related nodes) or \"Control\" (root type of " "all GUI-related nodes)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:134 msgid "" "As you can see, every scene is organized as a tree. The same goes for nodes' " "properties: you don't *add* a collision component to a node to make it " "collidable like Unity does. Instead, you make this node a *child* of a new " "specific node that has collision properties. Godot features various " "collision types nodes, depending on the usage (see the :ref:`Physics " "introduction `)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:139 msgid "" "What are the advantages of this system? Wouldn't this system potentially " "increase the depth of the scene tree? And doesn't Unity already allow you to " "organize GameObjects by putting them inside empty GameObjects?" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:141 msgid "" "Godot's system is closer to the well-known object-oriented paradigm: Godot " "provides a number of nodes which are not clearly \"Game Objects\", but they " "provide their children with their own capabilities: this is inheritance." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:142 msgid "" "Godot allows the extraction of a subtree of a scene to make it a scene of " "its own. So if a scene tree gets too deep, it can be split into smaller " "subtrees. This is better for reusability, as you can include any subtree as " "a child of any node. Putting multiple GameObjects in an empty GameObject in " "Unity does not provide the same functionality." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:145 #: ../../docs/getting_started/workflow/project_setup/project_organization.rst:4 msgid "Project organization" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:149 msgid "" "There is no perfect project architecture. Any architecture can be made to " "work in either Unity and Godot." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:152 msgid "" "However, a common architecture for Unity projects is to have one Assets " "folder in the root directory that contains various folders, one per type of " "asset: Audio, Graphics, Models, Materials, Scripts, Scenes, and so on." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:155 msgid "" "Since Godot allows splitting scenes into smaller scenes, each scene and " "subscene existing as a file in the project, we recommend organizing your " "project a bit differently. This wiki provides a page for this: :ref:" "`doc_project_organization`." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:160 msgid "Where are my prefabs?" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:162 msgid "" "A prefab as provided by Unity is a 'template' element of the scene. It is " "reusable, and each instance of the prefab that exists in the scene has an " "existence of its own, but all of them have the same properties as defined by " "the prefab." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:166 msgid "" "Godot does not provide prefabs as such, but the same functionality is " "provided by its scene system: The scene system is organized as a tree. Godot " "allows you to save any subtree of a scene as a scene file. This new scene " "can then be instanced as many times as you want, as a child of any node. Any " "change you make to this new, separate scene will be applied to its " "instances. However, any change you make to the instance will not have any " "impact on the 'template' scene." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:173 msgid "" "To be precise, you can modify the parameters of an instance in the Inspector " "panel. The nodes that compose this instance are initially locked. You can " "unlock them if you need to by right-clicking the instance in the Scene tree " "and selecting \"Editable children\" in the menu. You don't need to do this " "to add *new* child nodes to this node. Remember that any new children will " "belong to the instance, not to the 'template' scene on disk. If you want to " "add new children to every instance of your 'template' scene, then you should " "add them in the 'template' scene." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:183 msgid "Glossary correspondence" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:185 msgid "GameObject -> Node" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:186 msgid "Add a component -> Inheriting" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:187 msgid "Prefab -> Reusable Scene file" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:191 msgid "Scripting: GDScript, C# and Visual Script" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:194 msgid "Design" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:196 msgid "" "Unity supports C#. C# benefits from its integration with Visual Studio and " "has desirable features such as static typing." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:198 msgid "" "Godot provides its own scripting language, :ref:`GDScript ` " "as well as support for :ref:`Visual Script ` and :ref:`C# `. GDScript borrows its syntax " "from Python, but is not related to it. If you wonder about the reasoning for " "a custom scripting language, please read the :ref:`doc_gdscript` and :ref:" "`doc_faq` pages. GDScript is strongly attached to the Godot API and doesn't " "take long to learn: Between one evening for an experienced programmer and a " "week for a complete beginner." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:204 msgid "" "Unity allows you to attach as many scripts as you want to a GameObject. Each " "script adds a behavior to the GameObject: For example, you can attach a " "script so that it reacts to the player's controls, and another that controls " "its specific game logic." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:208 msgid "" "In Godot, you can only attach one script per node. You can use either an " "external GDScript file or include the script directly in the node. If you " "need to attach more scripts to one node, then you may consider two " "solutions, depending on your scene and on what you want to achieve:" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:212 msgid "" "either add a new node between your target node and its current parent, then " "add a script to this new node." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:213 msgid "" "or, you can split your target node into multiple children and attach one " "script to each of them." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:215 msgid "" "As you can see, it can be easy to turn a scene tree to a mess. Consider " "splitting any complicated scene into multiple, smaller branches." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:218 msgid "Connections: groups and signals" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:220 msgid "" "You can control nodes by accessing them via script and calling built-in or " "user-defined functions on them. You can also place nodes in a group and call " "functions on all nodes in this group. See more in the :ref:`scripting " "documentation `." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:225 msgid "" "Nodes can send a signal when a specified action occurs. A signal can be set " "to call any function. You can define custom signals and specify when they " "are triggered. See more in the :ref:`signals documentation " "`." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:230 msgid "Script serialization" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:232 msgid "Unity can handle script serialization in two ways:" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:234 msgid "" "Implicit: All public fields in a class are automatically serialized if the " "type is a serializable type (``Dictionary`` is not serializable)." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:235 msgid "" "Explicit: Non-public fields can be serialized using the ``[SerializeField]`` " "attribute." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:237 msgid "" "Godot also has a built-in script serialization system, but it works only " "explicitly. You can serialize any serializable type (:ref:`built-in and " "various engine types `, including :ref:" "`class_Array` and :ref:`class_Dictionary`) using the ``export`` keyword. See " "the :ref:`exports documentation ` for details." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:242 msgid "" "Unity also has a data type called ``ScriptableObject`` used to serialize " "custom asset objects. Its equivalent in Godot is the base class for all " "resources: :ref:`class_Resource`. Creating a script that inherits :ref:" "`class_Resource` will allow you to create custom serializable objects. More " "information about resources can be found :ref:`here `." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:247 msgid "Using Godot in C++" msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:249 msgid "" "Godot allows you to develop your project directly in C++ by using its API, " "which is not possible with Unity at the moment. As an example, you can " "consider Godot Engine's editor as a \"game\" written in C++ using the Godot " "API." msgstr "" #: ../../docs/getting_started/editor/unity_to_godot.rst:252 msgid "" "If you are interested in using Godot in C++, you may want to start reading " "the :ref:`Developing in C++ ` page." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:4 msgid "Command line tutorial" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:8 msgid "" "Some developers like using the command line extensively. Godot is designed " "to be friendly to them, so here are the steps for working entirely from the " "command line. Given the engine relies on almost no external libraries, " "initialization times are pretty fast, making it suitable for this workflow." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:15 msgid "Command line reference" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:17 msgid "**General options**" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:20 #: ../../docs/getting_started/editor/command_line_tutorial.rst:34 #: ../../docs/getting_started/editor/command_line_tutorial.rst:62 #: ../../docs/getting_started/editor/command_line_tutorial.rst:90 #: ../../docs/getting_started/editor/command_line_tutorial.rst:120 #: ../../docs/tutorials/gui/bbcode_in_richtextlabel.rst:51 #: ../../docs/development/cpp/configuring_an_ide/qt_creator.rst:59 msgid "Command" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:20 #: ../../docs/getting_started/editor/command_line_tutorial.rst:34 #: ../../docs/getting_started/editor/command_line_tutorial.rst:62 #: ../../docs/getting_started/editor/command_line_tutorial.rst:90 #: ../../docs/getting_started/editor/command_line_tutorial.rst:120 #: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:141 #: ../../docs/getting_started/scripting/creating_script_templates.rst:125 #: ../../docs/getting_started/workflow/assets/importing_images.rst:94 #: ../../docs/tutorials/inputs/inputevent.rst:130 #: ../../docs/tutorials/gui/bbcode_in_richtextlabel.rst:51 #: ../../docs/tutorials/shading/shading_reference/shading_language.rst:21 #: ../../docs/tutorials/shading/shading_reference/shading_language.rst:471 #: ../../docs/tutorials/shading/shading_reference/shading_language.rst:517 #: ../../docs/tutorials/shading/shading_reference/shading_language.rst:581 #: ../../docs/tutorials/shading/shading_reference/spatial_shader.rst:15 #: ../../docs/tutorials/shading/shading_reference/spatial_shader.rst:94 #: ../../docs/tutorials/shading/shading_reference/spatial_shader.rst:139 #: ../../docs/tutorials/shading/shading_reference/spatial_shader.rst:191 #: ../../docs/tutorials/shading/shading_reference/spatial_shader.rst:302 #: ../../docs/tutorials/shading/shading_reference/canvas_item_shader.rst:17 #: ../../docs/tutorials/shading/shading_reference/canvas_item_shader.rst:52 #: ../../docs/tutorials/shading/shading_reference/canvas_item_shader.rst:110 #: ../../docs/tutorials/shading/shading_reference/canvas_item_shader.rst:161 #: ../../docs/tutorials/shading/shading_reference/canvas_item_shader.rst:214 #: ../../docs/tutorials/shading/shading_reference/particle_shader.rst:30 #: ../../docs/tutorials/shading/shading_reference/particle_shader.rst:53 #: ../../docs/tutorials/shading/shading_reference/particle_shader.rst:65 #: ../../docs/tutorials/shading/migrating_to_godot_shader_language.rst:92 #: ../../docs/tutorials/shading/migrating_to_godot_shader_language.rst:158 #: ../../docs/tutorials/shading/migrating_to_godot_shader_language.rst:218 #: ../../docs/tutorials/plugins/editor/import_plugins.rst:240 #: ../../docs/tutorials/misc/binary_serialization_api.rst:95 #: ../../docs/tutorials/misc/binary_serialization_api.rst:104 #: ../../docs/tutorials/misc/binary_serialization_api.rst:113 #: ../../docs/tutorials/misc/binary_serialization_api.rst:122 #: ../../docs/tutorials/misc/binary_serialization_api.rst:135 #: ../../docs/tutorials/misc/binary_serialization_api.rst:146 #: ../../docs/tutorials/misc/binary_serialization_api.rst:161 #: ../../docs/tutorials/misc/binary_serialization_api.rst:174 #: ../../docs/tutorials/misc/binary_serialization_api.rst:193 #: ../../docs/tutorials/misc/binary_serialization_api.rst:208 #: ../../docs/tutorials/misc/binary_serialization_api.rst:223 #: ../../docs/tutorials/misc/binary_serialization_api.rst:242 #: ../../docs/tutorials/misc/binary_serialization_api.rst:267 #: ../../docs/tutorials/misc/binary_serialization_api.rst:298 #: ../../docs/tutorials/misc/binary_serialization_api.rst:313 #: ../../docs/tutorials/misc/binary_serialization_api.rst:322 #: ../../docs/tutorials/misc/binary_serialization_api.rst:333 #: ../../docs/tutorials/misc/binary_serialization_api.rst:343 #: ../../docs/tutorials/misc/binary_serialization_api.rst:362 #: ../../docs/tutorials/misc/binary_serialization_api.rst:374 #: ../../docs/tutorials/misc/binary_serialization_api.rst:386 #: ../../docs/tutorials/misc/binary_serialization_api.rst:399 #: ../../docs/tutorials/misc/binary_serialization_api.rst:410 #: ../../docs/tutorials/misc/binary_serialization_api.rst:421 #: ../../docs/tutorials/misc/binary_serialization_api.rst:429 #: ../../docs/tutorials/misc/binary_serialization_api.rst:442 #: ../../docs/tutorials/misc/binary_serialization_api.rst:455 #: ../../docs/tutorials/misc/binary_serialization_api.rst:470 msgid "Description" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:22 msgid "``-h``, ``--help``, ``/?``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:22 msgid "Display the list of command line options." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:24 msgid "``--version``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:24 msgid "Display the version string." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:26 msgid "``-v``, ``--verbose``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:26 msgid "Use verbose stdout mode." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:28 msgid "``--quiet``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:28 msgid "Quiet mode, silences stdout messages. Errors are still displayed." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:31 msgid "**Run options**" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:36 msgid "``-e``, ``--editor``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:36 msgid "" "Start the editor instead of running the scene (:ref:`tools " "` must be enabled)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:38 msgid "``-p``, ``--project-manager``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:38 msgid "" "Start the project manager, even if a project is auto-detected (:ref:`tools " "` must be enabled)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:40 msgid "``-q``, ``--quit``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:40 msgid "Quit after the first iteration." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:42 msgid "``-l ``, ``--language ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:42 msgid "" "Use a specific locale ( being a two-letter code). See :ref:" "`doc_locales` for more details." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:44 msgid "``--path ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:44 msgid "Path to a project ( must contain a 'project.godot' file)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:46 msgid "``-u``, ``--upwards``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:46 msgid "Scan folders upwards for 'project.godot' file." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:48 msgid "``--main-pack ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:48 msgid "Path to a pack (.pck) file to load." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:50 msgid "``--render-thread ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:50 msgid "" "Render thread mode ('unsafe', 'safe', 'separate'). See :ref:`Thread Model " "` for more " "details." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:52 msgid "``--remote-fs
``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:52 msgid "Remote filesystem (``[:]`` address)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:54 msgid "``--audio-driver ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:54 msgid "" "Audio driver. Use ``--help`` first to display the list of available drivers." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:56 msgid "``--video-driver ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:56 msgid "" "Video driver. Use ``--help`` first to display the list of available drivers." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:59 msgid "**Display options**" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:64 msgid "``-f``, ``--fullscreen``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:64 msgid "Request fullscreen mode." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:66 msgid "``-m``, ``--maximized``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:66 msgid "Request a maximized window." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:68 msgid "``-w``, ``--windowed``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:68 msgid "Request windowed mode." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:70 msgid "``-t``, ``--always-on-top``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:70 msgid "Request an always-on-top window." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:72 msgid "``--resolution x``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:72 msgid "Request window resolution." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:74 msgid "``--position ,``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:74 msgid "Request window position." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:76 msgid "``--low-dpi``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:76 msgid "Force low-DPI mode (macOS and Windows only)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:78 msgid "``--no-window``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:78 msgid "" "Disable window creation (Windows only). Useful together with ``--script``." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:81 msgid "**Debug options**" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:85 msgid "" "Debug options are only available in the editor and debug export templates " "(they require ``debug`` or ``release_debug`` build targets, see :ref:" "`doc_introduction_to_the_buildsystem_target` for more details)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:92 msgid "``-d``, ``--debug``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:92 msgid "Debug (local stdout debugger)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:94 msgid "``-b``, ``--breakpoints``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:94 msgid "" "Breakpoint list as source::line comma-separated pairs, no spaces (use %%20 " "instead)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:96 msgid "``--profiling``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:96 msgid "Enable profiling in the script debugger." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:98 msgid "``--remote-debug
``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:98 msgid "Remote debug (``:`` address)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:100 msgid "``--debug-collisions``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:100 msgid "Show collision shapes when running the scene." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:102 msgid "``--debug-navigation``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:102 msgid "Show navigation polygons when running the scene." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:104 msgid "``--frame-delay ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:104 msgid "Simulate high CPU load (delay each frame by milliseconds)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:106 msgid "``--time-scale ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:106 msgid "Force time scale (higher values are faster, 1.0 is normal speed)." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:108 msgid "``--disable-render-loop``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:108 msgid "" "Disable render loop so rendering only occurs when called explicitly from " "script." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:110 msgid "``--disable-crash-handler``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:110 msgid "Disable crash handler when supported by the platform code." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:112 msgid "``--fixed-fps ``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:112 msgid "" "Force a fixed number of frames per second. This setting disables real-time " "synchronization." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:114 msgid "``--print-fps``" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:114 msgid "Print the frames per second to the stdout." msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:117 msgid "**Standalone tools**" msgstr "" #: ../../docs/getting_started/editor/command_line_tutorial.rst:122 msgid "``-s