class_sprite.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Sprite.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Sprite:
  5. Sprite
  6. ======
  7. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. General purpose Sprite node.
  12. Member Functions
  13. ----------------
  14. +----------------------------+----------------------------------------------------------+
  15. | :ref:`Rect2<class_rect2>` | :ref:`get_rect<class_Sprite_get_rect>` **(** **)** const |
  16. +----------------------------+----------------------------------------------------------+
  17. Signals
  18. -------
  19. .. _class_Sprite_frame_changed:
  20. - **frame_changed** **(** **)**
  21. Emitted when the :ref:`frame<class_Sprite_frame>` changes.
  22. .. _class_Sprite_texture_changed:
  23. - **texture_changed** **(** **)**
  24. Emitted when the :ref:`texture<class_Sprite_texture>` changes.
  25. Member Variables
  26. ----------------
  27. .. _class_Sprite_centered:
  28. - :ref:`bool<class_bool>` **centered** - If ``true`` texture is centered. Default value: ``true``.
  29. .. _class_Sprite_flip_h:
  30. - :ref:`bool<class_bool>` **flip_h** - If ``true`` texture is flipped horizontally. Default value: ``false``.
  31. .. _class_Sprite_flip_v:
  32. - :ref:`bool<class_bool>` **flip_v** - If ``true`` texture is flipped vertically. Default value: ``false``.
  33. .. _class_Sprite_frame:
  34. - :ref:`int<class_int>` **frame** - Current frame to display from sprite sheet. :ref:`vframes<class_Sprite_vframes>` or :ref:`hframes<class_Sprite_hframes>` must be greater than 1.
  35. .. _class_Sprite_hframes:
  36. - :ref:`int<class_int>` **hframes** - The number of columns in the sprite sheet.
  37. .. _class_Sprite_normal_map:
  38. - :ref:`Texture<class_texture>` **normal_map** - The normal map gives depth to the Sprite.
  39. .. _class_Sprite_offset:
  40. - :ref:`Vector2<class_vector2>` **offset** - The texture's drawing offset.
  41. .. _class_Sprite_region_enabled:
  42. - :ref:`bool<class_bool>` **region_enabled** - If ``true`` texture is cut from a larger atlas texture. See ``region_rect``. Default value: ``false``.
  43. .. _class_Sprite_region_filter_clip:
  44. - :ref:`bool<class_bool>` **region_filter_clip** - If ``true`` the outermost pixels get blurred out.
  45. .. _class_Sprite_region_rect:
  46. - :ref:`Rect2<class_rect2>` **region_rect** - The region of the atlas texture to display. :ref:`region_enabled<class_Sprite_region_enabled>` must be ``true``.
  47. .. _class_Sprite_texture:
  48. - :ref:`Texture<class_texture>` **texture** - :ref:`Texture<class_texture>` object to draw.
  49. .. _class_Sprite_vframes:
  50. - :ref:`int<class_int>` **vframes** - The number of rows in the sprite sheet.
  51. Description
  52. -----------
  53. A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
  54. Member Function Description
  55. ---------------------------
  56. .. _class_Sprite_get_rect:
  57. - :ref:`Rect2<class_rect2>` **get_rect** **(** **)** const
  58. Returns a Rect2 representing the Sprite's boundary relative to its local coordinates.