HAM Documentation

Home · Downloads · Your Account · Submit News

Documentation Homepage HAMLib reference Back to HAM Homepage |

# BG and OBJ Rotation Functions

## Functions

void | ham_RotBg (u8 bgno, u16 angle, s32 center_x, s32 center_y, FIXED zoom)
| Rotate / Zoom a BG
void | ham_RotBgEx (u8 bgno, u16 angle, s32 center_x, s32 center_y, u16 x_scroll, u16 y_scroll, FIXED zoom_x, FIXED zoom_y)
| Rotate / Zoom a BG (Advanced options available)
void | ham_RotObjDefineSet (u8 rotset, u16 angle, FIXED zoom_x, FIXED zoom_y)
| Set the Values for a Rotation Set for Sprite Rotation

## Function Documentation

void ham_RotBg | ( | u8 | bgno,
|  | u16 | angle,
|  | s32 | center_x,
|  | s32 | center_y,
|  | FIXED | zoom
| ) |

Rotate / Zoom a BG

Parameters:

  bgno | The BG number to rotate. Make sure the BG is rotation capable. See ham_InitMapSet() for more information
  angle | The angle to rotate the BG in degrees (0..359)
  center_x | The X center of the rotation
  center_y | The Y center of the rotation
  zoom | The zoom level (default is 0x100 which is 256, means no zoom)

See also: ham_InitMapSet() ham_RotBgEx()

void ham_RotBgEx | ( | u8 | bgno,
|  | u16 | angle,
|  | s32 | center_x,
|  | s32 | center_y,
|  | u16 | x_scroll,
|  | u16 | y_scroll,
|  | FIXED | zoom_x,
|  | FIXED | zoom_y
| ) |

Rotate / Zoom a BG (Advanced options available)

Parameters:

  bgno | The BG number to rotate. Make sure the BG is rotation capable. See ham_InitMapSet() for more information
  angle | The angle to rotate the BG in degrees (0..359)
  center_x | The X center of the rotation
  center_y | The Y center of the rotation
  x_scroll | The X scrolling value for the BG
  y_scroll | The Y scrolling value for the BG
  zoom_x | The zoom level for the X axis (default is 0x100 which is 256, means no zoom)
  zoom_y | The zoom level for the Y axis (default is 0x100 which is 256, means no zoom)

See also: ham_InitMapSet() ham_RotBg()

void ham_RotObjDefineSet | ( | u8 | rotset,
|  | u16 | angle,
|  | FIXED | zoom_x,
|  | FIXED | zoom_y
| ) |

Set the Values for a Rotation Set for Sprite Rotation

Parameters:

  rotset | The Rotation Set you want to modify (0..31)
  angle | The angle to rotate the BG in degrees (0..359)
  zoom_x | The zoom level for the X axis (default is 0x100 which is 256, means no zoom)
  zoom_y | The zoom level for the Y axis (default is 0x100 which is 256, means no zoom)

See also: ham_CreateObj() ham_SetObjRotEnable() ham_SetObjRotSetSelect()

Documentation Homepage | HAMLib reference | Back to HAM Homepage
documentation created with Doxygen