ParallaxBackground

A node used to create a parallax scrolling background.

A ParallaxBackground uses one or more ParallaxLayer child nodes to create a parallax effect. Each ParallaxLayer can move at a different speed using ParallaxLayer.motionOffset. This creates an illusion of depth in a 2D game. If not used with a Camera2D, you must manually calculate the scrollOffset.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_cameraMoved
void _cameraMoved(Transform2D arg0, Vector2 arg1)
getLimitBegin
Vector2 getLimitBegin()
getLimitEnd
Vector2 getLimitEnd()
getScrollBaseOffset
Vector2 getScrollBaseOffset()
getScrollBaseScale
Vector2 getScrollBaseScale()
getScrollOffset
Vector2 getScrollOffset()
isIgnoreCameraZoom
bool isIgnoreCameraZoom()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(ParallaxBackground other)
opEquals
bool opEquals(typeof(null) n)
setIgnoreCameraZoom
void setIgnoreCameraZoom(bool ignore)
setLimitBegin
void setLimitBegin(Vector2 ofs)
setLimitEnd
void setLimitEnd(Vector2 ofs)
setScrollBaseOffset
void setScrollBaseOffset(Vector2 ofs)
setScrollBaseScale
void setScrollBaseScale(Vector2 scale)
setScrollOffset
void setScrollOffset(Vector2 ofs)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

scrollBaseOffset
Vector2 scrollBaseOffset [@property getter]
Vector2 scrollBaseOffset [@property setter]

The base position offset for all ParallaxLayer children.

scrollBaseScale
Vector2 scrollBaseScale [@property getter]
Vector2 scrollBaseScale [@property setter]

The base motion scale for all ParallaxLayer children.

scrollIgnoreCameraZoom
bool scrollIgnoreCameraZoom [@property getter]
bool scrollIgnoreCameraZoom [@property setter]

If true, elements in ParallaxLayer child aren't affected by the zoom level of the camera.

scrollLimitBegin
Vector2 scrollLimitBegin [@property getter]
Vector2 scrollLimitBegin [@property setter]

Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than scrollLimitEnd to work.

scrollLimitEnd
Vector2 scrollLimitEnd [@property getter]
Vector2 scrollLimitEnd [@property setter]

Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than scrollLimitBegin to work.

scrollOffset
Vector2 scrollOffset [@property getter]
Vector2 scrollOffset [@property setter]

The ParallaxBackground's scroll value. Calculated automatically when using a Camera2D, but can be used to manually manage scrolling when no camera is present.

Static functions

_new
ParallaxBackground _new()

Construct a new instance of ParallaxBackground. Note: use memnew!ParallaxBackground instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta