Re: [flexcoders] Drawing shapes with holes and applyng them as mask in AS3

2008-08-30 Thread Paul Andrews
- Original Message - 
From: gabriela.perry [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Friday, August 29, 2008 3:45 PM
Subject: [flexcoders] Drawing shapes with holes and applyng them as mask 
in AS3


 Hi there.
 Im trying to make something that will sound very familiar to
 flashers around here (sure youre here!)
 I need to draw a shape with a hole, and need to apply it as a mask to
 an image. Im doing this with Flex. The hole in the mask is
 dynamically created, thats why Im not using flash to draw a movieclip
 as my mask.
 Any ideas? Thanx in advance :0)

Instead of thinking of two shapes with one being subtracted from the other, 
think of it as one of those inflatable neck pillows, but with the ends 
wrapping around completely. It would look like a regular pillow with a hole, 
but would actually be a horseshoe shape with the ends touching.

Paul

 Gabi



[flexcoders] Drawing shapes with holes and applyng them as mask in AS3

2008-08-29 Thread gabriela.perry
Hi there.
Im trying to make something that will sound very familiar to
flashers around here (sure youre here!)
I need to draw a shape with a hole, and need to apply it as a mask to
an image. Im doing this with Flex. The hole in the mask is
dynamically created, thats why Im not using flash to draw a movieclip
as my mask.
Any ideas? Thanx in advance :0)
Gabi



Re: [flexcoders] Drawing shapes with holes and applyng them as mask in AS3

2008-08-29 Thread ivo
I found this post very useful, perhaps you will as well

http://www.insideria.com/2008/01/flex-graphics-tricks-part-1-ma.html

- Ivo



- Original Message 
From: gabriela.perry [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Friday, August 29, 2008 7:45:13 AM
Subject: [flexcoders] Drawing shapes with holes and applyng them as mask in 
AS3


Hi there.
Im trying to make something that will sound very familiar to
flashers around here (sure youre here!)
I need to draw a shape with a hole, and need to apply it as a mask to
an image. Im doing this with Flex. The hole in the mask is
dynamically created, thats why Im not using flash to draw a movieclip
as my mask.
Any ideas? Thanx in advance :0)
Gabi



Re: [flexcoders] Drawing shapes with holes and applyng them as mask in AS3

2008-08-29 Thread Troy Gilbert
 I need to draw a shape with a hole, and need to apply it as a mask to
 an image. Im doing this with Flex. The hole in the mask is
 dynamically created, thats why Im not using flash to draw a movieclip
 as my mask.

I guess the follow-up you posted answers your question, but wanted to
throw in this secret that doesn't seem to be documented anywhere
(that I've seen):

If you draw multiple shapes as part of a single fill operation
(multiple shapes between a beginFill and endFill) the shapes
intersect. This is useful, for example, if you need to create a box
with a circle cut out of it:

graphics.beginFill(0xff);
graphics.drawRect(0, 0, width, height);
graphics.drawCircle(width / 2, height / 2, Math.min(width, height) / 4);
graphics.endFill();

Troy.


RE: [flexcoders] Drawing shapes with holes and applyng them as mask in AS3

2008-08-29 Thread Alex Harui
I think of it as a scanline fill algorithm, which is why it works

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Troy 
Gilbert
Sent: Friday, August 29, 2008 10:24 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Drawing shapes with holes and applyng them as mask 
in AS3


 I need to draw a shape with a hole, and need to apply it as a mask to
 an image. Im doing this with Flex. The hole in the mask is
 dynamically created, thats why Im not using flash to draw a movieclip
 as my mask.

I guess the follow-up you posted answers your question, but wanted to
throw in this secret that doesn't seem to be documented anywhere
(that I've seen):

If you draw multiple shapes as part of a single fill operation
(multiple shapes between a beginFill and endFill) the shapes
intersect. This is useful, for example, if you need to create a box
with a circle cut out of it:

graphics.beginFill(0xff);
graphics.drawRect(0, 0, width, height);
graphics.drawCircle(width / 2, height / 2, Math.min(width, height) / 4);
graphics.endFill();

Troy.