Corona crashes when working with masks

Corona crashes and quits unexpectedly when I am trying to work with masks. All files referenced exist and valid.
whenever I apply a mask/touch (or sometimes enter the scene) Corona crashes.

running latest trial version 2011.704a on a mac OSX 10.7.3

code that exhibits the issue:

  
 raponzelItem = display.newImage(easyGrp, "Graphics/Diff\_Medival/raponzel.png", 223, 232, true)  
 raponzelItem:setReferencePoint( display.CenterReferencePoint )  
 horseItem = display.newImage(easyGrp,"Graphics/Diff\_Medival/horse.png", 5,5,true)--400, 1900, true)  
 mask = graphics.newMask( "Graphics/Diff\_Medival/horse\_mask.png" )  
 horseItem:setMask(mask )  
 horseItem.maskX = horseItem.x  
 horseItem.maskY = horseItem.y  
 horseItem:setReferencePoint( display.CenterReferencePoint)  
  
 backgroundGrp:setReferencePoint( display.TopLeftReferencePoint)--CenterReferencePoint )  
 backgroundGrp.x = 0--screenW/2  
 backgroundGrp.y = 0--screenH/2  
  
 easyGrp:setReferencePoint( display.TopLeftReferencePoint)--CenterReferencePoint )  
 easyGrp.x = 0  
 easyGrp.y = 0  
  
 group:insert(backgroundGrp)  
 group:insert(easyGrp)  

I need to create touch masks to my objects but corona crashes all the time…
please help!
i

[import]uid: 124146 topic_id: 24572 reply_id: 324572[/import]

We have fixed several mask issues since the latest trial build although some still exist and we are working on that.

I just ran this (with my own images and mask) in 773 and as is, it did not crash. [import]uid: 52491 topic_id: 24572 reply_id: 99481[/import]

ah, OK, thanks!
Any chance for a near-future update to the trial version for sorting out those bugs?

when trying to move an object (which is part of a group) with a mask applied, am I supposed to also update its .maskX and .maskY? because that causes a certain crash even if the mask file is good (dimensions dividable by 4, and 3 pixel black border, etc)
if mask is not touched object loses its ‘maskability’

[see commented lines]

[code]

local function touchItemListener (event)
local phase = event.phase
local t = event.target

if (phase == “began”) then
display.getCurrentStage():setFocus( t )

t.isFocus = true
t.x0 = event.x - t.x
t.y0 = event.y - t.y

elseif t.isFocus then
if phase == “moved” then
– Store initial position
t.x = event.x - t.x0
t.y = event.y - t.y0

– print(“moved”)
elseif phase == “ended” then
– t.maskX = t.x
– t.maskY = t.y
display.getCurrentStage():setFocus( nil )
t.isFocus = false
print(t.x…" "…t.y)

end
end
end
[/code] [import]uid: 124146 topic_id: 24572 reply_id: 99484[/import]

I was crashing yesterday with 777 and having all kinds of weird mask issues (and still am), but the crashing stopped once I read that the masks have to have dimensions divisible by 4.

My masks were 982 x 650. Neither dimension was evenly divisible by 4. I extended the canvas on them to 984 x 652 and all of my crashing and mask distortion problems went away.

[import]uid: 19626 topic_id: 24572 reply_id: 99509[/import]

thanks robmiracle As I mentioned, I made sure my masks’ dims are divisible by 4, but I am running on 2011.704a so behaviour might be different.

Did you have any luck moving objects with masks and getting the masks to be updated correctly to the new object location? (without crash)
[import]uid: 124146 topic_id: 24572 reply_id: 99511[/import]

@Mindbomb - if you have code besides what you presented and want to know if it crashes on newer versions let me know, will run it for you. What you put up works fine in 773, though.

As Rob mentioned (as did I above) we do have some ongoing issues with masks that we are working to fix, although some have been resolved since 704.

Peach :slight_smile: [import]uid: 52491 topic_id: 24572 reply_id: 99706[/import]

OK, so as far as moving objects with masks goes…
if I update object.x & .y, should I also update it’s .maskX and .maskY accordingly?
What’s the right practice for that? I didn’t find a recommendation in the docs…

because that’s (updating .maskX, .maskY in a touch event drag function) causing some harsh crashes on my side (704a)… can post the code if needed
[import]uid: 124146 topic_id: 24572 reply_id: 99730[/import]