class_canvaslayer.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CanvasLayer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CanvasLayer:
  6. CanvasLayer
  7. ===========
  8. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`ParallaxBackground<class_ParallaxBackground>`
  10. **Category:** Core
  11. Brief Description
  12. -----------------
  13. Canvas drawing layer.
  14. Properties
  15. ----------
  16. +---------------------------------------+----------------------------------------------------------------------+
  17. | :ref:`Node<class_Node>` | :ref:`custom_viewport<class_CanvasLayer_property_custom_viewport>` |
  18. +---------------------------------------+----------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`layer<class_CanvasLayer_property_layer>` |
  20. +---------------------------------------+----------------------------------------------------------------------+
  21. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_CanvasLayer_property_offset>` |
  22. +---------------------------------------+----------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`rotation<class_CanvasLayer_property_rotation>` |
  24. +---------------------------------------+----------------------------------------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`rotation_degrees<class_CanvasLayer_property_rotation_degrees>` |
  26. +---------------------------------------+----------------------------------------------------------------------+
  27. | :ref:`Vector2<class_Vector2>` | :ref:`scale<class_CanvasLayer_property_scale>` |
  28. +---------------------------------------+----------------------------------------------------------------------+
  29. | :ref:`Transform2D<class_Transform2D>` | :ref:`transform<class_CanvasLayer_property_transform>` |
  30. +---------------------------------------+----------------------------------------------------------------------+
  31. Methods
  32. -------
  33. +-----------------------+--------------------------------------------------------------------------+
  34. | :ref:`RID<class_RID>` | :ref:`get_canvas<class_CanvasLayer_method_get_canvas>` **(** **)** const |
  35. +-----------------------+--------------------------------------------------------------------------+
  36. Description
  37. -----------
  38. 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).
  39. Tutorials
  40. ---------
  41. - :doc:`../tutorials/2d/2d_transforms`
  42. - :doc:`../tutorials/2d/canvas_layers`
  43. Property Descriptions
  44. ---------------------
  45. .. _class_CanvasLayer_property_custom_viewport:
  46. - :ref:`Node<class_Node>` **custom_viewport**
  47. +----------+----------------------------+
  48. | *Setter* | set_custom_viewport(value) |
  49. +----------+----------------------------+
  50. | *Getter* | get_custom_viewport() |
  51. +----------+----------------------------+
  52. The custom :ref:`Viewport<class_Viewport>` node assigned to the ``CanvasLayer``. If null, uses the default viewport instead.
  53. ----
  54. .. _class_CanvasLayer_property_layer:
  55. - :ref:`int<class_int>` **layer**
  56. +----------+------------------+
  57. | *Setter* | set_layer(value) |
  58. +----------+------------------+
  59. | *Getter* | get_layer() |
  60. +----------+------------------+
  61. Layer index for draw order. Lower values are drawn first. Default value: ``1``.
  62. ----
  63. .. _class_CanvasLayer_property_offset:
  64. - :ref:`Vector2<class_Vector2>` **offset**
  65. +----------+-------------------+
  66. | *Setter* | set_offset(value) |
  67. +----------+-------------------+
  68. | *Getter* | get_offset() |
  69. +----------+-------------------+
  70. The layer's base offset.
  71. ----
  72. .. _class_CanvasLayer_property_rotation:
  73. - :ref:`float<class_float>` **rotation**
  74. +----------+---------------------+
  75. | *Setter* | set_rotation(value) |
  76. +----------+---------------------+
  77. | *Getter* | get_rotation() |
  78. +----------+---------------------+
  79. The layer's rotation in radians.
  80. ----
  81. .. _class_CanvasLayer_property_rotation_degrees:
  82. - :ref:`float<class_float>` **rotation_degrees**
  83. +----------+-----------------------------+
  84. | *Setter* | set_rotation_degrees(value) |
  85. +----------+-----------------------------+
  86. | *Getter* | get_rotation_degrees() |
  87. +----------+-----------------------------+
  88. The layer's rotation in degrees.
  89. ----
  90. .. _class_CanvasLayer_property_scale:
  91. - :ref:`Vector2<class_Vector2>` **scale**
  92. +----------+------------------+
  93. | *Setter* | set_scale(value) |
  94. +----------+------------------+
  95. | *Getter* | get_scale() |
  96. +----------+------------------+
  97. The layer's scale.
  98. ----
  99. .. _class_CanvasLayer_property_transform:
  100. - :ref:`Transform2D<class_Transform2D>` **transform**
  101. +----------+----------------------+
  102. | *Setter* | set_transform(value) |
  103. +----------+----------------------+
  104. | *Getter* | get_transform() |
  105. +----------+----------------------+
  106. The layer's transform.
  107. Method Descriptions
  108. -------------------
  109. .. _class_CanvasLayer_method_get_canvas:
  110. - :ref:`RID<class_RID>` **get_canvas** **(** **)** const
  111. Returns the RID of the canvas used by this layer.