The Graphics Cursor

Many of Fastgraph's graphics functions depend on the position of the graphics cursor as a reference point. For example, Fastgraph includes functions to draw lines from the graphics cursor position to a specified position, and the bitmapped image display functions display or retrieve an image relative to the graphics cursor position. The graphics cursor is not a cursor in the true sense; it is simply a pair of (x,y) coordinates with a special meaning. The fg_vbinit() function sets the graphics cursor position to the screen space coordinates (0,0), and fg_initw() sets it to the world space coordinates (0.0,0.0).

Fastgraph includes four functions for changing the graphics cursor position. The fg_move() function sets it to an absolute screen space position, while fg_movew() sets it to an absolute world space position. The fg_moverel() function sets the graphics cursor position to a screen space position relative to its current position. The fg_moverw() function does the same in world space. Each of these functions has two parameters that specify the (x,y) coordinates of the new position. For the screen space functions, the parameters are integer quantities. For the world space functions, they are floating point quantities.

You can obtain the screen space coordinates of the graphics cursor position with the fg_getxpos() and fg_getypos() functions. These functions have no parameters and respectively return the x and y coordinates of the graphics cursor position as the function value. To obtain the world space coordinates of the graphics cursor position, apply the fg_xworld() and fg_yworld() functions to the fg_getxpos() and fg_getypos() return values.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.