class_directionallight2d.rst 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/DirectionalLight2D.xml.
  6. .. _class_DirectionalLight2D:
  7. DirectionalLight2D
  8. ==================
  9. **Inherits:** :ref:`Light2D<class_Light2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Directional 2D light from a distance.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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).
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`2D lights and shadows <../tutorials/2d/2d_lights_and_shadows>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +---------------------------+---------------------------------------------------------------------+-------------+
  25. | :ref:`float<class_float>` | :ref:`height<class_DirectionalLight2D_property_height>` | ``0.0`` |
  26. +---------------------------+---------------------------------------------------------------------+-------------+
  27. | :ref:`float<class_float>` | :ref:`max_distance<class_DirectionalLight2D_property_max_distance>` | ``10000.0`` |
  28. +---------------------------+---------------------------------------------------------------------+-------------+
  29. .. rst-class:: classref-section-separator
  30. ----
  31. .. rst-class:: classref-descriptions-group
  32. Property Descriptions
  33. ---------------------
  34. .. _class_DirectionalLight2D_property_height:
  35. .. rst-class:: classref-property
  36. :ref:`float<class_float>` **height** = ``0.0``
  37. .. rst-class:: classref-property-setget
  38. - void **set_height** **(** :ref:`float<class_float>` value **)**
  39. - :ref:`float<class_float>` **get_height** **(** **)**
  40. The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane).
  41. .. rst-class:: classref-item-separator
  42. ----
  43. .. _class_DirectionalLight2D_property_max_distance:
  44. .. rst-class:: classref-property
  45. :ref:`float<class_float>` **max_distance** = ``10000.0``
  46. .. rst-class:: classref-property-setget
  47. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  48. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  49. 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.
  50. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  51. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  52. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  53. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  54. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  55. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`