Skip to content

Latest commit

 

History

History
123 lines (76 loc) · 7.33 KB

class_parallaxbackground.rst

File metadata and controls

123 lines (76 loc) · 7.33 KB

ParallaxBackground

Inherits: CanvasLayer<class_canvaslayer> < Node<class_node> < Object<class_object>

Category: Core

Brief Description

A node used to create a parallax scrolling background.

Member Functions

Vector2<class_vector2> get_limit_begin<class_ParallaxBackground_get_limit_begin> ( ) const
Vector2<class_vector2> get_limit_end<class_ParallaxBackground_get_limit_end> ( ) const
Vector2<class_vector2> get_scroll_base_offset<class_ParallaxBackground_get_scroll_base_offset> ( ) const
Vector2<class_vector2> get_scroll_base_scale<class_ParallaxBackground_get_scroll_base_scale> ( ) const
Vector2<class_vector2> get_scroll_offset<class_ParallaxBackground_get_scroll_offset> ( ) const
bool<class_bool> is_ignore_camera_zoom<class_ParallaxBackground_is_ignore_camera_zoom> ( )
void set_ignore_camera_zoom<class_ParallaxBackground_set_ignore_camera_zoom> ( bool<class_bool> ignore )
void set_limit_begin<class_ParallaxBackground_set_limit_begin> ( Vector2<class_vector2> ofs )
void set_limit_end<class_ParallaxBackground_set_limit_end> ( Vector2<class_vector2> ofs )
void set_scroll_base_offset<class_ParallaxBackground_set_scroll_base_offset> ( Vector2<class_vector2> ofs )
void set_scroll_base_scale<class_ParallaxBackground_set_scroll_base_scale> ( Vector2<class_vector2> scale )
void set_scroll_offset<class_ParallaxBackground_set_scroll_offset> ( Vector2<class_vector2> ofs )

Description

A ParallaxBackground will use one or more ParallaxLayer<class_parallaxlayer> nodes to create a parallax scrolling background. Each ParallaxLayer<class_parallaxlayer> can be set to move at different speeds relative to the camera movement, this can be used to create an illusion of depth in a 2D game.

Member Function Description

  • Vector2<class_vector2> get_limit_begin ( ) const

Return the beginning limit.

  • Vector2<class_vector2> get_limit_end ( ) const

Return the ending limit.

  • Vector2<class_vector2> get_scroll_base_offset ( ) const

Return the base offset.

  • Vector2<class_vector2> get_scroll_base_scale ( ) const

Return the base motion scale.

  • Vector2<class_vector2> get_scroll_offset ( ) const
  • bool<class_bool> is_ignore_camera_zoom ( )

Return ignoring camera zoom.

  • void set_ignore_camera_zoom ( bool<class_bool> ignore )

Set to true for all child ParallaxLayer<class_parallaxlayer> nodes to not be affected by the zoom level of the camera.

  • void set_limit_begin ( Vector2<class_vector2> ofs )

Set the left and top limits in pixels for scrolling to begin. If the camera is outside of this limit the background will not continue to scroll. If an axis is greater than or equal to the corresponding axis of limit_end, then it will not limit scrolling for that axis.

  • void set_limit_end ( Vector2<class_vector2> ofs )

Set the right and bottom limits in pixels for scrolling to end. If the camera is outside of this limit the background will not continue to scroll. If an axis is less than or equal to the corresponding axis of limit_begin, then it will not limit scrolling for that axis.

  • void set_scroll_base_offset ( Vector2<class_vector2> ofs )

Set the base offset in pixels of all children ParallaxLayer<class_parallaxlayer> nodes.

  • void set_scroll_base_scale ( Vector2<class_vector2> scale )

Set the base motion scale of all children ParallaxLayer<class_parallaxlayer> nodes.

  • void set_scroll_offset ( Vector2<class_vector2> ofs )