ParallaxBackground.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ParallaxBackground" inherits="CanvasLayer" version="3.2">
  3. <brief_description>
  4. A node used to create a parallax scrolling background.
  5. </brief_description>
  6. <description>
  7. A ParallaxBackground uses one or more [ParallaxLayer] child nodes to create a parallax effect. Each [ParallaxLayer] can move at a different speed using [member ParallaxLayer.motion_offset]. This creates an illusion of depth in a 2D game. If not used with a [Camera2D], you must manually calculate the [member scroll_offset].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. </methods>
  13. <members>
  14. <member name="layer" type="int" setter="set_layer" getter="get_layer" override="true" default="-100" />
  15. <member name="scroll_base_offset" type="Vector2" setter="set_scroll_base_offset" getter="get_scroll_base_offset" default="Vector2( 0, 0 )">
  16. The base position offset for all [ParallaxLayer] children.
  17. </member>
  18. <member name="scroll_base_scale" type="Vector2" setter="set_scroll_base_scale" getter="get_scroll_base_scale" default="Vector2( 1, 1 )">
  19. The base motion scale for all [ParallaxLayer] children.
  20. </member>
  21. <member name="scroll_ignore_camera_zoom" type="bool" setter="set_ignore_camera_zoom" getter="is_ignore_camera_zoom" default="false">
  22. If [code]true[/code], elements in [ParallaxLayer] child aren't affected by the zoom level of the camera.
  23. </member>
  24. <member name="scroll_limit_begin" type="Vector2" setter="set_limit_begin" getter="get_limit_begin" default="Vector2( 0, 0 )">
  25. Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [member scroll_limit_end] to work.
  26. </member>
  27. <member name="scroll_limit_end" type="Vector2" setter="set_limit_end" getter="get_limit_end" default="Vector2( 0, 0 )">
  28. Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work.
  29. </member>
  30. <member name="scroll_offset" type="Vector2" setter="set_scroll_offset" getter="get_scroll_offset" default="Vector2( 0, 0 )">
  31. The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present.
  32. </member>
  33. </members>
  34. <constants>
  35. </constants>
  36. </class>