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
ashow (Number ax, Number ay, String str [, double alpha]) typedict.Graphics
 
Draws the characters in str on drawable starting at the current point, which is adjusted as the characters in str are printed. Character outlines come from font and are painted using foreground and the optional alpha argument, which should be a number between 0.0 and 1.0, as the alpha value. Omitting alpha or supplying a value of 1.0 are equivalent. ashow aborts with a nocurrentpoint error if path is empty.

ashow always processes the characters in str individually, even when ax and ay are zero, and is used to make identical adjustments to the position of every character. The first character in str is placed at the current point, which is adjusted horizontally by the width of that character plus ax and vertically by ay before the second character is printed. The process stops after the last character in str is printed.
 
 Example:   The program,
import yoix.*.*;

JFrame f = {
    Graphics graphics = {
        String font = "Lucida-bold-24";
        Color  foreground = Color.red;
    };

    paint(Rectangle r) {
        String text = "hello, world";

        graphics {          // "named block"
            gsave();
            rectclip(r);
            translate(drawable.size.width/2, drawable.size.height/2);
            moveto(-stringwidth(text)/2, 0);
            ashow(0, -3, text);
            grestore();
        }
    }
};

f.visible = TRUE;
defines a paint function in a frame that draws a string of characters near the center of the frame using ashow.
 
 Return:   none
 
 See Also:   awidthshow, charpath, imagepath, kshow, show, showimage, stringadvance, stringbounds, stringwidth, widthshow

 

Yoix is a registered trademark of AT&T Inc.