# NNS_G2dArrangeOBJ*

## C Specification

      #include <nnsys/g2d/g2d_CharCanvas.h>

      int NNS_G2dArrangeOBJ1D(
      GXOamAttr * oam,
      int areaWidth,
      int areaHeight,
      int x,
      int y,
      GXOamColorMode color,
      int charName,
      NNSG2dOBJVramMode vramMode
      );

      int NNS_G2dArrangeOBJ2DRect(
      GXOamAttr * oam,
      int areaWidth,
      int areaHeight,
      int x,
      int y,
      GXOamColorMode color,
      int charName
      );

## Arguments

oam | [OUT] Pointer to the OAM array of the OBJ that will be used for displaying CharCanvas.
areaWidth | [IN] CharCanvas width (in character units)
areaHeight | [IN]CharCanvas height (in character units)
x | [IN] CharCanvas upper-left corner display location (in pixel units)
y | [IN] CharCanvas upper-left corner display location (in pixel units)
color | [IN] CharCanvas color mode
charName | [IN] Starting character name
vramMode | [IN] OBJ VRAM capacity

## Return Values

The number of OBJ being used.

## Description

This functions appropriately positions OBJ so the CharCanvas initialized by `NNS_G2dCharCanvasInitForOBJ1D` or `NNS_G2dCharCanvasInitForOBJ2DRect` can actual display on the screen. To be specific, the function sets the OBJ parameters for location, size, starting-character name and color mode. The other parameters require special settings.

Specify one of the following for the OBJ VRAM capacity vramMode

NNS_G2D_OBJVRAMMODE_32K | Maximum capacity of available OBJ VRAM is 32KB
NNS_G2D_OBJVRAMMODE_64K | Maximum capacity of available OBJ VRAM is 64KB
NNS_G2D_OBJVRAMMODE_128K | Maximum capacity of available OBJ VRAM is 128KB
NNS_G2D_OBJVRAMMODE_256K | Maximum capacity of available OBJ VRAM is 256KB

Depending on the color mode color and the OBJ VRAM capacity vramMode, there are some restrictions on the areaWidth and areaHeight that can be set with `NNS_G2dArrangeOBJ1D`. The restrictions are explained in the table below.

Color mode | OBJ VRAM Capacity
--- | ---
32K | 64K | 128K | 256K
16 colors | (No restrictions) | (No restrictions) | Cannot be an odd number that has a remainder of 3 when divided by 4. | Cannot be an odd number.
256 colors | (No restrictions) | (No restrictions) | (No restrictions) | Cannot be an odd number that has a remainder of 3 when divided by 4.

To find out how many OBJ are required before calling this function, use either `NNS_G2dCalcRequiredOBJ1D` or `NNS_G2dCalcRequiredOBJ2DRect`.

## See Also

`NNS_G2dCharCanvasInitForOBJ1D, NNS_G2dCharCanvasInitForOBJ2DRect, NNS_G2dCalcRequiredOBJ1D, NNS_G2dCalcRequiredOBJ2DRect`

## Revision History

05/25/2005 Initial version.