class_canvaslayer.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CanvasLayer.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CanvasLayer:
  5. CanvasLayer
  6. ===========
  7. **Inherits:** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Inherited By:** :ref:`ParallaxBackground<class_parallaxbackground>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Canvas drawing layer.
  13. Member Functions
  14. ----------------
  15. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Node<class_node>` | :ref:`get_custom_viewport<class_CanvasLayer_get_custom_viewport>` **(** **)** const |
  17. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`get_rotation<class_CanvasLayer_get_rotation>` **(** **)** const |
  19. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Transform2D<class_transform2d>` | :ref:`get_transform<class_CanvasLayer_get_transform>` **(** **)** const |
  21. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`World2D<class_world2d>` | :ref:`get_world_2d<class_CanvasLayer_get_world_2d>` **(** **)** const |
  23. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`set_custom_viewport<class_CanvasLayer_set_custom_viewport>` **(** :ref:`Node<class_node>` viewport **)** |
  25. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_rotation<class_CanvasLayer_set_rotation>` **(** :ref:`float<class_float>` radians **)** |
  27. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_transform<class_CanvasLayer_set_transform>` **(** :ref:`Transform2D<class_transform2d>` transform **)** |
  29. +----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
  30. Member Variables
  31. ----------------
  32. .. _class_CanvasLayer_layer:
  33. - :ref:`int<class_int>` **layer** - Layer index for draw order. Lower values are drawn first. Default value: ``1``.
  34. .. _class_CanvasLayer_offset:
  35. - :ref:`Vector2<class_vector2>` **offset** - The layer's base offset.
  36. .. _class_CanvasLayer_rotation:
  37. - :ref:`float<class_float>` **rotation** - The layer's rotation in degrees.
  38. .. _class_CanvasLayer_scale:
  39. - :ref:`Vector2<class_vector2>` **scale** - The layer's scale.
  40. Description
  41. -----------
  42. Canvas drawing layer. :ref:`CanvasItem<class_canvasitem>` nodes that are direct or indirect children of a ``CanvasLayer`` will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a ``CanvasLayer`` with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below).
  43. Member Function Description
  44. ---------------------------
  45. .. _class_CanvasLayer_get_custom_viewport:
  46. - :ref:`Node<class_node>` **get_custom_viewport** **(** **)** const
  47. Returns the :ref:`Viewport<class_viewport>` used by the camera if it is not using the default viewport.
  48. .. _class_CanvasLayer_get_rotation:
  49. - :ref:`float<class_float>` **get_rotation** **(** **)** const
  50. Return the base rotation for this layer in radians (helper).
  51. .. _class_CanvasLayer_get_transform:
  52. - :ref:`Transform2D<class_transform2d>` **get_transform** **(** **)** const
  53. Return the base transform for this layer.
  54. .. _class_CanvasLayer_get_world_2d:
  55. - :ref:`World2D<class_world2d>` **get_world_2d** **(** **)** const
  56. Return the :ref:`World2D<class_world2d>` used by this layer.
  57. .. _class_CanvasLayer_set_custom_viewport:
  58. - void **set_custom_viewport** **(** :ref:`Node<class_node>` viewport **)**
  59. Assigns a custom :ref:`Viewport<class_viewport>` node to the ``CanvasLayer``. If ``viewport`` is not a :ref:`Viewport<class_viewport>`, it re-assigns the default viewport instead.
  60. .. _class_CanvasLayer_set_rotation:
  61. - void **set_rotation** **(** :ref:`float<class_float>` radians **)**
  62. Set the base rotation for this layer in radians (helper).
  63. .. _class_CanvasLayer_set_transform:
  64. - void **set_transform** **(** :ref:`Transform2D<class_transform2d>` transform **)**
  65. Set the base transform for this layer.