Ninja Library - 2D Graphics Function

njDrawLine2D

Draws a line on a 2D screen

FORMAT

void njDrawLine2D( *p, n, pri, attr )
NJS_POINT2COL *p
Int n
Float pri
Uint32 attr

PARAMETER

 *p  List of coordinates for drawing line endpoints 
 n  Number of lines to be drawn 
 pri  Priority (use for Z value) 
 attr  Attribute (select drawing method) 

RETURN

None

DESCRIPTION

Draws n number of lines on a 2D screen.

The attribute used is data point *p given on the screen coordinates, n number of straight lines will be drawn.

 -NJD_DRAW_NORMAL  Independent line drawing. 
 -NJD_DRAW_FAN  Radial line drawing. 
 -NJD_DRAW_CONNECTED  Connected line drawing. 
 -NJD_TRANSPARENT  Transparent drawing. 
 -NJD_USE_TEXTURE  Drawing with texture. 

These five attributes can be used in mutually consistent combinations by using the "|" character as a delimiter.


EXAMPLE

Sint32 i;
NJS_POINT2COL	p2c[100];
NJS_POINT2	p[100];
NJS_COLOR	col[100];
p2c.p = p;
p2c.col = col;
p2c.tex = NULL;
p2c.num = 100;
for(i=0;i<100;i++){
 p2c.p[i].x = (Sint16)(njRandom() * 640.f);
 p2c.p[i].y = (Sint16)(njRandom() * 480.f);
 p2c.p[i].col.color = (Sint32)(njRandom() * 0xFFFFFFFF);
}
njDrawLine2D(p2c,100,-2.f,NJD_DRAW_NORMAL|NJD_TRANSPARENT);

NOTE

The NJD_DRAW_NORMAL attribute may be omitted when it is used in combination with other attributes.

REFERENCE

NJS_POINT2COL()

njDrawLine2D
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999