Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Inverted Masks

Community Expert ,
Dec 03, 2008 Dec 03, 2008
Is there an easy way to programatically create an inverted mask? I have a large sprite with a smaller sprite on top. If I mask the large sprite with the smaller sprite it gets trimmed to the small sprite's dimension. What if I wanted the larger sprite to appear to have a hole cut out of it the size of the small sprite?
TOPICS
ActionScript
885
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 03, 2008 Dec 03, 2008
Without knowing your true intentions, one option is to just make the smaller sprite the same color as the background behind the larger sprite and forget the mask.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2008 Dec 04, 2008
I do need a mask. I need a window or cutout in a front object so that when an object is moving behind the front object it is masked by the cutout
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Dec 04, 2008 Dec 04, 2008
you could use the 'smaller' sprite to mask the moving object, and not the mask the larger sprite - in this way it will 'appear' as thought there is a hole in the larger object 😉
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2008 Dec 04, 2008
I don't think you can invert a mask in any simple manner, though I may be wrong. Here's a link to a possible solution that uses code:

http://www.actionscript.org/forums/showthread.php3?p=796025
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2008 Dec 04, 2008
LATEST
Thanks, I was about to try doing with a bitmap, this helps.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines