mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
105 lines
3.6 KiB
ReStructuredText
105 lines
3.6 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_MeshInstance2D:
|
|
|
|
MeshInstance2D
|
|
==============
|
|
|
|
**繼承:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
用於在 2D 中顯示 :ref:`Mesh<class_Mesh>` 的節點。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
用於在 2D 中顯示 :ref:`Mesh<class_Mesh>` 的節點。可以通過編輯器工具列中的工具,從現有的 :ref:`Sprite2D<class_Sprite2D>` 自動建立 **MeshInstance2D**\ 。請選中該 :ref:`Sprite2D<class_Sprite2D>` 節點,然後在 2D 編輯器視口的頂部選擇 **Sprite2D > 轉換為 MeshInstance2D**\ 。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
教學
|
|
----
|
|
|
|
- :doc:`2D 網格 <../tutorials/2d/2d_meshes>`
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------------+-------------------------------------------------------+
|
|
| :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_MeshInstance2D_property_mesh>` |
|
|
+-----------------------------------+-------------------------------------------------------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_MeshInstance2D_property_texture>` |
|
|
+-----------------------------------+-------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
訊號
|
|
----
|
|
|
|
.. _class_MeshInstance2D_signal_texture_changed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**texture_changed**\ (\ ) :ref:`🔗<class_MeshInstance2D_signal_texture_changed>`
|
|
|
|
當 :ref:`texture<class_MeshInstance2D_property_texture>` 被改變時觸發。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_MeshInstance2D_property_mesh:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Mesh<class_Mesh>` **mesh** :ref:`🔗<class_MeshInstance2D_property_mesh>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_mesh**\ (\ value\: :ref:`Mesh<class_Mesh>`\ )
|
|
- :ref:`Mesh<class_Mesh>` **get_mesh**\ (\ )
|
|
|
|
該 **MeshInstance2D** 繪製的 :ref:`Mesh<class_Mesh>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_MeshInstance2D_property_texture:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Texture2D<class_Texture2D>` **texture** :ref:`🔗<class_MeshInstance2D_property_texture>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_texture**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
|
|
- :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ )
|
|
|
|
使用預設 :ref:`CanvasItemMaterial<class_CanvasItemMaterial>` 時,將使用的 :ref:`Texture2D<class_Texture2D>`\ 。可以在 CanvasItem 著色器中作為 ``TEXTURE`` 存取。
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
|
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
|
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
|
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
|
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
|
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
|
.. |void| replace:: :abbr:`void (無回傳值。)`
|