It looks like you're new here. If you want to get involved, click one of these buttons!
application:setBackgroundColor(0x323232) local layer = Sprite.new() stage:addChild(layer) local shadow1 = Pixel.new(0, 1, 300, 50) shadow1:setPosition(100, 225) layer:addChild(shadow1) local shadow2 = Pixel.new(0, 1, 50, 300) shadow2:setPosition(225, 100) layer:addChild(shadow2) layer:setAlpha(0.3) |
Comments
Best bad answer of the week?
Set alpha = 1 -On dark stripes
Move dark stripes under layer background
Apply blending mode to the background
Likes: MoKaLux
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
The only solution I can think of right now is using 5 rectangles but that's kind of a performance hit.
Dislikes: Yan
see the following discussion about the same question:
http://forum.giderosmobile.com/discussion/6972/question-about-setting-alpha-of-a-mesh-uniformly-an-open-problem-for-you-to-solve#latest
there actually is a way using stencils which may work in your case.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Hmm..or i could render static shadows into a different render target once (some sort of baking shadows xD), and dynamic shadows every frame (?) into a another render target buffer, then draw static shadows on it.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux, keszegh
I just added a few stencil commands at the bottom of the OP original code.
Likes: keszegh, oleg, rrraptor, MoKaLux, antix