123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/PointLight2D.xml.
- .. _class_PointLight2D:
- PointLight2D
- ============
- **Inherits:** :ref:`Light2D<class_Light2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- Positional 2D light source.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- Casts light in a 2D environment. This light's shape is defined by a (usually grayscale) texture.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`2D lights and shadows <../tutorials/2d/2d_lights_and_shadows>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-----------------------------------+-----------------------------------------------------------------+-------------------+
- | :ref:`float<class_float>` | :ref:`height<class_PointLight2D_property_height>` | ``0.0`` |
- +-----------------------------------+-----------------------------------------------------------------+-------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_PointLight2D_property_offset>` | ``Vector2(0, 0)`` |
- +-----------------------------------+-----------------------------------------------------------------+-------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_PointLight2D_property_texture>` | |
- +-----------------------------------+-----------------------------------------------------------------+-------------------+
- | :ref:`float<class_float>` | :ref:`texture_scale<class_PointLight2D_property_texture_scale>` | ``1.0`` |
- +-----------------------------------+-----------------------------------------------------------------+-------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_PointLight2D_property_height:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **height** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_height** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_height** **(** **)**
- The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PointLight2D_property_offset:
- .. rst-class:: classref-property
- :ref:`Vector2<class_Vector2>` **offset** = ``Vector2(0, 0)``
- .. rst-class:: classref-property-setget
- - void **set_texture_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
- - :ref:`Vector2<class_Vector2>` **get_texture_offset** **(** **)**
- The offset of the light's :ref:`texture<class_PointLight2D_property_texture>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PointLight2D_property_texture:
- .. rst-class:: classref-property
- :ref:`Texture2D<class_Texture2D>` **texture**
- .. rst-class:: classref-property-setget
- - void **set_texture** **(** :ref:`Texture2D<class_Texture2D>` value **)**
- - :ref:`Texture2D<class_Texture2D>` **get_texture** **(** **)**
- :ref:`Texture2D<class_Texture2D>` used for the light's appearance.
- .. rst-class:: classref-item-separator
- ----
- .. _class_PointLight2D_property_texture_scale:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **texture_scale** = ``1.0``
- .. rst-class:: classref-property-setget
- - void **set_texture_scale** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_texture_scale** **(** **)**
- The :ref:`texture<class_PointLight2D_property_texture>`'s scale factor.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|