class_viewportsprite.rst 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ViewportSprite:
  4. ViewportSprite
  5. ==============
  6. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Displays a viewport as a sprite.
  11. Member Functions
  12. ----------------
  13. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`Color<class_color>` | :ref:`get_modulate<class_ViewportSprite_get_modulate>` **(** **)** const |
  15. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Vector2<class_vector2>` | :ref:`get_offset<class_ViewportSprite_get_offset>` **(** **)** const |
  17. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`NodePath<class_nodepath>` | :ref:`get_viewport_path<class_ViewportSprite_get_viewport_path>` **(** **)** const |
  19. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`is_centered<class_ViewportSprite_is_centered>` **(** **)** const |
  21. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_centered<class_ViewportSprite_set_centered>` **(** :ref:`bool<class_bool>` centered **)** |
  23. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`set_modulate<class_ViewportSprite_set_modulate>` **(** :ref:`Color<class_color>` modulate **)** |
  25. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_offset<class_ViewportSprite_set_offset>` **(** :ref:`Vector2<class_vector2>` offset **)** |
  27. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_viewport_path<class_ViewportSprite_set_viewport_path>` **(** :ref:`NodePath<class_nodepath>` path **)** |
  29. +----------------------------------+---------------------------------------------------------------------------------------------------------------------+
  30. Description
  31. -----------
  32. Used to display a :ref:`Viewport<class_viewport>` node at some position in the world, without having to mess with :ref:`RenderTargetTexture<class_rendertargettexture>`\ s.
  33. Member Function Description
  34. ---------------------------
  35. .. _class_ViewportSprite_get_modulate:
  36. - :ref:`Color<class_color>` **get_modulate** **(** **)** const
  37. Get color modulation for the texture. All texture pixels are multiplied by this color.
  38. .. _class_ViewportSprite_get_offset:
  39. - :ref:`Vector2<class_vector2>` **get_offset** **(** **)** const
  40. get the offset to the origin of the texture.
  41. .. _class_ViewportSprite_get_viewport_path:
  42. - :ref:`NodePath<class_nodepath>` **get_viewport_path** **(** **)** const
  43. Return the path to the shown :ref:`Viewport<class_viewport>` node.
  44. .. _class_ViewportSprite_is_centered:
  45. - :ref:`bool<class_bool>` **is_centered** **(** **)** const
  46. Return whether the viewport's texture is centered on the origin.
  47. .. _class_ViewportSprite_set_centered:
  48. - void **set_centered** **(** :ref:`bool<class_bool>` centered **)**
  49. Set whether the viewport's texture should be centered on the origin.
  50. .. _class_ViewportSprite_set_modulate:
  51. - void **set_modulate** **(** :ref:`Color<class_color>` modulate **)**
  52. Set color modulation for the texture. All texture pixels are multiplied by this color. Color may contain rgb values above 1 to achieve a highlight effect.
  53. .. _class_ViewportSprite_set_offset:
  54. - void **set_offset** **(** :ref:`Vector2<class_vector2>` offset **)**
  55. Set the offset to the origin of the texture.
  56. .. _class_ViewportSprite_set_viewport_path:
  57. - void **set_viewport_path** **(** :ref:`NodePath<class_nodepath>` path **)**
  58. Set the path to the shown :ref:`Viewport<class_viewport>` node.