class_directionallight2d.rst 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. :github_url: hide
  2. .. meta::
  3. :keywords: sun
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/DirectionalLight2D.xml.
  8. .. _class_DirectionalLight2D:
  9. DirectionalLight2D
  10. ==================
  11. **Inherits:** :ref:`Light2D<class_Light2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. Directional 2D light from a distance.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. A directional light is a type of :ref:`Light2D<class_Light2D>` node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene (for example: to model sunlight or moonlight).
  17. \ **Note:** **DirectionalLight2D** does not support light cull masks (but it supports shadow cull masks). It will always light up 2D nodes, regardless of the 2D node's :ref:`CanvasItem.light_mask<class_CanvasItem_property_light_mask>`.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`2D lights and shadows <../tutorials/2d/2d_lights_and_shadows>`
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +---------------------------+---------------------------------------------------------------------+-------------+
  28. | :ref:`float<class_float>` | :ref:`height<class_DirectionalLight2D_property_height>` | ``0.0`` |
  29. +---------------------------+---------------------------------------------------------------------+-------------+
  30. | :ref:`float<class_float>` | :ref:`max_distance<class_DirectionalLight2D_property_max_distance>` | ``10000.0`` |
  31. +---------------------------+---------------------------------------------------------------------+-------------+
  32. .. rst-class:: classref-section-separator
  33. ----
  34. .. rst-class:: classref-descriptions-group
  35. Property Descriptions
  36. ---------------------
  37. .. _class_DirectionalLight2D_property_height:
  38. .. rst-class:: classref-property
  39. :ref:`float<class_float>` **height** = ``0.0`` :ref:`🔗<class_DirectionalLight2D_property_height>`
  40. .. rst-class:: classref-property-setget
  41. - |void| **set_height**\ (\ value\: :ref:`float<class_float>`\ )
  42. - :ref:`float<class_float>` **get_height**\ (\ )
  43. The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane).
  44. .. rst-class:: classref-item-separator
  45. ----
  46. .. _class_DirectionalLight2D_property_max_distance:
  47. .. rst-class:: classref-property
  48. :ref:`float<class_float>` **max_distance** = ``10000.0`` :ref:`🔗<class_DirectionalLight2D_property_max_distance>`
  49. .. rst-class:: classref-property-setget
  50. - |void| **set_max_distance**\ (\ value\: :ref:`float<class_float>`\ )
  51. - :ref:`float<class_float>` **get_max_distance**\ (\ )
  52. The maximum distance from the camera center objects can be before their shadows are culled (in pixels). Decreasing this value can prevent objects located outside the camera from casting shadows (while also improving performance). :ref:`Camera2D.zoom<class_Camera2D_property_zoom>` is not taken into account by :ref:`max_distance<class_DirectionalLight2D_property_max_distance>`, which means that at higher zoom values, shadows will appear to fade out sooner when zooming onto a given point.
  53. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  54. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  55. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  56. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  57. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  58. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  59. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  60. .. |void| replace:: :abbr:`void (No return value.)`