Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - position http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Position
 moveto()                Move the Current Position (CP) to a New Position

 #include   <graphics.h>

 void far   moveto(x1,y1);
 int        x1;
 int        y1;

    moveto() moves the current position (CP) to a new position specified
    by ('x1','y1').  'x1' and 'y1' are relative to the current viewport.

    Returns:    Nothing.

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

    The following statements draw rays out to points relative to the
    original current position.

           #include <graphics.h>
           #include <conio.h>

           int gdriver = DETECT;
           int gmode;

           main()
           {
               int x;
               int x0, y0;

               initgraph(&gdriver,&gmode,"");
               x0 = getx();
               y0 = gety();
               linerel(100,200);
               moveto(x0,y0);
               linerel(200,200);
               moveto(x0,y0);
               linerel(300,200);
               moveto(x0,y0);
               linerel(400,200);
               getch();
               closegraph();
           }


See Also: moverel()

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