ParallaxBackground¶
Inherits: CanvasLayer < Node < Object
Category: Core
Brief Description¶
A node used to create a parallax scrolling background.
Member Functions¶
Vector2 | get_limit_begin ( ) const |
Vector2 | get_limit_end ( ) const |
Vector2 | get_scroll_base_offset ( ) const |
Vector2 | get_scroll_base_scale ( ) const |
Vector2 | get_scroll_offset ( ) const |
bool | is_ignore_camera_zoom ( ) |
void | set_ignore_camera_zoom ( bool ignore ) |
void | set_limit_begin ( Vector2 ofs ) |
void | set_limit_end ( Vector2 ofs ) |
void | set_scroll_base_offset ( Vector2 ofs ) |
void | set_scroll_base_scale ( Vector2 scale ) |
void | set_scroll_offset ( Vector2 ofs ) |
Member Variables¶
Description¶
A ParallaxBackground will use one or more ParallaxLayer nodes to create a parallax scrolling background. Each 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 get_limit_begin ( ) const
Return the beginning limit.
- Vector2 get_limit_end ( ) const
Return the ending limit.
- Vector2 get_scroll_base_offset ( ) const
Return the base offset.
- Vector2 get_scroll_base_scale ( ) const
Return the base motion scale.
- Vector2 get_scroll_offset ( ) const
- bool is_ignore_camera_zoom ( )
Return ignoring camera zoom.
- void set_ignore_camera_zoom ( bool ignore )
Set to true for all child ParallaxLayer nodes to not be affected by the zoom level of the camera.
- void set_limit_begin ( 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 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 ofs )
Set the base offset in pixels of all children ParallaxLayer nodes.
- void set_scroll_base_scale ( Vector2 scale )
Set the base motion scale of all children ParallaxLayer nodes.
- void set_scroll_offset ( Vector2 ofs )