parallax: add parallax scrolling to your camera

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
idbrii
Prole
Posts: 34
Joined: Sat Jun 12, 2021 5:07 am

parallax: add parallax scrolling to your camera

Post by idbrii »

parallax is a camera utility library for LÖVE that adds parallax scrolling when used with a camera library.

parallax is not a camera system! It lets you add parallax layers to your camera (e.g., gamera).

https://github.com/idbrii/love-parallax


Web demo
parallax-demo.love
v0.0.f4fe9da
(278.71 KiB) Downloaded 171 times
Image

Image shows three parallax layers and the magenta "normal" layer. The background image is drawn with draw_tiled_single_axis. When running the demo, press `p` to enter this platformer mode.

I initially did a camera comparison with brady, stalker-x, and gamera liked the features of gamera. I built parallax because I wanted parallax scrolling without using giving up gamera. It doesn't reference the camera, so you should be able to use it with any camera library.

I recently added layer:draw_tiled_xy() and layer:draw_tiled_single_axis() to draw a parallax background image tiled with a minimal number of draws. So if your camera shows 100 units of world and the image is 100 units wide, it will only draw the image only twice (when the seam is showing). You can press 'p' in the demo to switch between demonstrating these two draw methods.

parallax powers the two background layers in my jam game Commit The Bad Stuff.
Last edited by idbrii on Mon Feb 14, 2022 5:30 pm, edited 1 time in total.
User avatar
dusoft
Party member
Posts: 492
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: parallax: add parallax scrolling to your camera

Post by dusoft »

Nice!
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests