123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
- .. _class_Node2D:
- Node2D
- ======
- **Inherits:** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
- **Inherited By:** :ref:`RemoteTransform2D<class_remotetransform2d>`, :ref:`Joint2D<class_joint2d>`, :ref:`ParticleAttractor2D<class_particleattractor2d>`, :ref:`CollisionObject2D<class_collisionobject2d>`, :ref:`VisibilityNotifier2D<class_visibilitynotifier2d>`, :ref:`TileMap<class_tilemap>`, :ref:`Navigation2D<class_navigation2d>`, :ref:`CollisionPolygon2D<class_collisionpolygon2d>`, :ref:`TouchScreenButton<class_touchscreenbutton>`, :ref:`Particles2D<class_particles2d>`, :ref:`AnimatedSprite<class_animatedsprite>`, :ref:`Light2D<class_light2d>`, :ref:`SoundPlayer2D<class_soundplayer2d>`, :ref:`ViewportSprite<class_viewportsprite>`, :ref:`Path2D<class_path2d>`, :ref:`Sprite<class_sprite>`, :ref:`RayCast2D<class_raycast2d>`, :ref:`CollisionShape2D<class_collisionshape2d>`, :ref:`NavigationPolygonInstance<class_navigationpolygoninstance>`, :ref:`PathFollow2D<class_pathfollow2d>`, :ref:`ParallaxLayer<class_parallaxlayer>`, :ref:`Polygon2D<class_polygon2d>`, :ref:`Position2D<class_position2d>`, :ref:`LightOccluder2D<class_lightoccluder2d>`, :ref:`BackBufferCopy<class_backbuffercopy>`, :ref:`CanvasModulate<class_canvasmodulate>`, :ref:`YSort<class_ysort>`, :ref:`Camera2D<class_camera2d>`
- **Category:** Core
- Brief Description
- -----------------
- Base node for 2D system.
- Member Functions
- ----------------
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_pos<class_Node2D_set_pos>` **(** :ref:`Vector2<class_vector2>` pos **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_rot<class_Node2D_set_rot>` **(** :ref:`float<class_float>` rot **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_scale<class_Node2D_set_scale>` **(** :ref:`Vector2<class_vector2>` scale **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_vector2>` | :ref:`get_pos<class_Node2D_get_pos>` **(** **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_rot<class_Node2D_get_rot>` **(** **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_vector2>` | :ref:`get_scale<class_Node2D_get_scale>` **(** **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`rotate<class_Node2D_rotate>` **(** :ref:`float<class_float>` radians **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`move_local_x<class_Node2D_move_local_x>` **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`move_local_y<class_Node2D_move_local_y>` **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`translate<class_Node2D_translate>` **(** :ref:`Vector2<class_vector2>` offset **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`global_translate<class_Node2D_global_translate>` **(** :ref:`Vector2<class_vector2>` offset **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`scale<class_Node2D_scale>` **(** :ref:`Vector2<class_vector2>` ratio **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_global_pos<class_Node2D_set_global_pos>` **(** :ref:`Vector2<class_vector2>` pos **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_vector2>` | :ref:`get_global_pos<class_Node2D_get_global_pos>` **(** **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_transform<class_Node2D_set_transform>` **(** :ref:`Matrix32<class_matrix32>` xform **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_global_transform<class_Node2D_set_global_transform>` **(** :ref:`Matrix32<class_matrix32>` xform **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`look_at<class_Node2D_look_at>` **(** :ref:`Vector2<class_vector2>` point **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_angle_to<class_Node2D_get_angle_to>` **(** :ref:`Vector2<class_vector2>` point **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_z<class_Node2D_set_z>` **(** :ref:`int<class_int>` z **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_z<class_Node2D_get_z>` **(** **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_z_as_relative<class_Node2D_set_z_as_relative>` **(** :ref:`bool<class_bool>` enable **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_z_relative<class_Node2D_is_z_relative>` **(** **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`edit_set_pivot<class_Node2D_edit_set_pivot>` **(** :ref:`Vector2<class_vector2>` pivot **)** |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Matrix32<class_matrix32>` | :ref:`get_relative_transform_to_parent<class_Node2D_get_relative_transform_to_parent>` **(** :ref:`Object<class_object>` parent **)** const |
- +----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
- Description
- -----------
- Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform (:ref:`Matrix32<class_matrix32>`). A tree of Node2Ds allows complex hierarchies for animation and positioning.
- Member Function Description
- ---------------------------
- .. _class_Node2D_set_pos:
- - void **set_pos** **(** :ref:`Vector2<class_vector2>` pos **)**
- Set the position of the 2d node.
- .. _class_Node2D_set_rot:
- - void **set_rot** **(** :ref:`float<class_float>` rot **)**
- Set the rotation of the 2d node.
- .. _class_Node2D_set_scale:
- - void **set_scale** **(** :ref:`Vector2<class_vector2>` scale **)**
- Set the scale of the 2d node.
- .. _class_Node2D_get_pos:
- - :ref:`Vector2<class_vector2>` **get_pos** **(** **)** const
- Return the position of the 2D node.
- .. _class_Node2D_get_rot:
- - :ref:`float<class_float>` **get_rot** **(** **)** const
- Return the rotation of the 2D node.
- .. _class_Node2D_get_scale:
- - :ref:`Vector2<class_vector2>` **get_scale** **(** **)** const
- Return the scale of the 2D node.
- .. _class_Node2D_rotate:
- - void **rotate** **(** :ref:`float<class_float>` radians **)**
- .. _class_Node2D_move_local_x:
- - void **move_local_x** **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false **)**
- .. _class_Node2D_move_local_y:
- - void **move_local_y** **(** :ref:`float<class_float>` delta, :ref:`bool<class_bool>` scaled=false **)**
- .. _class_Node2D_translate:
- - void **translate** **(** :ref:`Vector2<class_vector2>` offset **)**
- .. _class_Node2D_global_translate:
- - void **global_translate** **(** :ref:`Vector2<class_vector2>` offset **)**
- .. _class_Node2D_scale:
- - void **scale** **(** :ref:`Vector2<class_vector2>` ratio **)**
- .. _class_Node2D_set_global_pos:
- - void **set_global_pos** **(** :ref:`Vector2<class_vector2>` pos **)**
- .. _class_Node2D_get_global_pos:
- - :ref:`Vector2<class_vector2>` **get_global_pos** **(** **)** const
- Return the global position of the 2D node.
- .. _class_Node2D_set_transform:
- - void **set_transform** **(** :ref:`Matrix32<class_matrix32>` xform **)**
- .. _class_Node2D_set_global_transform:
- - void **set_global_transform** **(** :ref:`Matrix32<class_matrix32>` xform **)**
- .. _class_Node2D_look_at:
- - void **look_at** **(** :ref:`Vector2<class_vector2>` point **)**
- .. _class_Node2D_get_angle_to:
- - :ref:`float<class_float>` **get_angle_to** **(** :ref:`Vector2<class_vector2>` point **)** const
- .. _class_Node2D_set_z:
- - void **set_z** **(** :ref:`int<class_int>` z **)**
- .. _class_Node2D_get_z:
- - :ref:`int<class_int>` **get_z** **(** **)** const
- .. _class_Node2D_set_z_as_relative:
- - void **set_z_as_relative** **(** :ref:`bool<class_bool>` enable **)**
- .. _class_Node2D_is_z_relative:
- - :ref:`bool<class_bool>` **is_z_relative** **(** **)** const
- .. _class_Node2D_edit_set_pivot:
- - void **edit_set_pivot** **(** :ref:`Vector2<class_vector2>` pivot **)**
- .. _class_Node2D_get_relative_transform_to_parent:
- - :ref:`Matrix32<class_matrix32>` **get_relative_transform_to_parent** **(** :ref:`Object<class_object>` parent **)** const
|