reckfellENGINE

ParallaxLayer

A parallax scrolling layer to be used with ParallaxBackground.

On this page
class ParallaxLayerReckfellSharpInherits Entity2D

A parallax scrolling layer to be used with ParallaxBackground.

A ParallaxLayer must be the child of a ParallaxBackground node. Each ParallaxLayer can be set to move at different speeds relative to the camera movement or the ParallaxBackground.ScrollOffset value. This node's children will be affected by its scroll offset. Note: Any changes to this node's position and scale made after it enters the scene will be ignored.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

ParallaxLayerConstructor
# ParallaxLayer
C#
public ParallaxLayer();

Properties3

MotionMirroringProperty
# MotionMirroring
C#
public Vector2 MotionMirroring { get; set; }

The interval, in pixels, at which the ParallaxLayer is drawn repeatedly. Useful for creating an infinitely scrolling background. If an axis is set to 0, the ParallaxLayer will be drawn only once along that direction. Note: If you want the repetition to pixel-perfect match a Texture2D displayed by a child node, you should account for any scale applied to the texture when defining this interval. For example, if you use a child Sprite2D scaled to 0.5 to display a 600×600 texture, and want this sprite to be repeated continuously horizontally, you should set the mirroring to Vector2(300, 0). Note: If the length of the viewport axis is bigger than twice the repeated axis size, it will not repeat infinitely, as the parallax layer only draws 2 instances of the layer at any given time. The visibility window is calculated from the parent ParallaxBackground's position, not the layer's own position. So, if you use mirroring, do not change the ParallaxLayer position relative to its parent. Instead, if you need to adjust the background's position, set the CanvasLayer.Offset property in the parent ParallaxBackground. Note: Despite the name, the layer will not be mirrored, it will only be repeated.

MotionOffsetProperty
# MotionOffset
C#
public Vector2 MotionOffset { get; set; }

The ParallaxLayer's offset relative to the parent ParallaxBackground's ParallaxBackground.ScrollOffset.

MotionScaleProperty
# MotionScale
C#
public Vector2 MotionScale { get; set; }

Multiplies the ParallaxLayer's motion. If an axis is set to 0, it will not scroll.

Methods6

GetMirroringVector2
# GetMirroring
C#
public Vector2 GetMirroring();
Returns Vector2
GetMotionOffsetVector2
# GetMotionOffset
C#
public Vector2 GetMotionOffset();
Returns Vector2
GetMotionScaleVector2
# GetMotionScale
C#
public Vector2 GetMotionScale();
Returns Vector2
SetMirroringvoid
# SetMirroring
C#
public void SetMirroring(Vector2 mirror);
Parameters
NameTypeDefault
mirrorVector2—
SetMotionOffsetvoid
# SetMotionOffset
C#
public void SetMotionOffset(Vector2 offset);
Parameters
NameTypeDefault
offsetVector2—
SetMotionScalevoid
# SetMotionScale
C#
public void SetMotionScale(Vector2 scale);
Parameters
NameTypeDefault
scaleVector2—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.