mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
111 lines
5.1 KiB
ReStructuredText
111 lines
5.1 KiB
ReStructuredText
.. 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.
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Node<class_node>` | :ref:`get_custom_viewport<class_CanvasLayer_get_custom_viewport>` **(** **)** const |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_rotation<class_CanvasLayer_get_rotation>` **(** **)** const |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Transform2D<class_transform2d>` | :ref:`get_transform<class_CanvasLayer_get_transform>` **(** **)** const |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`World2D<class_world2d>` | :ref:`get_world_2d<class_CanvasLayer_get_world_2d>` **(** **)** const |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_custom_viewport<class_CanvasLayer_set_custom_viewport>` **(** :ref:`Node<class_node>` viewport **)** |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_rotation<class_CanvasLayer_set_rotation>` **(** :ref:`float<class_float>` radians **)** |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_transform<class_CanvasLayer_set_transform>` **(** :ref:`Transform2D<class_transform2d>` transform **)** |
|
|
+----------------------------------------+-------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Member Variables
|
|
----------------
|
|
|
|
.. _class_CanvasLayer_layer:
|
|
|
|
- :ref:`int<class_int>` **layer** - Layer index for draw order. Lower values are drawn first. Default value: ``1``.
|
|
|
|
.. _class_CanvasLayer_offset:
|
|
|
|
- :ref:`Vector2<class_vector2>` **offset** - The layer's base offset.
|
|
|
|
.. _class_CanvasLayer_rotation:
|
|
|
|
- :ref:`float<class_float>` **rotation** - The layer's rotation in degrees.
|
|
|
|
.. _class_CanvasLayer_scale:
|
|
|
|
- :ref:`Vector2<class_vector2>` **scale** - The layer's scale.
|
|
|
|
|
|
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).
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_CanvasLayer_get_custom_viewport:
|
|
|
|
- :ref:`Node<class_node>` **get_custom_viewport** **(** **)** const
|
|
|
|
Returns the :ref:`Viewport<class_viewport>` used by the camera if it is not using the default viewport.
|
|
|
|
.. _class_CanvasLayer_get_rotation:
|
|
|
|
- :ref:`float<class_float>` **get_rotation** **(** **)** const
|
|
|
|
Return the base rotation for this layer in radians (helper).
|
|
|
|
.. _class_CanvasLayer_get_transform:
|
|
|
|
- :ref:`Transform2D<class_transform2d>` **get_transform** **(** **)** const
|
|
|
|
Return the base transform for this layer.
|
|
|
|
.. _class_CanvasLayer_get_world_2d:
|
|
|
|
- :ref:`World2D<class_world2d>` **get_world_2d** **(** **)** const
|
|
|
|
Return the :ref:`World2D<class_world2d>` used by this layer.
|
|
|
|
.. _class_CanvasLayer_set_custom_viewport:
|
|
|
|
- void **set_custom_viewport** **(** :ref:`Node<class_node>` viewport **)**
|
|
|
|
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.
|
|
|
|
.. _class_CanvasLayer_set_rotation:
|
|
|
|
- void **set_rotation** **(** :ref:`float<class_float>` radians **)**
|
|
|
|
Set the base rotation for this layer in radians (helper).
|
|
|
|
.. _class_CanvasLayer_set_transform:
|
|
|
|
- void **set_transform** **(** :ref:`Transform2D<class_transform2d>` transform **)**
|
|
|
|
Set the base transform for this layer.
|
|
|
|
|