This post previously posted at
https://developer.coronalabs.com/forum/2012/03/18/touch-event-sprite-transparent-area
by Falcon777.
He was asking:
How would you guys propose to handle touch event for a sprite that has quite a bit of transparent area if I do not want those transparent region to react to touch?
I don’t understand why the previous post (check link above) have the title said ‘resolved’ because I don’t see the answer to the problem there.
Let’s say I create image sheet:
local picSheetData = {
width = 100,
height = 60,
numFrames = 8,
sheetContentWidth = 200,
sheetContentHeight = 240
}
local picSheet = graphics.newImageSheet("images/pic.png", picSheetData);
local picSequence = {
{
name = "animate",
start = 1,
count = 4,
time = 500,
loopDirection = "bounce"
}
}
local pic = display.newSprite(picSheet, picSequence);
pic.x = 420;
pic.y = 880;
pic:setSequence("animate");
pic:play();
At which line should I set the masking and how?
What size (pixel) the mask have to be?
Is it one mask for different frame, or each frame can have different mask?
I am sorry for bringing this old question back, because I don’t seem to get the answer from previous post.
Thank you [import]uid: 31508 topic_id: 32509 reply_id: 332509[/import]