class_meshinstance2d.rst 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. Description
  12. -----------
  13. 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.
  14. Tutorials
  15. ---------
  16. - :doc:`2D meshes <../tutorials/2d/2d_meshes>`
  17. Properties
  18. ----------
  19. +-----------------------------------+-------------------------------------------------------------+
  20. | :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_MeshInstance2D_property_mesh>` |
  21. +-----------------------------------+-------------------------------------------------------------+
  22. | :ref:`Texture2D<class_Texture2D>` | :ref:`normal_map<class_MeshInstance2D_property_normal_map>` |
  23. +-----------------------------------+-------------------------------------------------------------+
  24. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_MeshInstance2D_property_texture>` |
  25. +-----------------------------------+-------------------------------------------------------------+
  26. Signals
  27. -------
  28. .. _class_MeshInstance2D_signal_texture_changed:
  29. - **texture_changed** **(** **)**
  30. Emitted when the :ref:`texture<class_MeshInstance2D_property_texture>` is changed.
  31. Property Descriptions
  32. ---------------------
  33. .. _class_MeshInstance2D_property_mesh:
  34. - :ref:`Mesh<class_Mesh>` **mesh**
  35. +----------+-----------------+
  36. | *Setter* | set_mesh(value) |
  37. +----------+-----------------+
  38. | *Getter* | get_mesh() |
  39. +----------+-----------------+
  40. The :ref:`Mesh<class_Mesh>` that will be drawn by the ``MeshInstance2D``.
  41. ----
  42. .. _class_MeshInstance2D_property_normal_map:
  43. - :ref:`Texture2D<class_Texture2D>` **normal_map**
  44. +----------+-----------------------+
  45. | *Setter* | set_normal_map(value) |
  46. +----------+-----------------------+
  47. | *Getter* | get_normal_map() |
  48. +----------+-----------------------+
  49. The normal map that will be used if using the default :ref:`CanvasItemMaterial<class_CanvasItemMaterial>`.
  50. \ **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.
  51. ----
  52. .. _class_MeshInstance2D_property_texture:
  53. - :ref:`Texture2D<class_Texture2D>` **texture**
  54. +----------+--------------------+
  55. | *Setter* | set_texture(value) |
  56. +----------+--------------------+
  57. | *Getter* | get_texture() |
  58. +----------+--------------------+
  59. 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.
  60. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  61. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  62. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  63. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  64. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  65. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`