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

Inverted Masks

Community Expert ,
Dec 03, 2008 Dec 03, 2008

Copy link to clipboard

Copied

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

Views

813

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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 😉

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST
Thanks, I was about to try doing with a bitmap, this helps.

Votes

Translate

Translate

Report

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