Hi
I have a game scene with 3 main display groups. In the back group, I want 3 layers of png images one on top of the other to ultimately create a parallax starfield effect. They have decreasing alpha. The first one added is opaque, the next layer is at 80% alpha, the top layer is 60%. However, when I add these layers, only the top one is visible… as if the alpha is set to 1 again on at least the top image ( They all still have the right alpha when opened in Gimp, or a basic image viewer ). I know I can set the alpha with
object.alpha
I have been able to achieve the desired effect in the lua code by changing the alpha
… but I was wondering why this is happening?
I’ve been adding the layers to the
backGroup
like this:
parallaxBack = display.newImageRect( backGroup, "parallax/Parallax100.png", display.contentWidth, display.contentHeight ) parallaxBack.x = display.contentCenterX parallaxBack.y = display.contentCenterY parallaxMid = display.newImageRect( backGroup, "parallax/Parallax80.png", display.contentWidth, display.contentHeight ) parallaxMid.x = display.contentCenterX parallaxMid.y = display.contentCenterY parallaxFront = display.newImageRect( backGroup, "parallax/Parallax60.png", display.contentWidth, display.contentHeight ) parallaxFront.x = display.contentCenterX parallaxFront.y = display.contentCenterY