🌄 Parallax System - GameCrom Engine
The Parallax System allows you to create dynamic backgrounds that react
to camera movement, giving a sense of depth and natural scrolling in 2D games.
The system is integrated as a standard engine component and respects the object's
original position in the editor.
⚙️ General Concepts
- Parallax is applied through the
Parallax component.
- The background remains anchored to the camera with no jitter or displacement.
- The texture offset only updates when the camera moves.
- The system preserves the original background position (e.g., bottom-anchored or centered).
- Different movement speeds can be set per axis (
X and Y).
📦 Main Properties
speedX → Controls horizontal scroll speed of the pattern.
speedY → Controls vertical scroll speed of the pattern.
🧩 Behaviour
- The background stays locked to the camera, preventing jitter.
- When the camera moves, the background texture scrolls smoothly.
- If the camera is still, the background remains static.
- The effect works both horizontally and vertically.
- The texture scroll is normalized to create an infinite pattern without seams.
💡 Recommendations
- Use low
speedX values (1 to 5) for smooth depth effects.
- Avoid applying Parallax on objects already moved by scripts (movement would double).
- Parallax does not modify physics or camera behaviour, only texture rendering.
- Closer layers to the player should use higher speeds.
🔹 The system is fully compatible with the object's Tiling X and Tiling Y parameters and automatically adapts Parallax to texture tiling.
📌 Summary
- Parallax component integrated into the engine.
- Reacts to actual camera movement.
- Preserves the object's original editor position.
- Configurable horizontal and/or vertical texture scrolling.
- Prevents jitter through camera-aware smoothing and rounding.
- Fully compatible with the render system and layers.