AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
fill ([double alpha [, int clear]]) typedict.Graphics
 
Fills the current path on drawable by painting the interior, which is identified using the non-zero winding rule, using foreground and the optional alpha argument, which should be a number between 0.0 and 1.0 (the default) as the alpha value. The path is automatically cleared after being drawn unless the optional clear argument in zero, but it can also be preserved using gsave and grestore.
 
 Example:   The program,
import yoix.*.*;

JFrame f = {
    paint(Rectangle r) {
        graphics {          // "named block"
            gsave();
            rectclip(r);
            translate(144, 144);
            moveto(0, -50);
            lineto(29, 40);
            lineto(-47, -15);
            lineto(47, -15);
            lineto(-29, 40);
            closepath();
            setcmykcolor(0, 1, 1, 0);    // red
            gsave();
            fill();
            grestore();
            setrgbcolor(0, 1, 0);
            stroke();
            grestore();
        }
    }
};

f.visible = TRUE;
defines a paint function in a frame that creates a path that looks like a star, fills it with red using fill, and then draws the outline in green. Notice how we surrounded fill with an extra gsave and grestore, which preserved the path so we could draw the outline using stroke.
 
 Return:   none
 
 See Also:   clip, clippath, drawablebbox, eoclip, eoerase, eofill, erase, erasedrawable, ineofill, infill, instroke, rectbutton, rectclip, rectcopy, recterase, rectfill, rectmove, rectstroke, stroke, strokepath

 

Yoix is a registered trademark of AT&T Inc.