# NNS_G2dCharCanvasMakeCell*

## Syntax

      #include <nnsys/g2d/g2d_CharCanvas.h>

      void NNS_G2dCharCanvasMakeCell1D(
          NNSG2dCellData*         pCell,
          const NNSG2dCharCanvas* pCC,
          int                     x,
          int                     y,
          int                     priority,
          GXOamMode               mode,
          BOOL                    mosaic,
          GXOamEffect             effect,
          GXOamColorMode          color,
          int                     charName,
          int                     cParam,
          NNSG2dOBJVramMode       vramMode,
          BOOL                    makeBR
      );

      void NNS_G2dCharCanvasMakeCell2DRect(
          NNSG2dCellData*         pCell,
          const NNSG2dCharCanvas* pCC,
          int                     x,
          int                     y,
          int                     priority,
          GXOamMode               mode,
          BOOL                    mosaic,
          GXOamEffect             effect,
          GXOamColorMode          color,
          int                     charName,
          int                     cParam,
          BOOL                    makeBR
      );

## Arguments

`pCell` | [OUT] Pointer to the buffer that stores the cell data.
`pCC` | [IN] Pointer to CharCanvas.
`x` | [IN] Center coordinates of cell (in CharCanvas coordinate system).
`y` | [IN] Center coordinates of cell (in CharCanvas coordinate system).
`priority` | [IN] Cell priority.
`mode` | [IN] Cell OBJ mode.
`mosaic` | [IN] Presence or absence of cell mosaic.
`effect` | [IN] Cell effect.
`color` | [IN] CharCanvas color mode.
`charName` | [IN] Starting character name that CharCanvas uses.
`cParam` | [IN] Color palette number.
`vramMode` | [IN] OBJ VRAM capacity.
`makeBR` | [IN] Specifies whether bounding rectangle information should be attached.

## Return Values

None.

## Description

Constructs a cell for actually displaying the CharCanvas initialized using `NNS_G2dCharCanvasInitForOBJ1D` and `NNS_G2dCharCanvasInitForOBJ2DRect` on screen. By using the G2D renderer to draw the cell constructed by this function, the CharCanvas can be easily rotated/scaled/translated for display.

For `pCell`, allocate a buffer that is large enough to store the cell data and the various information that is referenced from the cell data, and specify it. The necessary size of this buffer can be obtained using `NNS_G2dCharCanvasCalcCellDataSize1D` or `NNS_G2dCharCanvasCalcCellDataSize2DRect`.

For `pCC`, specify the pointer to the CharCanvas displayed as the cell.

The center coordinates (`x`, `y`) serve as the reference point when using the renderer to draw a cell. This is also the axis point when the image is rotated.

For the OBJ VRAM capacity `vramMode`, specify one of the following based on the maximum VRAM capacity setting of the hardware.

`NNS_G2D_OBJVRAMMODE_32K` | Maximum capacity of OBJ VRAM that can be used is 32 KB
`NNS_G2D_OBJVRAMMODE_64K` | Maximum capacity of OBJ VRAM that can be used is 64 KB
`NNS_G2D_OBJVRAMMODE_128K` | Maximum capacity of OBJ VRAM that can be used is 128 KB
`NNS_G2D_OBJVRAMMODE_256K` | Maximum capacity of OBJ VRAM that can be used is 256 KB

The `makeBR` argument specifies if bounding rectangle information should be attached. Equivalent to the `-br` option of `g2dcvtr`.

For further information about arguments, see `G2_SetOBJAttr` in the SDK API Reference.

This function secures an internal work buffer in the stack.
Note: The size of this work buffer is relatively large (around 4/3 of the buffer size required for `pCell`). Be careful to avoid stack overflows.

Because an attempt has been made to minimize the number of objects and characters used, it is possible to use long, slender OBJs with a size of 8x32 pixels, or similar. If these long, slender OBJs are rotated, the end of the OBJ will be lost. To exclude long, slender OBJs from the cell, make sure that 2 is the preponderant prime factor of the width and the height of the CharCanvas in characters. Long, slender OBJs will not be included if the width and height are both multiples of 8 characters.

## See Also

## Revision History

2007/02/16 Initial version.

2005/07/12 Initial version.

CONFIDENTIAL