What it does
The gradient runs from sky at the top to a darkened sun colour at the bottom. A round disc in the sun colour sits
at sunY down the screen, sized by sunSize as a fraction of the screen height, and below its middle it is sliced by
horizontal haze bands that scroll on the backdrop's clock. A soft halo in the same colour spreads around it.
The disc stays round on any aspect ratio. The layer is opaque and pinned to the screen, so it is the base of the stack: stars or an aurora go over it for a night sky, and the game's road, grid or skyline goes in front.
Features
- A gradient sky — from the sky colour down to a darkened sun colour.
- A banded sun — a big disc with scrolling haze bands below its middle.
- A halo — a soft glow round the disc.
- Placement —
sunYputs the disc anywhere down the screen andsunSizesizes it. - Two live colours —
skyandsun, retinted at any time. - Round on any screen — the disc keeps its shape whatever the aspect ratio.
Good for
- Neon runners and retro racers — a sun on the horizon behind the road.
- Synthwave and vaporwave title screens — the poster look in one call.
- Night versions — a darker palette with
backdrop-starsorbackdrop-auroraover it. - Rhythm and arcade games — a bold, cheap backdrop behind the play.
Make it yours
The defaults are an orange sun on purple. For a hot-pink sun sinking low, set sunY to 0.7 and the sun colour to a
pink. Tween sunY down over a level for a sun that sets while the player plays, and give a portrait screen a smaller
sunSize.
A quick look
A sunset, lowered and turned pink live:
const s = game.backdrop.add('sunset', { sunY: 0.62, sunSize: 0.16 }, { sky: '#2a1445', sun: '#ff9a3d' });
s.set('sunY', 0.7);
s.setColor('sun', '#ff3d7a');
Works with
backdrops— the runtime; required.backdrop-starsandbackdrop-aurora— over it for a night sky.backdrop-raster-bands— for a sunset in hard stripes rather than a smooth gradient.backdrop-environments— a calmer painted sunset with mountain silhouettes, among its thirteen scenes.
Good to know
- It is opaque: nothing beneath it shows, including a background image.
- The haze bands are fixed at 70 per screen height.
- A portrait screen wants a smaller
sunSize.






