# G2_SetOBJAttr

## C Specification

      #include <nitro/gx/g2_oam.h>

      void G2_SetOBJAttr(
      GXOamAttr * oam,
      int x,
      int y,
      int priority,
      GXOamMode mode,
      BOOL mosaic,
      GXOamEffect effect,
      GXOamShape shape,
      GXOamColorMode color,
      int charName,
      int cParam,
      int rsParam
      );

## Arguments

oam | Pointer to the location storing the OAM data
x | X coordinate
y | Y coordinate
priority | Display priority (0-3)
mode | OBJ mode
mosaic | Mosaic enable/disable
effect | Specify effect type
shape | Shape of OBJ
color | Color mode (can only be specified in 16-color mode when mode is set to bitmap OBJ)
charName | Name of the first character (must be an even number when in 2-dimensional mapping mode and 256-color mode)
cParam | Color parameter (is `a` when mode is set to bitmap OBJ; in all other cases, color palette is `No`)
rsParam | Affine transformation parameter index (valid only when the effect is affine or affine double display)

## Return Values

None.

## Description

This function sets OBJ attributes in a batch. This function can set all the bits for OBJ attributes 0, 1, and 2.

`GX_OAM_MODE_NORMAL` | Normal OBJ
`GX_OAM_MODE_XLU` | Translucent OBJ
`GX_OAM_MODE_OBJWND` | OBJ window
`GX_OAM_MODE_BITMAPOBJ` | Bitmap OBJ

`GX_OAM_EFFECT_NONE` | No effects
`GX_OAM_EFFECT_FLIP_H` | H flip
`GX_OAM_EFFECT_FLIP_V` | V flip
`GX_OAM_EFFECT_FLIP_HV` | HV flip
`GX_OAM_EFFECT_AFFINE` | Affine
`GX_OAM_EFFECT_NODISPLAY` | Hide
`GX_OAM_EFFECT_AFFINE_DOUBLE` | Affine (Double-size display)

`GX_OAM_SHAPE_8x8` | `8x8` pixels
`GX_OAM_SHAPE_16x16` | `16x16` pixels
`GX_OAM_SHAPE_32x32` | `32x32` pixels
`GX_OAM_SHAPE_64x64` | `64x64` pixels
`GX_OAM_SHAPE_16x8` | `16x8` pixels
`GX_OAM_SHAPE_32x8` | `32x8` pixels
`GX_OAM_SHAPE_32x16` | `32x16` pixels
`GX_OAM_SHAPE_64x32` | `64x32` pixels
`GX_OAM_SHAPE_8x16` | `8x16` pixels
`GX_OAM_SHAPE_8x32` | `8x32` pixels
`GX_OAM_SHAPE_16x32` | `16x32` pixels
`GX_OAM_SHAPE_32x64` | `32x64` pixels

`GX_OAM_COLORMODE_16` | 16-color mode
`GX_OAM_COLORMODE_256` | 256-color mode

Below are the matrix format type definitions used in the argument.

    typedef enum
    {
    GX_OAM_MODE_NORMAL = 0,
    GX_OAM_MODE_XLU = 1,
    GX_OAM_MODE_OBJWND = 2,
    GX_OAM_MODE_BITMAPOBJ = 3
    }
    GXOamMode;

    typedef enum
    {
    GX_OAM_EFFECT_NONE =
    (0 << GX_OAM_ATTR01_RSENABLE_SHIFT) | (0 << GX_OAM_ATTR01_HF_SHIFT) | (0 << GX_OAM_ATTR01_VF_SHIFT),
    GX_OAM_EFFECT_FLIP_H =
    (0 << GX_OAM_ATTR01_RSENABLE_SHIFT) | (1 << GX_OAM_ATTR01_HF_SHIFT) | (0 << GX_OAM_ATTR01_VF_SHIFT),
    GX_OAM_EFFECT_FLIP_V =
    (0 << GX_OAM_ATTR01_RSENABLE_SHIFT) | (0 << GX_OAM_ATTR01_HF_SHIFT) | (1 << GX_OAM_ATTR01_VF_SHIFT),
    GX_OAM_EFFECT_FLIP_HV =
    (0 << GX_OAM_ATTR01_RSENABLE_SHIFT) | (1 << GX_OAM_ATTR01_HF_SHIFT) | (1 << GX_OAM_ATTR01_VF_SHIFT),
    GX_OAM_EFFECT_AFFINE = (1 << GX_OAM_ATTR01_RSENABLE_SHIFT),
    GX_OAM_EFFECT_NODISPLAY = (2 << GX_OAM_ATTR01_RSENABLE_SHIFT),
    GX_OAM_EFFECT_AFFINE_DOUBLE = (3 << GX_OAM_ATTR01_RSENABLE_SHIFT)
    }
    GXOamEffect;

    typedef enum
    {
    GX_OAM_SHAPE_8x8 = (0 << GX_OAM_ATTR01_SHAPE_SHIFT) | (0 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_16x16 = (0 << GX_OAM_ATTR01_SHAPE_SHIFT) | (1 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_32x32 = (0 << GX_OAM_ATTR01_SHAPE_SHIFT) | (2 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_64x64 = (0 << GX_OAM_ATTR01_SHAPE_SHIFT) | (3 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_16x8 = (1 << GX_OAM_ATTR01_SHAPE_SHIFT) | (0 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_32x8 = (1 << GX_OAM_ATTR01_SHAPE_SHIFT) | (1 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_32x16 = (1 << GX_OAM_ATTR01_SHAPE_SHIFT) | (2 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_64x32 = (1 << GX_OAM_ATTR01_SHAPE_SHIFT) | (3 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_8x16 = (2 << GX_OAM_ATTR01_SHAPE_SHIFT) | (0 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_8x32 = (2 << GX_OAM_ATTR01_SHAPE_SHIFT) | (1 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_16x32 = (2 << GX_OAM_ATTR01_SHAPE_SHIFT) | (2 << GX_OAM_ATTR01_SIZE_SHIFT),
    GX_OAM_SHAPE_32x64 = (2 << GX_OAM_ATTR01_SHAPE_SHIFT) | (3 << GX_OAM_ATTR01_SIZE_SHIFT)
    }
    GXOamShape;

    typedef enum
    {
    GX_OAM_COLORMODE_16 = 0,
    GX_OAM_COLORMODE_256 = 1
    }
    GXOamColorMode;

## See Also

GXOamAttr

## Revision History

02/13/2004

- Added to description.

01/19/2004 Initial version.

CONFIDENTIAL