Simple animation involving moving masks...help please?

Hi guys. I’m trying to animate a parchment/scroll opening horizontally. The parchment starts closed in the middle, with the two cylindrical pieces, “scrollright, scrollleft,” separating to reveal “scrollmiddle,” (a rectangle). How do I mask “scrollmiddle” so that it is revealed as the two ends separate?

I picture using two rectangular masks, each the size of half “scrollmiddle,” and having them move in opposite directions, in conjunction with “scrollright and scrollleft.” It’s probably a simple fix, but I was stumped

Any suggestions? Thanks!

reference: iPad 1, 1024x768, landscape orientation

Code follows -->

[lua]–MIDDLE PART OF SCROLL–
local scrollmiddle = display.newImage (“scroll-middle.png”)
localGroup:insert(scrollmiddle)
scrollmiddle.x = 500
scrollmiddle.y = 400

–MASK, NEED HELP!!! –
local mask = graphics.newMask( “mask.png” )
scrollmiddle:setMask( mask )

– RIGHT PART 0F SCROLL –
local scrollright = display.newImage (“scroll-right.png”)
localGroup:insert(scrollright)
scrollright.x = 565
scrollright.y = 370
transition.to( scrollright, { time=1500, alpha=1000, x = 900, y = 370 } )

– LEFT PART OF SCROLL –
local scrollleft = display.newImage (“scroll-left.png”)
localGroup:insert(scrollleft)
scrollleft.x = 465
scrollleft.y = 370
transition.to( scrollleft, { time=1500, alpha=1000, x = 120, y = 370 } ) [/lua] [import]uid: 19765 topic_id: 21009 reply_id: 321009[/import]

Just thinking out loud, but what about scaling the .png under
your two scroll ends…just on the y axis only…like I say
just thinking out loud…stand back…explosion…eminent.

:slight_smile:

I may have to try this when I get home…

interesting tho…
Larry [import]uid: 107633 topic_id: 21009 reply_id: 82972[/import]

Wow – never thought of that – and I think it will work! I’ll give it a shot too and let you know. Thanks! [import]uid: 19765 topic_id: 21009 reply_id: 82981[/import]

I got rid of masks, and changed the initial xScale of scrollmiddle to .01, and added a transition.to changing the xScale to 1… works great!

Thanks for the suggestion. [import]uid: 19765 topic_id: 21009 reply_id: 83032[/import]