class_meshinstance2d.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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:`Sprite2D<class_Sprite2D>` via a tool in the editor toolbar. Select the :ref:`Sprite2D<class_Sprite2D>` node, then choose **Sprite2D > Convert to MeshInstance2D** at the top of the 2D editor viewport.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`2D meshes <../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:`Texture2D<class_Texture2D>` | :ref:`texture<class_MeshInstance2D_property_texture>` |
  28. +-----------------------------------+-------------------------------------------------------+
  29. .. rst-class:: classref-section-separator
  30. ----
  31. .. rst-class:: classref-descriptions-group
  32. Signals
  33. -------
  34. .. _class_MeshInstance2D_signal_texture_changed:
  35. .. rst-class:: classref-signal
  36. **texture_changed**\ (\ ) :ref:`🔗<class_MeshInstance2D_signal_texture_changed>`
  37. Emitted when the :ref:`texture<class_MeshInstance2D_property_texture>` is changed.
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Property Descriptions
  42. ---------------------
  43. .. _class_MeshInstance2D_property_mesh:
  44. .. rst-class:: classref-property
  45. :ref:`Mesh<class_Mesh>` **mesh** :ref:`🔗<class_MeshInstance2D_property_mesh>`
  46. .. rst-class:: classref-property-setget
  47. - |void| **set_mesh**\ (\ value\: :ref:`Mesh<class_Mesh>`\ )
  48. - :ref:`Mesh<class_Mesh>` **get_mesh**\ (\ )
  49. The :ref:`Mesh<class_Mesh>` that will be drawn by the **MeshInstance2D**.
  50. .. rst-class:: classref-item-separator
  51. ----
  52. .. _class_MeshInstance2D_property_texture:
  53. .. rst-class:: classref-property
  54. :ref:`Texture2D<class_Texture2D>` **texture** :ref:`🔗<class_MeshInstance2D_property_texture>`
  55. .. rst-class:: classref-property-setget
  56. - |void| **set_texture**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  57. - :ref:`Texture2D<class_Texture2D>` **get_texture**\ (\ )
  58. The :ref:`Texture2D<class_Texture2D>` that will be used if using the default :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`. Can be accessed as ``TEXTURE`` in CanvasItem shader.
  59. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  60. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  61. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  62. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  63. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  64. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  65. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  66. .. |void| replace:: :abbr:`void (No return value.)`