mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
169 lines
5.5 KiB
ReStructuredText
169 lines
5.5 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the CanvasLayer.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_CanvasLayer:
|
|
|
|
CanvasLayer
|
|
===========
|
|
|
|
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`ParallaxBackground<class_ParallaxBackground>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Canvas drawing layer.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`Node<class_Node>` | :ref:`custom_viewport<class_CanvasLayer_property_custom_viewport>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`layer<class_CanvasLayer_property_layer>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_CanvasLayer_property_offset>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`rotation<class_CanvasLayer_property_rotation>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`rotation_degrees<class_CanvasLayer_property_rotation_degrees>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`scale<class_CanvasLayer_property_scale>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
| :ref:`Transform2D<class_Transform2D>` | :ref:`transform<class_CanvasLayer_property_transform>` |
|
|
+---------------------------------------+----------------------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-----------------------+--------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`get_canvas<class_CanvasLayer_method_get_canvas>` **(** **)** const |
|
|
+-----------------------+--------------------------------------------------------------------------+
|
|
|
|
Description
|
|
-----------
|
|
|
|
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).
|
|
|
|
Tutorials
|
|
---------
|
|
|
|
- :doc:`../tutorials/2d/2d_transforms`
|
|
|
|
- :doc:`../tutorials/2d/canvas_layers`
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_CanvasLayer_property_custom_viewport:
|
|
|
|
- :ref:`Node<class_Node>` **custom_viewport**
|
|
|
|
+----------+----------------------------+
|
|
| *Setter* | set_custom_viewport(value) |
|
|
+----------+----------------------------+
|
|
| *Getter* | get_custom_viewport() |
|
|
+----------+----------------------------+
|
|
|
|
The custom :ref:`Viewport<class_Viewport>` node assigned to the ``CanvasLayer``. If null, uses the default viewport instead.
|
|
|
|
----
|
|
|
|
.. _class_CanvasLayer_property_layer:
|
|
|
|
- :ref:`int<class_int>` **layer**
|
|
|
|
+----------+------------------+
|
|
| *Setter* | set_layer(value) |
|
|
+----------+------------------+
|
|
| *Getter* | get_layer() |
|
|
+----------+------------------+
|
|
|
|
Layer index for draw order. Lower values are drawn first. Default value: ``1``.
|
|
|
|
----
|
|
|
|
.. _class_CanvasLayer_property_offset:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **offset**
|
|
|
|
+----------+-------------------+
|
|
| *Setter* | set_offset(value) |
|
|
+----------+-------------------+
|
|
| *Getter* | get_offset() |
|
|
+----------+-------------------+
|
|
|
|
The layer's base offset.
|
|
|
|
----
|
|
|
|
.. _class_CanvasLayer_property_rotation:
|
|
|
|
- :ref:`float<class_float>` **rotation**
|
|
|
|
+----------+---------------------+
|
|
| *Setter* | set_rotation(value) |
|
|
+----------+---------------------+
|
|
| *Getter* | get_rotation() |
|
|
+----------+---------------------+
|
|
|
|
The layer's rotation in radians.
|
|
|
|
----
|
|
|
|
.. _class_CanvasLayer_property_rotation_degrees:
|
|
|
|
- :ref:`float<class_float>` **rotation_degrees**
|
|
|
|
+----------+-----------------------------+
|
|
| *Setter* | set_rotation_degrees(value) |
|
|
+----------+-----------------------------+
|
|
| *Getter* | get_rotation_degrees() |
|
|
+----------+-----------------------------+
|
|
|
|
The layer's rotation in degrees.
|
|
|
|
----
|
|
|
|
.. _class_CanvasLayer_property_scale:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **scale**
|
|
|
|
+----------+------------------+
|
|
| *Setter* | set_scale(value) |
|
|
+----------+------------------+
|
|
| *Getter* | get_scale() |
|
|
+----------+------------------+
|
|
|
|
The layer's scale.
|
|
|
|
----
|
|
|
|
.. _class_CanvasLayer_property_transform:
|
|
|
|
- :ref:`Transform2D<class_Transform2D>` **transform**
|
|
|
|
+----------+----------------------+
|
|
| *Setter* | set_transform(value) |
|
|
+----------+----------------------+
|
|
| *Getter* | get_transform() |
|
|
+----------+----------------------+
|
|
|
|
The layer's transform.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_CanvasLayer_method_get_canvas:
|
|
|
|
- :ref:`RID<class_RID>` **get_canvas** **(** **)** const
|
|
|
|
Returns the RID of the canvas used by this layer.
|
|
|