##### Ninja Library - 2D Drawing Function

# njDrawScroll

Draws a 2D scroll surface

### FORMAT

`

  void njDrawScroll( *scl )
  NJS_SCROLL *scl

`

### PARAMETER

  `*scl` | Pointer to scroll structure

### RETURN

  None

### DESCRIPTION

  Draws a 2D scroll structure in the clip screen.

### EXAMPLE

      Uint32 map[4][5];
      NJS_SCROLL scl;
      NJS_TEXLIST texlist;
      NJS_TEXMEMLIST *texmemlist;
      Sint8 *texbuf;
      /* Cell definition */
      /* Prepare to load 5 textures */
      texmemlist = syMalloc(sizeof(NJS_TEXMEMLIST)*5);
      texbuf = syMalloc(0x20000);
      njInitVertexBuffer( 1000000, 0, 1000, 0, 0 );
      njInitTexture(texmemlist,5);
      njLoadTexture(&texlist);
      syFree(texbuf);
      /* The scroll function does not require calling njSetTexture() or njSetTextureNum() */
      /* Set the scroll structure */
      scl.celps = 128;        /* cell size 8 - 1024 */
      scl.mapw = 5;          /* Number of map cells horizontally */
      scl.maph = 4;          /* Number of map cells vertically */
      scl.sx = 1.0f;         /* Scale horizontally */
      scl.sy = 1.0f;         /* Scale vertically */
      scl.spx = 320.f;        /* Scale center x coordinate */
      scl.spy = 240.f;        /* Scale center y coordinate */
      scl.list = &texlist;      /* Texture list */
      scl.map = (Uint32*)map;     /* Map array */
      scl.mflag = ON;         /* Matrix flag */
      scl.sflag = ON;         /* Scale flag */
      scl.pr = -100.f;        /* Priority -1.f (front) to -65535.f (rear) */
      scl.px = 0.f;          /* Movement x coordinate */
      scl.py = 0.f;          /* Movement y coordinate */
      scl.bx = 0.f;          /* Start of map write x coordinate */
      scl.by = 0.f;          /* Start of map write y coordinate */
      scl.cx = 320.f;        /* Rotation center x coordinate */
      scl.cy = 240.f;        /* Rotation center y coordinate */
      scl.sclc.argb.a = 255;    /* Globally applied A*/
      scl.sclc.argb.r = 255;    /* Globally applied R*/
      scl.sclc.argb.g = 255;    /* Globally applied G*/
      scl.sclc.argb.b = 255;    /* Globally applied B */
      scl.colmode = NJD_COLOR_MODE_PACKED_TEXTURE; /* Set color mode  NJD_COLOR_MODE_PACKED_TEXTURE
                        NJD_COLOR_MODE_PACKED_TEXTURE_TRANS */
      njDrawScroll(&scl);

### REFERENCE

  `njInitTexture()
  njLoadTexture()
  `

njDrawScroll

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999