-
[F8] question regarding the drawing API
is it possible to draw a simple box with a solid fill, but a designated area is not filled?
I tried this
var mov:MovieClip = _root.createEmptyMovieClip("test", 1);
mov.lineStyle(1,0x0,100);
mov.moveTo(150, 150);
mov.lineTo(200, 150);
mov.lineTo(200, 200);
mov.lineTo(150, 200);
mov.lineTo(150, 150);
mov.moveTo(0,0);
mov.beginFill(0x0, 100);
mov.lineTo(550, 0);
mov.lineTo(550, 400);
mov.lineTo(0, 400);
mov.lineTo(0,0);
Edit: I wonder if I just draw around the area I want to highlight... but I'd still like to know if there's just some kind of boolean I can turn on or off.
thinking that if I draw an empty box first and then the bigger box around it and fill the big box, itll fill to the edges of the small box.
The effect I'm trying to achieve is programmatically highlighting a certain area of the stage while dimming the rest.
I know I can use masks to achieve this effect, but using the fill would be a lot more straight forward.
Last edited by Ogre11; 02-27-2007 at 12:50 PM.
-
while (2+2 == 4) {
drink ("bourbon");
}
gotoAndStop("bed");
-
you mean for the knockout? I plan to add a glow on top, but the effect I want to achieve is to be able to dim everything on the stage except a predefined area.
I've set it up so that it draws around the area that shouldnt be filled
Code:
var mov:MovieClip = parent.createEmptyMovieClip ("highlight_" + parent.getNextHighestDepth(), parent.getNextHighestDepth());
mov.lineStyle (0, 0x0, 0);
mov.moveTo (0, 0);
mov.beginFill (highlightColor, 100);
mov.lineTo (Stage.width, 0);
mov.lineTo (Stage.width, Stage.height + 100);
mov.lineTo (x + width, Stage.height + 100);
mov.lineTo (x + width, y);
mov.lineTo (x, y);
mov.lineTo (x, y + height);
mov.lineTo (x + width, y + height);
mov.lineTo (x + width, Stage.height + 100);
mov.lineTo (0, Stage.height + 100);
mov.lineTo (0, 0);
thats in a class, so parent is passed in, it's set to level0 right now, and x,y width and height define where the un dimmed area is
for some reason, though it thinks Stage.height is 100px less than it actually is
-
Ahh, ok .. I get it now .. I didn't read carefully before and thought you just want to highlight an area with a border.
Hmm, I think it would be easier with masks
while (2+2 == 4) {
drink ("bourbon");
}
gotoAndStop("bed");
-
Maybe try something like this...
Code:
var mov:MovieClip = _root.createEmptyMovieClip("test", 1);
mov.lineStyle(1,0x0,100);
mov.moveTo(0,0);
mov.beginFill(0x0, 100);
mov.lineTo(550, 0);
mov.lineTo(550, 400);
mov.lineTo(0, 400);
mov.lineTo(0,0);
mov.moveTo(150, 150);
mov.lineTo(200, 150);
mov.lineTo(200, 200);
mov.lineTo(150, 200);
mov.lineTo(150, 150);
mov.endFill();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|