NightFox’s Lib
|
Functions to setup the 2D video modes of the NDS, as well as to activate or deactivate background layers or scroll them. More...
Functions | |
void | NF_Set2D (int screen, u32 mode) |
Init 2D mode for the selected screen. More... | |
void | NF_ShowBg (int screen, u32 layer) |
Makes the BG of the selected layer and screen visible. More... | |
void | NF_HideBg (int screen, u32 layer) |
Makes the BG of the selected layer and screen invisible. More... | |
void | NF_ScrollBg (int screen, u32 layer, s32 x, s32 y) |
Moves the BG of the selected layer and screen to the specified coordinates. More... | |
void | NF_SpriteFrame (int screen, u32 id, u32 frame) |
Selects which frame of the animation of a sprite is shown. More... | |
void | NF_EnableSpriteRotScale (int screen, u32 sprite, u32 id, bool doublesize) |
Makes a sprite available to be rotated and scaled. More... | |
void | NF_DisableSpriteRotScale (int screen, u32 sprite) |
Disables the rotation and scalation of sprite. More... | |
void | NF_SpriteRotScale (int screen, u8 id, s32 angle, u32 sx, u32 sy) |
Setup the rotation and scalation values of a RotSet. More... | |
Functions to setup the 2D video modes of the NDS, as well as to activate or deactivate background layers or scroll them.
void NF_DisableSpriteRotScale | ( | int | screen, |
u32 | sprite | ||
) |
Disables the rotation and scalation of sprite.
Example:
screen | Screen (0 - 1). |
sprite | Sprite ID (0 - 127). |
void NF_EnableSpriteRotScale | ( | int | screen, |
u32 | sprite, | ||
u32 | id, | ||
bool | doublesize | ||
) |
Makes a sprite available to be rotated and scaled.
You must specify which rotset of the 32 availables will be used by the sprite. Multiple sprites can share the same rotset. If "doublesize" is disabled, the max size for sprites is 32x32. Otherwise the sprite will be clipped.
If you enable RotScale for a sprite the flip states will be ignored.
Example:
screen | Screen (0 - 1). |
sprite | Sprite ID (0 - 127). |
id | RotSet ID (0 - 31). |
doublesize | Set to true to enable double size mode. |
void NF_HideBg | ( | int | screen, |
u32 | layer | ||
) |
Makes the BG of the selected layer and screen invisible.
Example:
screen | Screen (0 - 1). |
layer | Layer (0 - 3). |
void NF_ScrollBg | ( | int | screen, |
u32 | layer, | ||
s32 | x, | ||
s32 | y | ||
) |
Moves the BG of the selected layer and screen to the specified coordinates.
If the map is taller or wider than 512, it must be kept in RAM all the time.
Example:
screen | Screen (0 - 1). |
layer | Layer (0 - 3). |
x | X coordinate. |
y | Y coordinate. |
void NF_Set2D | ( | int | screen, |
u32 | mode | ||
) |
Init 2D mode for the selected screen.
Modes: 0 - Tiled BGs (256 colors). 2 - Affine BGs of 8 bits in layers 2 & 3 5 - Bitmap BGs at 8 or 16 bits.
Example:
screen | Screen (0 - 1). |
mode | Mode (0, 2, 5). |
void NF_ShowBg | ( | int | screen, |
u32 | layer | ||
) |
Makes the BG of the selected layer and screen visible.
Use this command to make visible a BG previously hidden with NF_HideBg().
Example:
screen | Screen (0 - 1). |
layer | Layer (0 - 3). |
void NF_SpriteFrame | ( | int | screen, |
u32 | id, | ||
u32 | frame | ||
) |
Selects which frame of the animation of a sprite is shown.
Example:
screen | Screen (0 - 1). |
id | Sprite ID (0 - 127). |
frame | The frame to show. |
void NF_SpriteRotScale | ( | int | screen, |
u8 | id, | ||
s32 | angle, | ||
u32 | sx, | ||
u32 | sy | ||
) |
Setup the rotation and scalation values of a RotSet.
All sprites assigned to this RotSet will rotate and scale using those values. Rotation angles are in 512 base. This means the rotation will go from -512 to 512 (-360 to 360 degrees). Scale values go from 0 to 512. A 100% scale is 256.
Example:
screen | Screen (0 - 1). |
id | Sprite ID (0 - 127). |
angle | Angle (-512 to 512). |
sx | X scale (0 to 512), 100% = 256. |
sy | Y scale (0 to 512), 100% = 256. |