class_meshinstance2d.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/MeshInstance2D.xml.
  6. .. _class_MeshInstance2D:
  7. MeshInstance2D
  8. ==============
  9. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Node used for displaying a :ref:`Mesh<class_Mesh>` in 2D.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Node used for displaying a :ref:`Mesh<class_Mesh>` in 2D. A **MeshInstance2D** can be automatically created from an existing :ref:`Sprite<class_Sprite>` via a tool in the editor toolbar. Select the :ref:`Sprite<class_Sprite>` node, then choose **Sprite > Convert to MeshInstance2D** at the top of the 2D editor viewport.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`../tutorials/2d/2d_meshes`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------------+-------------------------------------------------------------+
  25. | :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_MeshInstance2D_property_mesh>` |
  26. +-------------------------------+-------------------------------------------------------------+
  27. | :ref:`Texture<class_Texture>` | :ref:`normal_map<class_MeshInstance2D_property_normal_map>` |
  28. +-------------------------------+-------------------------------------------------------------+
  29. | :ref:`Texture<class_Texture>` | :ref:`texture<class_MeshInstance2D_property_texture>` |
  30. +-------------------------------+-------------------------------------------------------------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Signals
  35. -------
  36. .. _class_MeshInstance2D_signal_texture_changed:
  37. .. rst-class:: classref-signal
  38. **texture_changed** **(** **)**
  39. Emitted when the :ref:`texture<class_MeshInstance2D_property_texture>` is changed.
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Property Descriptions
  44. ---------------------
  45. .. _class_MeshInstance2D_property_mesh:
  46. .. rst-class:: classref-property
  47. :ref:`Mesh<class_Mesh>` **mesh**
  48. .. rst-class:: classref-property-setget
  49. - void **set_mesh** **(** :ref:`Mesh<class_Mesh>` value **)**
  50. - :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)**
  51. The :ref:`Mesh<class_Mesh>` that will be drawn by the **MeshInstance2D**.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_MeshInstance2D_property_normal_map:
  55. .. rst-class:: classref-property
  56. :ref:`Texture<class_Texture>` **normal_map**
  57. .. rst-class:: classref-property-setget
  58. - void **set_normal_map** **(** :ref:`Texture<class_Texture>` value **)**
  59. - :ref:`Texture<class_Texture>` **get_normal_map** **(** **)**
  60. The normal map that will be used if using the default :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`.
  61. \ **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates>`__ for a comparison of normal map coordinates expected by popular engines.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_MeshInstance2D_property_texture:
  65. .. rst-class:: classref-property
  66. :ref:`Texture<class_Texture>` **texture**
  67. .. rst-class:: classref-property-setget
  68. - void **set_texture** **(** :ref:`Texture<class_Texture>` value **)**
  69. - :ref:`Texture<class_Texture>` **get_texture** **(** **)**
  70. The :ref:`Texture<class_Texture>` that will be used if using the default :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`. Can be accessed as ``TEXTURE`` in CanvasItem shader.
  71. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  72. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  73. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  74. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`