mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
852 lines
45 KiB
ReStructuredText
852 lines
45 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_Camera2D:
|
|
|
|
Camera2D
|
|
========
|
|
|
|
**Hereda:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Nodo de cámara para escenas 2D.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of :ref:`CanvasItem<class_CanvasItem>`-based nodes.
|
|
|
|
Cameras register themselves in the nearest :ref:`Viewport<class_Viewport>` node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport.
|
|
|
|
This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from :ref:`Node2D<class_Node2D>` and change the transform of the canvas by setting :ref:`Viewport.canvas_transform<class_Viewport_property_canvas_transform>` in :ref:`Viewport<class_Viewport>` (you can obtain the current :ref:`Viewport<class_Viewport>` by using :ref:`Node.get_viewport()<class_Node_method_get_viewport>`).
|
|
|
|
Note that the **Camera2D** node's :ref:`Node2D.global_position<class_Node2D_property_global_position>` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use :ref:`get_screen_center_position()<class_Camera2D_method_get_screen_center_position>` to get the real position. Same for the node's :ref:`Node2D.global_rotation<class_Node2D_property_global_rotation>` which may be different due to applied rotation smoothing. You can use :ref:`get_screen_rotation()<class_Camera2D_method_get_screen_rotation>` to get the current rotation of the screen.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- `Demo de Plataformas en 2D <https://godotengine.org/asset-library/asset/2727>`__
|
|
|
|
- `Demo Isométrica en 2D <https://godotengine.org/asset-library/asset/2718>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`AnchorMode<enum_Camera2D_AnchorMode>` | :ref:`anchor_mode<class_Camera2D_property_anchor_mode>` | ``1`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Node<class_Node>` | :ref:`custom_viewport<class_Camera2D_property_custom_viewport>` | |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`drag_bottom_margin<class_Camera2D_property_drag_bottom_margin>` | ``0.2`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`drag_horizontal_enabled<class_Camera2D_property_drag_horizontal_enabled>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`drag_horizontal_offset<class_Camera2D_property_drag_horizontal_offset>` | ``0.0`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`drag_left_margin<class_Camera2D_property_drag_left_margin>` | ``0.2`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`drag_right_margin<class_Camera2D_property_drag_right_margin>` | ``0.2`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`drag_top_margin<class_Camera2D_property_drag_top_margin>` | ``0.2`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`drag_vertical_enabled<class_Camera2D_property_drag_vertical_enabled>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`drag_vertical_offset<class_Camera2D_property_drag_vertical_offset>` | ``0.0`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`editor_draw_drag_margin<class_Camera2D_property_editor_draw_drag_margin>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`editor_draw_limits<class_Camera2D_property_editor_draw_limits>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`editor_draw_screen<class_Camera2D_property_editor_draw_screen>` | ``true`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`enabled<class_Camera2D_property_enabled>` | ``true`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`ignore_rotation<class_Camera2D_property_ignore_rotation>` | ``true`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`int<class_int>` | :ref:`limit_bottom<class_Camera2D_property_limit_bottom>` | ``10000000`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`limit_enabled<class_Camera2D_property_limit_enabled>` | ``true`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`int<class_int>` | :ref:`limit_left<class_Camera2D_property_limit_left>` | ``-10000000`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`int<class_int>` | :ref:`limit_right<class_Camera2D_property_limit_right>` | ``10000000`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`limit_smoothed<class_Camera2D_property_limit_smoothed>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`int<class_int>` | :ref:`limit_top<class_Camera2D_property_limit_top>` | ``-10000000`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_Camera2D_property_offset>` | ``Vector2(0, 0)`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`position_smoothing_enabled<class_Camera2D_property_position_smoothing_enabled>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`position_smoothing_speed<class_Camera2D_property_position_smoothing_speed>` | ``5.0`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Camera2DProcessCallback<enum_Camera2D_Camera2DProcessCallback>` | :ref:`process_callback<class_Camera2D_property_process_callback>` | ``1`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`rotation_smoothing_enabled<class_Camera2D_property_rotation_smoothing_enabled>` | ``false`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`rotation_smoothing_speed<class_Camera2D_property_rotation_smoothing_speed>` | ``5.0`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`zoom<class_Camera2D_property_zoom>` | ``Vector2(1, 1)`` |
|
|
+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`align<class_Camera2D_method_align>`\ (\ ) |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`force_update_scroll<class_Camera2D_method_force_update_scroll>`\ (\ ) |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_drag_margin<class_Camera2D_method_get_drag_margin>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_limit<class_Camera2D_method_get_limit>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_screen_center_position<class_Camera2D_method_get_screen_center_position>`\ (\ ) |const| |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_screen_rotation<class_Camera2D_method_get_screen_rotation>`\ (\ ) |const| |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_target_position<class_Camera2D_method_get_target_position>`\ (\ ) |const| |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_current<class_Camera2D_method_is_current>`\ (\ ) |const| |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`make_current<class_Camera2D_method_make_current>`\ (\ ) |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`reset_smoothing<class_Camera2D_method_reset_smoothing>`\ (\ ) |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_drag_margin<class_Camera2D_method_set_drag_margin>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, drag_margin\: :ref:`float<class_float>`\ ) |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_limit<class_Camera2D_method_set_limit>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, limit\: :ref:`int<class_int>`\ ) |
|
|
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_Camera2D_AnchorMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **AnchorMode**: :ref:`🔗<enum_Camera2D_AnchorMode>`
|
|
|
|
.. _class_Camera2D_constant_ANCHOR_MODE_FIXED_TOP_LEFT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnchorMode<enum_Camera2D_AnchorMode>` **ANCHOR_MODE_FIXED_TOP_LEFT** = ``0``
|
|
|
|
La posición de la cámara está fijada de tal manera que la esquina superior izquierda está siempre en el origen.
|
|
|
|
.. _class_Camera2D_constant_ANCHOR_MODE_DRAG_CENTER:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`AnchorMode<enum_Camera2D_AnchorMode>` **ANCHOR_MODE_DRAG_CENTER** = ``1``
|
|
|
|
La posición de la cámara tiene en cuenta los desplazamientos verticales/horizontales y el tamaño de la pantalla.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_Camera2D_Camera2DProcessCallback:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **Camera2DProcessCallback**: :ref:`🔗<enum_Camera2D_Camera2DProcessCallback>`
|
|
|
|
.. _class_Camera2D_constant_CAMERA2D_PROCESS_PHYSICS:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`Camera2DProcessCallback<enum_Camera2D_Camera2DProcessCallback>` **CAMERA2D_PROCESS_PHYSICS** = ``0``
|
|
|
|
The camera updates during physics frames (see :ref:`Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS<class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS>`).
|
|
|
|
.. _class_Camera2D_constant_CAMERA2D_PROCESS_IDLE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`Camera2DProcessCallback<enum_Camera2D_Camera2DProcessCallback>` **CAMERA2D_PROCESS_IDLE** = ``1``
|
|
|
|
The camera updates during process frames (see :ref:`Node.NOTIFICATION_INTERNAL_PROCESS<class_Node_constant_NOTIFICATION_INTERNAL_PROCESS>`).
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_Camera2D_property_anchor_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`AnchorMode<enum_Camera2D_AnchorMode>` **anchor_mode** = ``1`` :ref:`🔗<class_Camera2D_property_anchor_mode>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_anchor_mode**\ (\ value\: :ref:`AnchorMode<enum_Camera2D_AnchorMode>`\ )
|
|
- :ref:`AnchorMode<enum_Camera2D_AnchorMode>` **get_anchor_mode**\ (\ )
|
|
|
|
El punto de anclaje de Camera2D.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_custom_viewport:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Node<class_Node>` **custom_viewport** :ref:`🔗<class_Camera2D_property_custom_viewport>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_custom_viewport**\ (\ value\: :ref:`Node<class_Node>`\ )
|
|
- :ref:`Node<class_Node>` **get_custom_viewport**\ (\ )
|
|
|
|
El nodo personalizado de :ref:`Viewport<class_Viewport>` unido a **Camera2D**. Si ``null`` o no es un :ref:`Viewport<class_Viewport>`, usa el viewport por defecto en su lugar.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_bottom_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **drag_bottom_margin** = ``0.2`` :ref:`🔗<class_Camera2D_property_drag_bottom_margin>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, drag_margin\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Margen inferior necesario para arrastrar la cámara. Un valor de ``1`` hace que la cámara se mueva solo cuando alcance el borde inferior de la pantalla.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_horizontal_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **drag_horizontal_enabled** = ``false`` :ref:`🔗<class_Camera2D_property_drag_horizontal_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_horizontal_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_drag_horizontal_enabled**\ (\ )
|
|
|
|
Si es ``true``, la cámara solo se mueve cuando alcanza los márgenes de arrastre horizontal (izquierdo y derecho). Si es ``false``, la cámara se mueve horizontalmente independientemente de los márgenes.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_horizontal_offset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **drag_horizontal_offset** = ``0.0`` :ref:`🔗<class_Camera2D_property_drag_horizontal_offset>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_horizontal_offset**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_drag_horizontal_offset**\ (\ )
|
|
|
|
El desplazamiento de arrastre horizontal relativo de la cámara entre los márgenes de arrastre derecho (``-1``) e izquierdo (``1``).
|
|
|
|
\ **Nota:** Se utiliza para establecer el desplazamiento de arrastre horizontal inicial, determinar el desplazamiento actual u forzar el desplazamiento actual. No se actualiza automáticamente cuando :ref:`drag_horizontal_enabled<class_Camera2D_property_drag_horizontal_enabled>` es ``true`` o se modifican los márgenes de arrastre.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_left_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **drag_left_margin** = ``0.2`` :ref:`🔗<class_Camera2D_property_drag_left_margin>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, drag_margin\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Margen izquierdo necesario para arrastrar la cámara. Un valor de ``1`` hace que la cámara se mueva solo cuando alcance el borde izquierdo de la pantalla.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_right_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **drag_right_margin** = ``0.2`` :ref:`🔗<class_Camera2D_property_drag_right_margin>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, drag_margin\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Right margin needed to drag the camera. A value of ``1`` makes the camera move only when reaching the right edge of the screen.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_top_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **drag_top_margin** = ``0.2`` :ref:`🔗<class_Camera2D_property_drag_top_margin>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, drag_margin\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Top margin needed to drag the camera. A value of ``1`` makes the camera move only when reaching the top edge of the screen.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_vertical_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **drag_vertical_enabled** = ``false`` :ref:`🔗<class_Camera2D_property_drag_vertical_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_vertical_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_drag_vertical_enabled**\ (\ )
|
|
|
|
If ``true``, the camera only moves when reaching the vertical (top and bottom) drag margins. If ``false``, the camera moves vertically regardless of the drag margins.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_drag_vertical_offset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **drag_vertical_offset** = ``0.0`` :ref:`🔗<class_Camera2D_property_drag_vertical_offset>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_drag_vertical_offset**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_drag_vertical_offset**\ (\ )
|
|
|
|
The relative vertical drag offset of the camera between the bottom (``-1``) and top (``1``) drag margins.
|
|
|
|
\ **Note:** Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when :ref:`drag_vertical_enabled<class_Camera2D_property_drag_vertical_enabled>` is ``true`` or the drag margins are changed.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_editor_draw_drag_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **editor_draw_drag_margin** = ``false`` :ref:`🔗<class_Camera2D_property_editor_draw_drag_margin>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_margin_drawing_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_margin_drawing_enabled**\ (\ )
|
|
|
|
Si es ``true``, dibuja el rectángulo de margen de arrastre de la cámara en el editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_editor_draw_limits:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **editor_draw_limits** = ``false`` :ref:`🔗<class_Camera2D_property_editor_draw_limits>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit_drawing_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_limit_drawing_enabled**\ (\ )
|
|
|
|
Si es ``true``, dibuja el rectángulo de límites de la cámara en el editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_editor_draw_screen:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **editor_draw_screen** = ``true`` :ref:`🔗<class_Camera2D_property_editor_draw_screen>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_screen_drawing_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_screen_drawing_enabled**\ (\ )
|
|
|
|
Si es ``true``, dibuja el rectángulo de la pantalla de la cámara en el editor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **enabled** = ``true`` :ref:`🔗<class_Camera2D_property_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_enabled**\ (\ )
|
|
|
|
Controls whether the camera can be active or not. If ``true``, the **Camera2D** will become the main camera when it enters the scene tree and there is no active camera currently (see :ref:`Viewport.get_camera_2d()<class_Viewport_method_get_camera_2d>`).
|
|
|
|
When the camera is currently active and :ref:`enabled<class_Camera2D_property_enabled>` is set to ``false``, the next enabled **Camera2D** in the scene tree will become active.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_ignore_rotation:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **ignore_rotation** = ``true`` :ref:`🔗<class_Camera2D_property_ignore_rotation>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_ignore_rotation**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_ignoring_rotation**\ (\ )
|
|
|
|
If ``true``, the camera's rendered view is not affected by its :ref:`Node2D.rotation<class_Node2D_property_rotation>` and :ref:`Node2D.global_rotation<class_Node2D_property_global_rotation>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_limit_bottom:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **limit_bottom** = ``10000000`` :ref:`🔗<class_Camera2D_property_limit_bottom>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, limit\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Bottom scroll limit in pixels. The camera stops moving when reaching this value, but :ref:`offset<class_Camera2D_property_offset>` can push the view past the limit.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_limit_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **limit_enabled** = ``true`` :ref:`🔗<class_Camera2D_property_limit_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_limit_enabled**\ (\ )
|
|
|
|
If ``true``, the limits will be enabled. Disabling this will allow the camera to focus anywhere, when the four ``limit_*`` properties will not work.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_limit_left:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **limit_left** = ``-10000000`` :ref:`🔗<class_Camera2D_property_limit_left>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, limit\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Left scroll limit in pixels. The camera stops moving when reaching this value, but :ref:`offset<class_Camera2D_property_offset>` can push the view past the limit.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_limit_right:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **limit_right** = ``10000000`` :ref:`🔗<class_Camera2D_property_limit_right>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, limit\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Right scroll limit in pixels. The camera stops moving when reaching this value, but :ref:`offset<class_Camera2D_property_offset>` can push the view past the limit.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_limit_smoothed:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **limit_smoothed** = ``false`` :ref:`🔗<class_Camera2D_property_limit_smoothed>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit_smoothing_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_limit_smoothing_enabled**\ (\ )
|
|
|
|
If ``true``, the camera smoothly stops when reaches its limits.
|
|
|
|
This property has no effect if :ref:`position_smoothing_enabled<class_Camera2D_property_position_smoothing_enabled>` is ``false``.
|
|
|
|
\ **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke :ref:`reset_smoothing()<class_Camera2D_method_reset_smoothing>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_limit_top:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **limit_top** = ``-10000000`` :ref:`🔗<class_Camera2D_property_limit_top>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, limit\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
|
|
|
|
Top scroll limit in pixels. The camera stops moving when reaching this value, but :ref:`offset<class_Camera2D_property_offset>` can push the view past the limit.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_offset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **offset** = ``Vector2(0, 0)`` :ref:`🔗<class_Camera2D_property_offset>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_offset**\ (\ )
|
|
|
|
The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in :ref:`limit_top<class_Camera2D_property_limit_top>`, :ref:`limit_bottom<class_Camera2D_property_limit_bottom>`, :ref:`limit_left<class_Camera2D_property_limit_left>` and :ref:`limit_right<class_Camera2D_property_limit_right>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_position_smoothing_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **position_smoothing_enabled** = ``false`` :ref:`🔗<class_Camera2D_property_position_smoothing_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_position_smoothing_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_position_smoothing_enabled**\ (\ )
|
|
|
|
If ``true``, the camera's view smoothly moves towards its target position at :ref:`position_smoothing_speed<class_Camera2D_property_position_smoothing_speed>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_position_smoothing_speed:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **position_smoothing_speed** = ``5.0`` :ref:`🔗<class_Camera2D_property_position_smoothing_speed>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_position_smoothing_speed**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_position_smoothing_speed**\ (\ )
|
|
|
|
Speed in pixels per second of the camera's smoothing effect when :ref:`position_smoothing_enabled<class_Camera2D_property_position_smoothing_enabled>` is ``true``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_process_callback:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Camera2DProcessCallback<enum_Camera2D_Camera2DProcessCallback>` **process_callback** = ``1`` :ref:`🔗<class_Camera2D_property_process_callback>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_process_callback**\ (\ value\: :ref:`Camera2DProcessCallback<enum_Camera2D_Camera2DProcessCallback>`\ )
|
|
- :ref:`Camera2DProcessCallback<enum_Camera2D_Camera2DProcessCallback>` **get_process_callback**\ (\ )
|
|
|
|
The camera's process callback.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_rotation_smoothing_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **rotation_smoothing_enabled** = ``false`` :ref:`🔗<class_Camera2D_property_rotation_smoothing_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_rotation_smoothing_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_rotation_smoothing_enabled**\ (\ )
|
|
|
|
If ``true``, the camera's view smoothly rotates, via asymptotic smoothing, to align with its target rotation at :ref:`rotation_smoothing_speed<class_Camera2D_property_rotation_smoothing_speed>`.
|
|
|
|
\ **Note:** This property has no effect if :ref:`ignore_rotation<class_Camera2D_property_ignore_rotation>` is ``true``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_rotation_smoothing_speed:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **rotation_smoothing_speed** = ``5.0`` :ref:`🔗<class_Camera2D_property_rotation_smoothing_speed>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_rotation_smoothing_speed**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_rotation_smoothing_speed**\ (\ )
|
|
|
|
The angular, asymptotic speed of the camera's rotation smoothing effect when :ref:`rotation_smoothing_enabled<class_Camera2D_property_rotation_smoothing_enabled>` is ``true``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_property_zoom:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **zoom** = ``Vector2(1, 1)`` :ref:`🔗<class_Camera2D_property_zoom>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_zoom**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_zoom**\ (\ )
|
|
|
|
The camera's zoom. Higher values are more zoomed in. For example, a zoom of ``Vector2(2.0, 2.0)`` will be twice as zoomed in on each axis (the view covers an area four times smaller). In contrast, a zoom of ``Vector2(0.5, 0.5)`` will be twice as zoomed out on each axis (the view covers an area four times larger). The X and Y components should generally always be set to the same value, unless you wish to stretch the camera view.
|
|
|
|
\ **Note:** :ref:`FontFile.oversampling<class_FontFile_property_oversampling>` does *not* take **Camera2D** zoom into account. This means that zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated unless the font is part of a :ref:`CanvasLayer<class_CanvasLayer>` that makes it ignore camera zoom. To ensure text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling :ref:`ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field<class_ProjectSettings_property_gui/theme/default_font_multichannel_signed_distance_field>` (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, :ref:`SystemFont.multichannel_signed_distance_field<class_SystemFont_property_multichannel_signed_distance_field>` can be enabled in the inspector.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_Camera2D_method_align:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **align**\ (\ ) :ref:`🔗<class_Camera2D_method_align>`
|
|
|
|
Alinea la cámara con el nodo rastreado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_force_update_scroll:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **force_update_scroll**\ (\ ) :ref:`🔗<class_Camera2D_method_force_update_scroll>`
|
|
|
|
Obliga a la cámara a actualizar el scroll inmediatamente.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_get_drag_margin:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_Camera2D_method_get_drag_margin>`
|
|
|
|
Devuelve el margen del :ref:`Side<enum_@GlobalScope_Side>` especificado. Véase también :ref:`drag_bottom_margin<class_Camera2D_property_drag_bottom_margin>`, :ref:`drag_top_margin<class_Camera2D_property_drag_top_margin>`, :ref:`drag_left_margin<class_Camera2D_property_drag_left_margin>` y :ref:`drag_right_margin<class_Camera2D_property_drag_right_margin>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_get_limit:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_Camera2D_method_get_limit>`
|
|
|
|
Devuelve el límite de la cámara para el :ref:`Side<enum_@GlobalScope_Side>` especificado. Véase también :ref:`limit_bottom<class_Camera2D_property_limit_bottom>`, :ref:`limit_top<class_Camera2D_property_limit_top>`, :ref:`limit_left<class_Camera2D_property_limit_left>` y :ref:`limit_right<class_Camera2D_property_limit_right>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_get_screen_center_position:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Vector2<class_Vector2>` **get_screen_center_position**\ (\ ) |const| :ref:`🔗<class_Camera2D_method_get_screen_center_position>`
|
|
|
|
Devuelve el centro de la pantalla desde el punto de vista de esta cámara, en coordenadas globales.
|
|
|
|
\ **Nota:** La posición exacta a la que se dirige la cámara puede ser diferente. Véase :ref:`get_target_position()<class_Camera2D_method_get_target_position>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_get_screen_rotation:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_screen_rotation**\ (\ ) |const| :ref:`🔗<class_Camera2D_method_get_screen_rotation>`
|
|
|
|
Devuelve la rotación actual de la pantalla desde el punto de vista de esta cámara.
|
|
|
|
\ **Nota:** La rotación de la pantalla puede ser diferente de :ref:`Node2D.global_rotation<class_Node2D_property_global_rotation>` si la cámara está rotando suavemente debido a :ref:`rotation_smoothing_enabled<class_Camera2D_property_rotation_smoothing_enabled>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_get_target_position:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Vector2<class_Vector2>` **get_target_position**\ (\ ) |const| :ref:`🔗<class_Camera2D_method_get_target_position>`
|
|
|
|
Returns this camera's target position, in global coordinates.
|
|
|
|
\ **Note:** The returned value is not the same as :ref:`Node2D.global_position<class_Node2D_property_global_position>`, as it is affected by the drag properties. It is also not the same as the current position if :ref:`position_smoothing_enabled<class_Camera2D_property_position_smoothing_enabled>` is ``true`` (see :ref:`get_screen_center_position()<class_Camera2D_method_get_screen_center_position>`).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_is_current:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_current**\ (\ ) |const| :ref:`🔗<class_Camera2D_method_is_current>`
|
|
|
|
Devuelve ``true`` si esta **Camera2D** es la cámara activa (véase :ref:`Viewport.get_camera_2d()<class_Viewport_method_get_camera_2d>`).
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_make_current:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **make_current**\ (\ ) :ref:`🔗<class_Camera2D_method_make_current>`
|
|
|
|
Fuerza a esta **Camera2D** a convertirse en la activa. :ref:`enabled<class_Camera2D_property_enabled>` debe ser ``true``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_reset_smoothing:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **reset_smoothing**\ (\ ) :ref:`🔗<class_Camera2D_method_reset_smoothing>`
|
|
|
|
Establece la posición de la cámara inmediatamente a su destino de suavizado actual.
|
|
|
|
Este método no tiene ningún efecto si :ref:`position_smoothing_enabled<class_Camera2D_property_position_smoothing_enabled>` es ``false``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_set_drag_margin:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_drag_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, drag_margin\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Camera2D_method_set_drag_margin>`
|
|
|
|
Establece el margen del :ref:`Side<enum_@GlobalScope_Side>` especificado. Véase también :ref:`drag_bottom_margin<class_Camera2D_property_drag_bottom_margin>`, :ref:`drag_top_margin<class_Camera2D_property_drag_top_margin>`, :ref:`drag_left_margin<class_Camera2D_property_drag_left_margin>` y :ref:`drag_right_margin<class_Camera2D_property_drag_right_margin>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Camera2D_method_set_limit:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_limit**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, limit\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Camera2D_method_set_limit>`
|
|
|
|
Establece el límite de la cámara para el :ref:`Side<enum_@GlobalScope_Side>` especificado. Véase también :ref:`limit_bottom<class_Camera2D_property_limit_bottom>`, :ref:`limit_top<class_Camera2D_property_limit_top>`, :ref:`limit_left<class_Camera2D_property_limit_left>` y :ref:`limit_right<class_Camera2D_property_limit_right>`.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
|
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
|
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|