Home  ·  Downloads  ·  Your Account  ·  Submit News
Documentation Homepage
HAMLib reference
Back to HAM Homepage


Window Functions


Functions

void ham_CreateWin (u32 winno, u32 x1, u32 y1, u32 x2, u32 y2, u32 inside_on_for, u32 outside_on_for, u32 fx_on)
 Create a new GBA Window

void ham_DeleteWin (u32 winno)
 Delete a previously defined GBA Window


Function Documentation

void ham_CreateWin u32    winno,
u32    x1,
u32    y1,
u32    x2,
u32    y2,
u32    inside_on_for,
u32    outside_on_for,
u32    fx_on
 

Create a new GBA Window

Parameters:
winno  The window number to initialize and turn on. 0 and 1 are the standard windows that can be used for any section of the screen using the x and y coordinates, winno 2 is the OBJ Window (see comments below)
x1  upper left window x coordinate
y1  upper left window y coordinate
x2  lower right x coordinate
y2  lower right y coordinate
inside_on_for  specifies which BGs or OBJs should be visible inside the window. You can use any combination of the following values (concatinated by the "|" symbol):
  • WIN_BG0
  • WIN_BG1
  • WIN_BG2
  • WIN_BG3
  • WIN_OBJ
Parameters:
outside_on_for  specifies which BGs or OBJs should be visible outside the window. You can use any combination of the following values (concatinated by the "|" symbol):
  • WIN_BG0
  • WIN_BG1
  • WIN_BG2
  • WIN_BG3
  • WIN_OBJ
Parameters:
fx_on  enable the use for special fx in this window (work in progress)
This will enable a window which will block / let through BG displays at your choice. You can set the x and y coordinates at your choice, and also later resize the window. In fact, the function is fast enough to be used to update the window coordinates during a HBL interrupt, basically allowing you to resize the shape while the screen is built, giving you the ability to make custom shapes. A special case is window no 2, which is the so called Object Window. This window disregards the x and y coordinates altogether, because the window region is determined by the sprites currently on the screen (see ham_CreateObj() for information on how to create an ObjWindow compatible sprite). All the sprite pixel data that is not 0x00 (transparent) is considered to be the window region.

See also: ham_CreateObj()

void ham_DeleteWin u32    winno
 

Delete a previously defined GBA Window

Parameters:
winno  The window number to delete
This will delete a window previously initialized by ham_CreateWin()

See also: ham_CreateObj() ham_CreateWin()



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