The below code works perfectly in simulator and on the IPhone 4s. The problem appears when this program is deployed to a HTC Desire or HTC Sensation Andriod phone. What happens is that the masking is applied correctly to the lightningGroup but everything else in the display list is rendered black i.e no colour.
Initial feedback from ansca is that this may be a HTC driver issue, has anyone else run into this problem?
Can we expect a fix anytime soon?
If the line lightningGroup:setMask(masks) is removed the issue is fixed.
[code]
local background = display.newImageRect( “assets/levels/Street_01.png” ,760,380)
–local oldStyleSpriteSheetData = require (“sprite_lighting”).getSpriteSheetData()
local lightningoptions =
{
– The params below are optional; used for dynamic resolution support
width = 14,
height = 200,
numFrames = 10,
sheetContentWidth = 140, – width of original 1x size of entire sheet
sheetContentHeight = 200 – height of original 1x size of entire sheet
}
local imageSheet = graphics.newImageSheet( “assets/animation/lightning.png”, lightningoptions )
for i=1, 300 do
local sequenceData = {
name=“firing”,
start=1,
count=10–,
–time=100, – Optional. In ms. If not supplied, then sprite is frame-based.
– loopCount = 0 – Optional. Default is 0 (loop indefinitely)
– loopDirection = “bounce” – Optional. Values include: “forward”,“bounce”
}
local character = display.newSprite( imageSheet, sequenceData )
–character:setReferencePoint(display.BottomCenterReferencePoint);
character:setSequence( “firing”)
character:play()
–character.x = 100
–character.rotation = 40
local masks = graphics.newMask( “assets/animation/lightningMask.png” )
–masks:setReferencePoint(display.BottomCenterReferencePoint);
local lightningGroup = display.newGroup()
lightningGroup.blendMode = “add”
lightningGroup:insert(character)
lightningGroup:setReferencePoint(display.BottomCenterReferencePoint);
lightningGroup.x = 260
lightningGroup.y = math.random() * 200
lightningGroup.rotation = 270
lightningGroup:setMask(masks)
–mask.scaleX
–lightningGroup.maskScaleY = .7
lightningGroup.maskY = 100
end
[/code] [import]uid: 121261 topic_id: 23535 reply_id: 323535[/import]