Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_setgtextvector() set font orientation</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _setgtextvector()       Set font orientation

 #include   <graph.h>

 struct xycoord _setgtextvector(x, y);
 short x, y;            Vector to indicate font rotation

    With _setgtextvector(), you can rotate fonts on the screen. The
    vector formed with x and y indicate what orientation you want
    as follows:

     (0,0)    No change
     (1,0)    Horizontal
     (0,1)    90 degrees counterclockwise
     (-1,0)   180 degrees
     (0,-1)   270 degrees counterclockwise

    For example, if you rotate by 180 degrees, all font characters on
    the screen will be printed upside down. The font rotation stays in
    effect until you change it.

    Returns:    The previous rotation vector in an xycoord structure.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

   -------------------------------- Example ---------------------------------

     This program uses _setgtextvector() to flip a text string on the screen.

    #include <conio.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <graph.h>

    unsigned char *tstring = "Here is the Text";

    void main()
    {
        struct videoconfig vstruc;
        struct _fontinfo finfo;
        short nfont, maxfonts, halfinx, halfiny;

        _setvideomode(_MAXRESMODE);
        _getvideoconfig(&vstruc);
        _registerfonts("*.FON");
        _clearscreen(_GCLEARSCREEN);

        halfinx = vstruc.numxpixels/2 - _getgtextextent(tstring)/2;
        halfiny = vstruc.numypixels/2 + _getgtextextent(tstring)/2;
        _moveto(halfinx, halfiny);

        _setfont("n1");     /* Display first font */
        _setgtextvector(1, 0);
        _outgtext(tstring);
        _setgtextvector(-1, 0);
        _outgtext(tstring);
        _getfontinfo(&finfo);
        getch();

        _unregisterfonts();
        _setvideomode(_DEFAULTMODE);
    }

See Also: _getfontinfo() _registerfonts() _setfont() _unregisterfonts()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson