Page 1 of 1

Multi-layer Background

Posted: Fri Jun 21, 2019 5:37 pm
by kirkdev
Hello,

My name is Kirk. I have just started playing around with Love2D, maybe for 2 weeks or so now. I was impressed at how quick I was able to put something together and completed a small shooting gallery game in a single evening.
The attachment ShootingGallery.png is no longer available
(Crosshair attached to mouse hidden in screenshot for some reason)

I am now going to complete a slightly bigger project in which it has multiple images used as the background to create a parallax effect. I seem to be having problems of the bat just loading these images. I have attached the 2 of the 4 layers I am using for the background 1-4 in which the order they should be drawn.

I am getting a black background and no errors. After further investigation it looks like image 1 loads and can be drawn just fine but the other 3 do not load at all.

Is there some issue with loading images which have alpha?

Re: Multi-layer Background

Posted: Sat Jun 22, 2019 2:57 pm
by Xugro
There is no problem with loading and drawing images that have alpha transparency. Just use the normal image loading function love.graphics.newImage(filename). You can take a peek at my example if you like (big thanks to PWL for the images).

Re: Multi-layer Background

Posted: Sat Jun 22, 2019 3:07 pm
by zorg
If the images are too big, you might be running out of texture memory; sadly, without you sharing all the necessary information (code and assets, but preferably as a .love file of a minimal example where it still happens), the only thing we can do is just guess.