class_sprite.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. Signals
  13. -------
  14. .. _class_Sprite_frame_changed:
  15. - **frame_changed** **(** **)**
  16. Emitted when the :ref:`frame<class_Sprite_frame>` changes.
  17. .. _class_Sprite_texture_changed:
  18. - **texture_changed** **(** **)**
  19. Emitted when the :ref:`texture<class_Sprite_texture>` changes.
  20. Member Variables
  21. ----------------
  22. .. _class_Sprite_centered:
  23. - :ref:`bool<class_bool>` **centered** - If ``true`` texture is centered. Default value: ``true``.
  24. .. _class_Sprite_flip_h:
  25. - :ref:`bool<class_bool>` **flip_h** - If ``true`` texture is flipped horizontally. Default value: ``false``.
  26. .. _class_Sprite_flip_v:
  27. - :ref:`bool<class_bool>` **flip_v** - If ``true`` texture is flipped vertically. Default value: ``false``.
  28. .. _class_Sprite_frame:
  29. - :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.
  30. .. _class_Sprite_hframes:
  31. - :ref:`int<class_int>` **hframes** - The number of columns in the sprite sheet.
  32. .. _class_Sprite_normal_map:
  33. - :ref:`Texture<class_texture>` **normal_map** - The normal map gives depth to the Sprite.
  34. .. _class_Sprite_offset:
  35. - :ref:`Vector2<class_vector2>` **offset** - The texture's drawing offset.
  36. .. _class_Sprite_region_enabled:
  37. - :ref:`bool<class_bool>` **region_enabled** - If ``true`` texture is cut from a larger atlas texture. See ``region_rect``. Default value: ``false``.
  38. .. _class_Sprite_region_filter_clip:
  39. - :ref:`bool<class_bool>` **region_filter_clip** - If ``true`` the outermost pixels get blurred out.
  40. .. _class_Sprite_region_rect:
  41. - :ref:`Rect2<class_rect2>` **region_rect** - The region of the atlas texture to display. :ref:`region_enabled<class_Sprite_region_enabled>` must be ``true``.
  42. .. _class_Sprite_texture:
  43. - :ref:`Texture<class_texture>` **texture** - :ref:`Texture<class_texture>` object to draw.
  44. .. _class_Sprite_vframes:
  45. - :ref:`int<class_int>` **vframes** - The number of rows in the sprite sheet.
  46. Description
  47. -----------
  48. 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.