The variables or functions that you will find here may be defined in the Lua libraries (
libs tag) or in the C code (
nds tag).
-
ULUA_VERSION
ULUA_VERSION* (_nds_): version of Micro Lua (String).
* *
(nds): version of Micro Lua (String). -
SCREEN_WIDTH
SCREEN_WIDTH*, *
, SCREEN_HEIGHT
SCREEN_HEIGHT* (_nds_): width and height of the screens.
* *
(nds): width and height of the screens. -
NB_FPS
NB_FPS* (_libs_): number of frame per second automatically updated every second.
* *
(libs): number of frame per second automatically updated every second. -
SCREEN_UP
SCREEN_UP*, *
, SCREEN_DOWN
SCREEN_DOWN* (_nds_): screen number where to draw. See examples for more details.
* *
(nds): screen number where to draw. See examples for more details. -
RAM
RAM* and *
and VRAM
VRAM* (_nds_): destination where to load some object. See examples for more details.
* *
(nds): destination where to load some object. See examples for more details. -
ATTR_X1
ATTR_X1*, *
, ATTR_Y1
ATTR_Y1*, *
, ATTR_X2
ATTR_X2*, *
, ATTR_Y2
ATTR_Y2*, *
, ATTR_X3
ATTR_X3*, *
, ATTR_Y3
ATTR_Y3*, *
, ATTR_COLOR
ATTR_COLOR*, *
, ATTR_COLOR1
ATTR_COLOR1*, *
, ATTR_COLOR2
ATTR_COLOR2*, *
, ATTR_COLOR3
ATTR_COLOR3*, *
, ATTR_COLOR4
ATTR_COLOR4*, *
, ATTR_TEXT
ATTR_TEXT*, *
, ATTR_VISIBLE
ATTR_VISIBLE*, *
, ATTR_FONT
ATTR_FONT*, *
, ATTR_IMAGE
ATTR_IMAGE* (_nds_): attributes used in canvas.
* *
(nds): attributes used in canvas. -
ALPHA_RESET
ALPHA_RESET* (_nds_): blending coefficient value to reset alpha transparency. Is equal to 100.
* *
(nds): blending coefficient value to reset alpha transparency. Is equal to 100. -
PLAY_LOOP
PLAY_LOOP*, *
, PLAY_ONCE
PLAY_ONCE* (_nds_): arguments to play mods respectively loop and once.
* Path constants (some of them are made up from precedent ones) (_nds_):
* *
(nds): arguments to play mods respectively loop and once. - Path constants (some of them are made up from precedent ones) (nds):
-
ULUA_DIR
ULUA_DIR*: _/lua/_ (main directory of µLua)
* *
: /lua/ (main directory of µLua) -
ULUA_SCRIPTS
ULUA_SCRIPTS*: _ULUA_DIR scripts/_ (default folder for scripts)
* *
: ULUA_DIR scripts/ (default folder for scripts) -
ULUA_LIBS
ULUA_LIBS*: _ULUA_DIR libs/_ (default folder for libraries)
* *
: ULUA_DIR libs/ (default folder for libraries) -
ULUA_BOOT_FILE
ULUA_BOOT_FILE*: _boot.lua_ (first loaded file)
* *
: boot.lua (first loaded file) -
ULUA_BOOT_FULLPATH
ULUA_BOOT_FULLPATH*: _ULUA_DIR ULUA_BOOTFILE_ (full path of the first loaded file)
* *
: ULUA_DIR ULUA_BOOTFILE (full path of the first loaded file)
-
mustCountFPS
mustCountFPS* (_libs_): regulate the FPS couting system. It is an internal variable, you should never have to deal with it.
* *
(libs): regulate the FPS couting system. It is an internal variable, you should never have to deal with it. -
Debug.isDebugOn
Debug.isDebugOn*, *
, Debug.debugText
Debug.debugText* and *
and Debug.debugColor
Debug.debugColor* (_nds_): variables used by the debug system. You should only modify them by using the
(nds): variables used by the debug system. You should only modify them by using the Debug
Debug functions.
== Functions and their table ==
=== Screen ===
*
functions.
Void render()
Void render()* (_libs_)
Refresh the screen.
*
(
libs)
Refresh the screen.
Void startDrawing()
Void startDrawing()* & *
&
Void stopDrawing()
Void stopDrawing()* (_libs_, _deprecated_)
All your drawing instructions must be between these two functions.
*
(
libs,
deprecated)
All your drawing instructions must be between these two functions.
Void screen.switch()
Void screen.switch()* (_nds_)
Switch the screens.
*
(
nds)
Switch the screens.
Number screen.getLayer()
Number screen.getLayer()* (_nds_)
Get the current layer.
*
(
nds)
Get the current layer.
Number screen.getAlphaLevel()
Number screen.getAlphaLevel()* (_nds_)
Get the current transparency level.
*
(
nds)
Get the current transparency level.
Void screen.setAlpha(level[, layer])
Void screen.setAlpha(level[, layer])* (_nds_)
Set the transparency level for the given layer.
* *level* (Number) : blending coefficient, between 0 and 99 (100, that is to say ALPHA_RESET, reset all the transparency system)
* *layer* (Number) : layer to set ; the function automatically keeps the count
*
(
nds)
Set the transparency level for the given layer.
- level (Number) : blending coefficient, between 0 and 99 (100, that is to say ALPHA_RESET, reset all the transparency system)
- layer (Number) : layer to set ; the function automatically keeps the count
Void screen.print(screen, x, y, text [, color])
Void screen.print(screen, x, y, text [, color])* (_nds_)
Print a text on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Print a text on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x* (Number): x-coordinate where to draw
* *y* (Number): y-coordinate where to draw
* *text* (String): text to print
* *color* (Color): color of the text
*
) - x (Number): x-coordinate where to draw
- y (Number): y-coordinate where to draw
- text (String): text to print
- color (Color): color of the text
Void screen.printFont(screen, x, y, text , color, font)
Void screen.printFont(screen, x, y, text , color, font)* (_nds_)
Print a text on the screen using a special font.
* *screen* (Number): screen where to draw (
(
nds)
Print a text on the screen using a special font.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x* (Number): x-coordinate where to draw
* *y* (Number): y-coordinate where to draw
* *text* (String): text to print
* *color* (Color): color of the text
* *font* (Font) : special font
*
) - x (Number): x-coordinate where to draw
- y (Number): y-coordinate where to draw
- text (String): text to print
- color (Color): color of the text
- font (Font) : special font
Void screen.blit(screen, x, y, image, [, sourcex, sourcey] [, width, height])
Void screen.blit(screen, x, y, image, [, sourcex, sourcey] [, width, height])* (_nds_)
Blit an image on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Blit an image on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x* (Number): x-coordinate where to draw
* *y* (Number): y-coordinate where to draw
* *image* (Image): image to blit
* *sourcex*, *sourcey* (Number): coordinates in the source image to draw
* *width*, *height* (Number): width and height of the rectangle to draw
*
) - x (Number): x-coordinate where to draw
- y (Number): y-coordinate where to draw
- image (Image): image to blit
- sourcex, sourcey (Number): coordinates in the source image to draw
- width, height (Number): width and height of the rectangle to draw
Void screen.drawPoint(screen, x, y, color)
Void screen.drawPoint(screen, x, y, color)* (_nds_)
Draw a point on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a point on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x* (Number): x-coordinate where to draw
* *y* (Number): y-coordinate where to draw
* *color* (Color): color of the point
*
) - x (Number): x-coordinate where to draw
- y (Number): y-coordinate where to draw
- color (Color): color of the point
Void screen.drawLine(screen, x0, y0, x1, y1, color)
Void screen.drawLine(screen, x0, y0, x1, y1, color)* (_nds_)
Draw a line on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a line on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1* (Number): coordinates of the line
* *color* (Color): color of the line
*
) - x0, y0, x1, y1 (Number): coordinates of the line
- color (Color): color of the line
Void screen.drawRect(screen, x0, y0, x1, y1, color)
Void screen.drawRect(screen, x0, y0, x1, y1, color)* (_nds_)
Draw a rectangle on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a rectangle on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1* (Number): coordinates of the rectangle
* *color* (Color): color of the rectangle
*
) - x0, y0, x1, y1 (Number): coordinates of the rectangle
- color (Color): color of the rectangle
Void screen.drawFillRect(screen, x0, y0, x1, y1, color)
Void screen.drawFillRect(screen, x0, y0, x1, y1, color)* (_nds_)
Draw a fill rectangle on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a fill rectangle on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1* (Number): coordinates of the rectangle
* *color* (Color): color of the rectangle
*
) - x0, y0, x1, y1 (Number): coordinates of the rectangle
- color (Color): color of the rectangle
Void screen.drawGradientRect(screen, x0, y0, x1, y1, color1, color2, color3, color4)
Void screen.drawGradientRect(screen, x0, y0, x1, y1, color1, color2, color3, color4)* (_nds_)
Draw a gradient rectangle on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a gradient rectangle on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1* (Number): coordinates of the rectangle
* *color1*, *color2*, *color3*, *color4* (Color): colors of the rectangle
*
) - x0, y0, x1, y1 (Number): coordinates of the rectangle
- color1, color2, color3, color4 (Color): colors of the rectangle
Void screen.drawTextBox(screen, x0, y0, x1, y1, text [, color])
Void screen.drawTextBox(screen, x0, y0, x1, y1, text [, color])* (_nds_)
Draw a text box on the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a text box on the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1* (Number): coordinates of the text box
* *text* (String): text to print
* *color* (Color): color of the text box
*
) - x0, y0, x1, y1 (Number): coordinates of the text box
- text (String): text to print
- color (Color): color of the text box
Void screen.drawTexturedQuad(screen, x0, y0, x1, y1, x2, y2, x3, y3, texture[, sourceX, sourceY][, width, height])
Void screen.drawTexturedQuad(screen, x0, y0, x1, y1, x2, y2, x3, y3, texture[, sourceX, sourceY][, width, height])* (_nds_)
Display a textured quadrilateral.
* *screen* (Number): screen where to draw (
(
nds)
Display a textured quadrilateral.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1*... (Number): coordinates of the quadrilateral angles
* *texture* (Image) : texture image
* *sourcex*, *sourcey* (Number): coordinates in the texture image to draw
* *width*, *height* (Number): width and height of the texture image piece to draw
*
) - x0, y0, x1, y1... (Number): coordinates of the quadrilateral angles
- texture (Image) : texture image
- sourcex, sourcey (Number): coordinates in the texture image to draw
- width, height (Number): width and height of the texture image piece to draw
Void screen.drawTexturedQuad(screen, x0, y0, x1, y1, x2, y2, texture[, sourceX, sourceY][, width, height])
Void screen.drawTexturedQuad(screen, x0, y0, x1, y1, x2, y2, texture[, sourceX, sourceY][, width, height])* (_nds_)
Display a textured triangle.
* *screen* (Number): screen where to draw (
(
nds)
Display a textured triangle.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x0*, *y0*, *x1*, *y1*... (Number): coordinates of the triangle angles
* *texture* (Image) : texture image
* *sourcex*, *sourcey* (Number): coordinates in the texture image to draw
* *width*, *height* (Number): width and height of the texture image piece to draw
*
) - x0, y0, x1, y1... (Number): coordinates of the triangle angles
- texture (Image) : texture image
- sourcex, sourcey (Number): coordinates in the texture image to draw
- width, height (Number): width and height of the texture image piece to draw
Boolean screen.getMainLcd()
Boolean screen.getMainLcd()* (_nds_)
Give the screen uLibrary is drawing on (
(
nds)
Give the screen uLibrary is drawing on (
true
true
for upper screen,
for upper screen,
false
false
for the lower screen).
*
for the lower screen).
Void screen.setSpaceBetweenScreens(space)
Void screen.setSpaceBetweenScreens(space)* (_nds_, _deprecated_ (you can no longer draw on the two screens at the same time))
Set the space between the screens (so some drawing will not be displayed if drawn in this space).
* *space* (Number): space (in pixels) between the screens
*
(
nds,
deprecated (you can no longer draw on the two screens at the same time))
Set the space between the screens (so some drawing will not be displayed if drawn in this space).
- space (Number): space (in pixels) between the screens
Void screen.init()
Void screen.init()* (_nds_)
Initialise some stuff about the screens. It is done automatically, so you should have nothing to care about this.
*
(
nds)
Initialise some stuff about the screens. It is done automatically, so you should have nothing to care about this.
Void screen.startDrawing2D()
Void screen.startDrawing2D()* (_nds_)
Start a new drawing and configure 2D. You should have nothing to care about this.
*
(
nds)
Start a new drawing and configure 2D. You should have nothing to care about this.
Void screen.endDrawing()
Void screen.endDrawing()* (_nds_)
End drawing. You will never need to use it (use
(
nds)
End drawing. You will never need to use it (use
render()
render()
to command screens actualisation).
*
to command screens actualisation).
Void screen.waitForVBL()
Void screen.waitForVBL()* (_nds_)
Wait for the VBlank period to reach 60FPS. You will never need to use it (using
(
nds)
Wait for the VBlank period to reach 60FPS. You will never need to use it (using
render()
render()
will synchronise the frames).
=== Colors ===
*
will synchronise the frames).
Color Color.new(r, g, b)
Color Color.new(r, g, b)* (_nds_)
Create a new color.
* *r* (Number): red mask (from 0 to 31)
* *g* (Number): green mask (from 0 to 31)
* *b* (Number): blue mask (from 0 to 31)
*
(
nds)
Create a new color.
- r (Number): red mask (from 0 to 31)
- g (Number): green mask (from 0 to 31)
- b (Number): blue mask (from 0 to 31)
Color Color.new256(r, g, b)
Color Color.new256(r, g, b)* (_nds_)
Create a new color from 8bit values.
* *r* (Number): red mask (from 0 to 255)
* *g* (Number): green mask (from 0 to 255)
* *b* (Number): blue mask (from 0 to 255)
=== Controls ===
*
(
nds)
Create a new color from 8bit values.
- r (Number): red mask (from 0 to 255)
- g (Number): green mask (from 0 to 255)
- b (Number): blue mask (from 0 to 255)
Void Controls.read()
Void Controls.read()* (_nds_)
Read the controls and update all control structures.
*
(
nds)
Read the controls and update all control structures.
Void Controls.setStylusDblcFreq(dblcFreq)
Void Controls.setStylusDblcFreq(dblcFreq)* (_nds_)
Set the maximum delay between two Stylus clicks to make it a double click.
* *dblcFreq* (Number): maximum delay (from 0 to 30, 30 being half a second and the default value)
==== Stylus ====
These are numbers or booleans. Everything here is defined in the _nds_.
*
(
nds)
Set the maximum delay between two Stylus clicks to make it a double click.
- dblcFreq (Number): maximum delay (from 0 to 30, 30 being half a second and the default value)
These are numbers or booleans. Everything here is defined in the
nds.
Stylus.X
Stylus.X*: x-coordinate of the stylus
*
: x-coordinate of the stylus
Stylus.Y
Stylus.Y*: y-coordinate of the stylus
*
: y-coordinate of the stylus
Stylus.held
Stylus.held*: is the stylus held on the screen
*
: is the stylus held on the screen
Stylus.released
Stylus.released*: is the stylus released
*
: is the stylus released
Stylus.doubleClick
Stylus.doubleClick:
: true
true* if stylus do a double click
*
if stylus do a double click
Stylus.deltaX
Stylus.deltaX*: delta x of the stylus movement
*
: delta x of the stylus movement
Stylus.deltaY
Stylus.deltaY*: delta y of the stylus movement
*
: delta y of the stylus movement
Stylus.newPress
Stylus.newPress:
: true
true* if stylus do a new press
==== Keys ====
These are booleans. Everything here is defined in the _nds_.
(
if stylus do a new press
These are booleans. Everything here is defined in the
nds.
(
[KEY]
KEY can take the following values :
*
can take the following values :
A
A,
, B
B,
, X
X,
, Y
Y,
, L
L,
, R
R,
, Start
Start,
, Select
Select,
, Up
Up,
, Down
Down,
, Left
Left,
, Right
Right*)
*
)
Keys.held.[KEY]
Keys.held.KEY*: is the key held?
*
: is the key held?
Keys.released.[KEY]
Keys.released.KEY*: is the key released?
*
: is the key released?
Keys.newPress.[KEY]
Keys.newPress.KEY:
: true
true* if the key does a new press
=== Images ===
*
if the key does a new press
Image Image.load(path, destination)
Image Image.load(path, destination)* (_nds_)
Create a new image in memory from an image file (PNG, JPG or GIF).
* *path* (String): path of the image to load
* *destination* (Number): destination of the image in memory (can be RAM of VRAM)
*
(
nds)
Create a new image in memory from an image file (PNG, JPG or GIF).
- path (String): path of the image to load
- destination (Number): destination of the image in memory (can be RAM of VRAM)
Void Image.destroy(image)
Void Image.destroy(image)* (_nds_)
Destroy the image.
* *image* (Image): image to destroy
To completely destroy an image, do:
{{{
myImage:destroy()
myImage = nil
}}}
*
(
nds)
Destroy the image.
- image (Image): image to destroy
To completely destroy an image, do:
myImage:destroy()
myImage = nil
myImage:destroy()
myImage = nil
}}}
Number Image.width(image)
Number Image.width(image)* (_nds_)
Get the width of the image.
* *image* (Image): image to use
*
(
nds)
Get the width of the image.
- image (Image): image to use
Number Image.height(image)
Number Image.height(image)* (_nds_)
Get the height of the image.
* *image* (Image): image to use
*
(
nds)
Get the height of the image.
- image (Image): image to use
Void Image.scale(image, width, height)
Void Image.scale(image, width, height)* (_nds_)
Scale the image.
* *image* (Image): image to scale
* *width* (Number): new width of the image
* *height* (Number): new height of the image
*
(
nds)
Scale the image.
- image (Image): image to scale
- width (Number): new width of the image
- height (Number): new height of the image
Void Image.rotate(image, angle [, centerx, centery])
Void Image.rotate(image, angle [, centerx, centery])* (_nds_)
Rotate the image around rotation center.
* *image* (Image): image to rotate
* *angle* (Number): angle of roattion (between 0 and 511)
* *centerx* (Number): x-coordinate of the new rotation center
* *centery* (Number): y-coordinate of the new rotation center
*
(
nds)
Rotate the image around rotation center.
- image (Image): image to rotate
- angle (Number): angle of roattion (between 0 and 511)
- centerx (Number): x-coordinate of the new rotation center
- centery (Number): y-coordinate of the new rotation center
Void Image.rotateDegree(image, angle [, centerx, centery])
Void Image.rotateDegree(image, angle [, centerx, centery])* (_nds_)
Rotate the image around rotation center, the angle is given in degree.
* *image* (Image): image to rotate
* *angle* (Number): angle of rotation in degree (between 0 and 360)
* *centerx* (Number): x-coordinate of the new rotation center
* *centery* (Number): y-coordinate of the new rotation center
*
(
nds)
Rotate the image around rotation center, the angle is given in degree.
- image (Image): image to rotate
- angle (Number): angle of rotation in degree (between 0 and 360)
- centerx (Number): x-coordinate of the new rotation center
- centery (Number): y-coordinate of the new rotation center
Void Image.mirrorH(image, activate)
Void Image.mirrorH(image, activate)* (_nds_)
Mirror the image horizontally.
* *image* (Image): image to mirror
* *activate* (Boolean):
(
nds)
Mirror the image horizontally.
- image (Image): image to mirror
- activate (Boolean):
true
true to activate the mirroring,
to activate the mirroring, false
false to cancel the transformation
*
to cancel the transformation
Void Image.mirrorV(image, activate)
Void Image.mirrorV(image, activate)* (_nds_)
Mirror the image vertically.
* *image* (Image): image to mirror
* *activate* (Boolean):
(
nds)
Mirror the image vertically.
- image (Image): image to mirror
- activate (Boolean):
true
true to activate the mirroring,
to activate the mirroring, false
false to cancel the transformation
*
to cancel the transformation
Void Image.setTint(image, color)
Void Image.setTint(image, color)* (_nds_)
Set the tint of the image.
* *image* (Image): image to tint
* *color* (Color): color of the image
=== Timers ===
The unit is the millisecond.
*
(
nds)
Set the tint of the image.
- image (Image): image to tint
- color (Color): color of the image
The unit is the millisecond.
Timer Timer.new()
Timer Timer.new()* (_libs_)
Create a new timer, you can start it.
*
(
libs)
Create a new timer, you can start it.
Number timer:time()
Number timer:time()* (_libs_)
Return the time of the timer.
*
(
libs)
Return the time of the timer.
Void timer:start()
Void timer:start()* (_libs_)
Start a timer.
*
(
libs)
Start a timer.
Void timer:stop()
Void timer:stop()* (_libs_)
Stop a timer.
*
(
libs)
Stop a timer.
Void timer:reset()
Void timer:reset()* (_libs_)
Reset a timer.
=== Sprites ===
*
(
libs)
Reset a timer.
Sprite Sprite.new(path, frameWidth, frameHeight, dest)
Sprite Sprite.new(path, frameWidth, frameHeight, dest)* (_libs_)
Create a sprite from an image file.
* *path* (String): path of the file which contains the sprite
* *frameWidth* (Number): width of the frames
* *frameHeight* (Number): height of the frames
* *dest* (Number): destination (RAM or VRAM)
*
(
libs)
Create a sprite from an image file.
- path (String): path of the file which contains the sprite
- frameWidth (Number): width of the frames
- frameHeight (Number): height of the frames
- dest (Number): destination (RAM or VRAM)
Void sprite:drawFrame(screen, x, y, nbFrame)
Void sprite:drawFrame(screen, x, y, nbFrame)* (_libs_)
Draw a frame of the sprite.
* *screen* (Number): screen (
(
libs)
Draw a frame of the sprite.
- screen (Number): screen (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x* (Number): X-coordinate where to draw the frame
* *y* (Number): Y-coordinate where to draw the frame
* *nbFrame* (Number): number of the frame to draw
*
) - x (Number): X-coordinate where to draw the frame
- y (Number): Y-coordinate where to draw the frame
- nbFrame (Number): number of the frame to draw
Void sprite:addAnimation(tabAnim, delay)
Void sprite:addAnimation(tabAnim, delay)* (_libs_)
Create an animation.
* *tabAnim* (Table): the table of the animation frames
* *delay* (Number): delay between each frame
*
(
libs)
Create an animation.
- tabAnim (Table): the table of the animation frames
- delay (Number): delay between each frame
Void sprite:playAnimation(screen, x, y, nbAnim)
Void sprite:playAnimation(screen, x, y, nbAnim)* (_libs_)
Play an animation on the screen.
* *screen* (Number): screen (
(
libs)
Play an animation on the screen.
- screen (Number): screen (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *x* (Number): X-coordinate where to draw the frame
* *y* (Number): Y-coordinate where to draw the frame
* *nbAnim* (Number): number of the animation to play
*
) - x (Number): X-coordinate where to draw the frame
- y (Number): Y-coordinate where to draw the frame
- nbAnim (Number): number of the animation to play
Void sprite:resetAnimation(nbAnim)
Void sprite:resetAnimation(nbAnim)* (_libs_)
Reset an animation.
* *nbAnim* (Number): number of the animation
*
(
libs)
Reset an animation.
- nbAnim (Number): number of the animation
Void sprite:startAnimation(nbAnim)
Void sprite:startAnimation(nbAnim)* (_libs_)
Start an animation.
* *nbAnim* (Number): number of the animation
*
(
libs)
Start an animation.
- nbAnim (Number): number of the animation
Void sprite:stopAnimation(nbAnim)
Void sprite:stopAnimation(nbAnim)* (_libs_)
Stop an animation.
* *nbAnim* (Number): number of the animation
*
(
libs)
Stop an animation.
- nbAnim (Number): number of the animation
Boolean sprite:isAnimationAtEnd(nbAnim)
Boolean sprite:isAnimationAtEnd(nbAnim)* (_libs_)
Return
(
libs)
Return
true
true
if the animation has drawn the last frame.
* *nbAnim* (Number): number of the animation
*
if the animation has drawn the last frame.
- nbAnim (Number): number of the animation
Table SpriteAnimation.new(tabAnim, delay)
Table SpriteAnimation.new(tabAnim, delay)* (_nds_)
Create a new sprite animation. You don't have to use it, use
(
nds)
Create a new sprite animation. You don't have to use it, use
sprite:addAnimation()
sprite:addAnimation()
instead.
* *tabAnim* (Table): table containing the animation frames
* *delay* (Number): delay between each frame
=== Debug ===
*
instead.
- tabAnim (Table): table containing the animation frames
- delay (Number): delay between each frame
Void Debug.ON()
Void Debug.ON()* (_libs_)
Activate the debug mode.
*
(
libs)
Activate the debug mode.
Void Debug.OFF()
Void Debug.OFF()* (_libs_)
Desactivate the debug mode.
*
(
libs)
Desactivate the debug mode.
Void Debug.print(text)
Void Debug.print(text)* (_libs_)
Print a debug line.
* *text* (String): text to print
*
(
libs)
Print a debug line.
- text (String): text to print
Void Debug.clear()
Void Debug.clear()* (_libs_)
Clear the debug console.
*
(
libs)
Clear the debug console.
Void Debug.setColor(color)
Void Debug.setColor(color)* (_libs_)
Set the debug text color.
* *color* (Color): color of the text
=== System ===
*
(
libs)
Set the debug text color.
- color (Color): color of the text
String System.currentDirectory()
String System.currentDirectory()* (_nds_)
Get the current working directory.
*
(
nds)
Get the current working directory.
Void System.changeDirectory(path)
Void System.changeDirectory(path)* (_nds_)
Change the current working directory.
* *path* (String): path of the directory
*
(
nds)
Change the current working directory.
- path (String): path of the directory
Void System.remove(name)
Void System.remove(name)* (_nds_)
Remove a file or an empty folder.
* *name* (String): name of the file or directory to remove
*
(
nds)
Remove a file or an empty folder.
- name (String): name of the file or directory to remove
Void System.rename(oldName, newName)
Void System.rename(oldName, newName)* (_nds_)
Rename file or an empty folder.
* *oldName* (String): name of the file or directory to rename
* *newName* (String): new name of the file or directory
*
(
nds)
Rename file or an empty folder.
- oldName (String): name of the file or directory to rename
- newName (String): new name of the file or directory
Void System.makeDirectory(name)
Void System.makeDirectory(name)* (_nds_)
Create a new directory.
* *name* (String): path and name of the directory
*
(
nds)
Create a new directory.
- name (String): path and name of the directory
Table System.listDirectory(path)
Table System.listDirectory(path)* (_nds_)
List all files and folders of a directory.
* *path* (String): path of the directory to list
*NOTE*: See examples for more details.
*
(
nds)
List all files and folders of a directory.
- path (String): path of the directory to list
NOTE: See examples for more details.
Number System.CurrentVramUsed()
Number System.CurrentVramUsed()* (_nds_)
Give the current amount of used VRAM (seems to return some weird number).
*
(
nds)
Give the current amount of used VRAM (seems to return some weird number).
Number System.CurrentVramFree()
Number System.CurrentVramFree()* (_nds_)
Give the current amount of free VRAM.
*
(
nds)
Give the current amount of free VRAM.
Number System.CurrentPalUsed()
Number System.CurrentPalUsed()* (_nds_)
Give the current amount of used palette memory (seems to return some weird number).
*
(
nds)
Give the current amount of used palette memory (seems to return some weird number).
Number System.CurrentPalFree()
Number System.CurrentPalFree()* (_nds_)
Give the current amount of free palette memory.
=== Fonts ===
*
(
nds)
Give the current amount of free palette memory.
Font Font.load(path)
Font Font.load(path)* (_nds_)
Create a new font from a font file (oslib and µLibrary format).
* *path* (String): path of the file to load
*
(
nds)
Create a new font from a font file (oslib and µLibrary format).
- path (String): path of the file to load
Void Font.destroy(font)
Void Font.destroy(font)* (_nds_)
Destroy the font.
* *font* (Font): font to destroy
To completely destroy a font, do:
{{{
Font.destroy(font)
font = nil
}}}
*
(
nds)
Destroy the font.
- font (Font): font to destroy
To completely destroy a font, do:
Font.destroy(font)
font = nil
Font.destroy(font)
font = nil
}}}
Number Font.getCharHeight(font)
Number Font.getCharHeight(font)* (_nds_)
Get the height of the characters of a font.
* *font* (Font): font to use
*
(
nds)
Get the height of the characters of a font.
Number getStringWidth(font, text)
Number getStringWidth(font, text)* (_nds_)
Get the width of a text with a specific font.
* *font* (Font): font to use
* *text* (String): text
=== Maps ===
*
(
nds)
Get the width of a text with a specific font.
- font (Font): font to use
- text (String): text
Map Map.new(image, mapfile, width, height, tileWidth, tileHeight)
Map Map.new(image, mapfile, width, height, tileWidth, tileHeight)* (_nds_)
Create a new map by giving a map file.
* *image* (Image): image which contains tiles
* *mapfile* (String): path to the map file (
(
nds)
Create a new map by giving a map file.
- image (Image): image which contains tiles
- mapfile (String): path to the map file (
.map
.map)
* *width* (Number): width of the map in tiles
* *height* (Number): height of the map in tiles
* *tileWidth* (Number): width of the tiles in pixels
* *tileHeight* (Number): height of the tiles in pixels
*
) - width (Number): width of the map in tiles
- height (Number): height of the map in tiles
- tileWidth (Number): width of the tiles in pixels
- tileHeight (Number): height of the tiles in pixels
Void Map.destroy(map)
Void Map.destroy(map)* (_nds_)
Destroy a map.
* *map* (Map): map to destroy
*
(
nds)
Destroy a map.
- map (Map): map to destroy
Void Map.draw(screen, map, x, y, width, height)
Void Map.draw(screen, map, x, y, width, height)* (_nds_)
Draw a map.
* *screen* (Number): screen where to draw (
(
nds)
Draw a map.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *map* (Map): map to destroy
* *x* (Number): x-coordinate where to draw the map
* *y* (Number): y-coordinate where to draw the map
* *width* (Number): x number of tiles to draw
* *height* (Number): y number of tiles to draw
*
) - map (Map): map to destroy
- x (Number): x-coordinate where to draw the map
- y (Number): y-coordinate where to draw the map
- width (Number): x number of tiles to draw
- height (Number): y number of tiles to draw
Void Map.scroll(map, x, y)
Void Map.scroll(map, x, y)* (_nds_)
Scroll a map.
* *map* (Map): map to scroll
* *x* (Number): x number of tiles to scroll
* *y* (Number): y number of tiles to scroll
*
(
nds)
Scroll a map.
- map (Map): map to scroll
- x (Number): x number of tiles to scroll
- y (Number): y number of tiles to scroll
Void Map.space(map, x, y)
Void Map.space(map, x, y)* (_nds_)
Set the space between each tiles of a map.
* *map* (Map): map to modify
* *x* (Number): x space between tiles
* *y* (Number): y space between tiles
*
(
nds)
Set the space between each tiles of a map.
- map (Map): map to modify
- x (Number): x space between tiles
- y (Number): y space between tiles
Void Map.setTile(map, x, y, tile)
Void Map.setTile(map, x, y, tile)* (_nds_)
Change a tile value.
* *map* (Map): map to modify
* *x* (Number): x-coordinate of the tile to change in the map table
* *y* (Number): y-coordinate of the tile to change in the map table
* *tile* (Number): new tile value
*
(
nds)
Change a tile value.
- map (Map): map to modify
- x (Number): x-coordinate of the tile to change in the map table
- y (Number): y-coordinate of the tile to change in the map table
- tile (Number): new tile value
Number Map.getTile(map, x, y)
Number Map.getTile(map, x, y)* (_nds_)
Get a tile value.
* *map* (Map): map to read
* *x* (Number): x-coordinate of the tile to get
* *y* (Number): y-coordinate of the tile to get
=== Scroll Maps ===
*
(
nds)
Get a tile value.
- map (Map): map to read
- x (Number): x-coordinate of the tile to get
- y (Number): y-coordinate of the tile to get
ScrollMap ScrollMap.new(image, mapfile, width, height, tileWidth, tileHeight)
ScrollMap ScrollMap.new(image, mapfile, width, height, tileWidth, tileHeight)* (_nds_)
Create a new ScrollMap by giving a map file.
* *image* (Image): image which contains tiles
* *mapfile* (String): path to the map file (.map)
* *width* (Number): width of the map in tiles
* *height* (Number): height of the map in tiles
* *tileWidth* (Number): width of the tiles in pixels
* *tileHeight* (Number): height of the tiles in pixels
*
(
nds)
Create a new
ScrollMap by giving a map file.
- image (Image): image which contains tiles
- mapfile (String): path to the map file (.map)
- width (Number): width of the map in tiles
- height (Number): height of the map in tiles
- tileWidth (Number): width of the tiles in pixels
- tileHeight (Number): height of the tiles in pixels
Void ScrollMap.destroy(scrollmap)
Void ScrollMap.destroy(scrollmap)* (_nds_)
Destroy a ScrollMap.
* *scrollmap* (ScrollMap): ScrollMap to destroy
*
(
nds)
Destroy a
ScrollMap.
Void ScrollMap.draw(screen, scrollmap)
Void ScrollMap.draw(screen, scrollmap)* (_nds_)
Draw a ScrollMap.
* *screen* (Number): screen where to draw (
(
nds)
Draw a
ScrollMap.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *scrollmap* (ScrollMap): ScrollMap to draw
*
) - scrollmap (ScrollMap): ScrollMap to draw
Void ScrollMap.scroll(scrollmap, x, y)
Void ScrollMap.scroll(scrollmap, x, y)* (_nds_)
Scroll a ScrollMap.
* *scrollmap* (ScrollMap): ScrollMap to scroll
* *x* (Number): x-coordinate of the upper-left corner of the map (can be a negative value)
* *y* (Number): y-coordinate of the upper-left corner of the map (can be a negative value)
*
(
nds)
Scroll a
ScrollMap.
- scrollmap (ScrollMap): ScrollMap to scroll
- x (Number): x-coordinate of the upper-left corner of the map (can be a negative value)
- y (Number): y-coordinate of the upper-left corner of the map (can be a negative value)
Void ScrollMap.setTile(scrollmap, x, y, tile)
Void ScrollMap.setTile(scrollmap, x, y, tile)* (_nds_)
Change a tile value.
* *scrollmap* (ScrollMap): ScrollMap to modify
* *x* (Number): x-coordinate of the tile to change in the scrollmap table
* *y* (Number): y-coordinate of the tile to change in the scrollmap table
* *tile* (Number): new tile value
*
(
nds)
Change a tile value.
- scrollmap (ScrollMap): ScrollMap to modify
- x (Number): x-coordinate of the tile to change in the scrollmap table
- y (Number): y-coordinate of the tile to change in the scrollmap table
- tile (Number): new tile value
Number ScrollMap.getTile(scrollmap, x, y)
Number ScrollMap.getTile(scrollmap, x, y)* (_nds_)
Get a tile value.
* *scrollmap* (ScrollMap): ScrollMap to read
* *x* (Number): x-coordinate of the tile to get
* *y* (Number): y-coordinate of the tile to get
=== Canvas ===
*
(
nds)
Get a tile value.
- scrollmap (ScrollMap): ScrollMap to read
- x (Number): x-coordinate of the tile to get
- y (Number): y-coordinate of the tile to get
Canvas Canvas.new()
Canvas Canvas.new()* (_nds_)
Create a new canvas.
*
(
nds)
Create a new canvas.
Void Canvas.destroy(canvas)
Void Canvas.destroy(canvas)* (_nds_)
Destroy a canvas. Must be followed by
(
nds)
Destroy a canvas. Must be followed by
canvas = nil
canvas = nil
.
* *Canvas* (Canvas): canvas to destroy
*
.
- Canvas (Canvas): canvas to destroy
CanvasObject Canvas.newLine(x1, y1, x2, y2, color)
CanvasObject Canvas.newLine(x1, y1, x2, y2, color)* (_nds_)
Create a new line.
* *x1*, *y1*, *x2*, *y2* (Number): coordinates of the line
* *color* (Color): color of the line
*
(
nds)
Create a new line.
- x1, y1, x2, y2 (Number): coordinates of the line
- color (Color): color of the line
CanvasObject Canvas.newPoint(x1, y1, color)
CanvasObject Canvas.newPoint(x1, y1, color)* (_nds_)
Create a new point.
* *x1*, *y1* (Number): coordinates of the point
* *color* (Color): color of the point
*
(
nds)
Create a new point.
- x1, y1 (Number): coordinates of the point
- color (Color): color of the point
CanvasObject Canvas.newRect(x1, y1, x2, y2, color)
CanvasObject Canvas.newRect(x1, y1, x2, y2, color)* (_nds_)
Create a new rectangle.
* *x1*, *y1*, *x2*, *y2* (Number): coordinates of the rectangle
* *color* (Color): color of the rectangle
*
(
nds)
Create a new rectangle.
- x1, y1, x2, y2 (Number): coordinates of the rectangle
- color (Color): color of the rectangle
CanvasObject Canvas.newFillRect(x1, y1, x2, y2, color)
CanvasObject Canvas.newFillRect(x1, y1, x2, y2, color)* (_nds_)
Create a new fill rectangle.
* *x1*, *y1*, *x2*, *y2* (Number): coordinates of the rectangle
* *color* (Color): color of the rectangle
*
(
nds)
Create a new fill rectangle.
- x1, y1, x2, y2 (Number): coordinates of the rectangle
- color (Color): color of the rectangle
CanvasObject Canvas.newGradientRect(x1, y1, x2, y2, color1, color2, color3, color4)
CanvasObject Canvas.newGradientRect(x1, y1, x2, y2, color1, color2, color3, color4)* (_nds_)
Create a new gradient rectangle.
* *x1*, *y1*, *x2*, *y2* (Number): coordinates of the rectangle
* *color1*, *color2*, *color3*, *color4* (Color): colors of the fill rectangle
*
(
nds)
Create a new gradient rectangle.
- x1, y1, x2, y2 (Number): coordinates of the rectangle
- color1, color2, color3, color4 (Color): colors of the fill rectangle
CanvasObject Canvas.newText(x1, y1, text [, color])
CanvasObject Canvas.newText(x1, y1, text [, color])* (_nds_)
Create a new text.
* *x1*, *y1* (Number): coordinates of the text
* *text* (String): text
* *color* (Color): color of the text
*
(
nds)
Create a new text.
- x1, y1 (Number): coordinates of the text
- text (String): text
- color (Color): color of the text
CanvasObject Canvas.newTextFont(x1, y1, text, color, font)
CanvasObject Canvas.newTextFont(x1, y1, text, color, font)* (_nds_)
Create a new text with a special font.
* *x1*, *y1* (Number): coordinates of the text
* *text* (String): text
* *color* (Color): color of the text
* *font* (Font): special font of the text
*
(
nds)
Create a new text with a special font.
- x1, y1 (Number): coordinates of the text
- text (String): text
- color (Color): color of the text
- font (Font): special font of the text
CanvasObject Canvas.newTextBox(x1, y1, x2, y2, text [, color])
CanvasObject Canvas.newTextBox(x1, y1, x2, y2, text [, color])* (_nds_)
Create a new textbox.
* *x1*, *y1*, *x2*, *y2* (Number): coordinates of the textbox
* *text* (String): text
* *color* (Color): color of the textbox
*
(
nds)
Create a new textbox.
- x1, y1, x2, y2 (Number): coordinates of the textbox
- text (String): text
- color (Color): color of the textbox
CanvasObject Canvas.newImage(x1, y1, image [, x2, y2] [, x3, y3])
CanvasObject Canvas.newImage(x1, y1, image [, x2, y2] [, x3, y3])* (_nds_)
Create a new image.
* *x1*, *y1* (Number): coordinates of the image
* *x2*, *y2* (Number): coordinates in the source image to draw
* *x3*, *y3* (Number): width and height of the rectangle to draw
*
(
nds)
Create a new image.
- x1, y1 (Number): coordinates of the image
- x2, y2 (Number): coordinates in the source image to draw
- x3, y3 (Number): width and height of the rectangle to draw
Void Canvas.add(canvas, object)
Void Canvas.add(canvas, object)* (_nds_)
Add a CanvasObject in a canvas.
* *canvas* (Canvas): canvas to draw
* *object* (CanvasObject): object to add
*
(
nds)
Add a CanvasObject in a canvas.
- canvas (Canvas): canvas to draw
- object (CanvasObject): object to add
Void Canvas.draw(screen, canvas, x, y)
Void Canvas.draw(screen, canvas, x, y)* (_nds_)
Draw a canvas to the screen.
* *screen* (Number): screen where to draw (
(
nds)
Draw a canvas to the screen.
- screen (Number): screen where to draw (
SCREEN_UP
SCREEN_UP or
or SCREEN_DOWN
SCREEN_DOWN)
* *canvas* (Canvas): canvas to draw
* *x* (Number): x-coordinate where to draw
* *y* (Number): y-coordinate where to draw
*
) - canvas (Canvas): canvas to draw
- x (Number): x-coordinate where to draw
- y (Number): y-coordinate where to draw
Void Canvas.setAttr(object, attrName, attrValue)
Void Canvas.setAttr(object, attrName, attrValue)* (_nds_)
Set an attribute value.
* *object* (CanvasObject): object to modify
* *attName* (Constant): attribute to modify. Must be ATTR_XXX. See “some useful variables” for more details
* *attrValue* (?): new value for the attribute. Must be the good type
*
(
nds)
Set an attribute value.
- object (CanvasObject): object to modify
- attName (Constant): attribute to modify. Must be ATTR_XXX. See “some useful variables” for more details
- attrValue (?): new value for the attribute. Must be the good type
? Canvas.getAttr(object, attrName)
? Canvas.getAttr(object, attrName)* (_nds_)
Get an attribute value. Return type depends of the attribute (number, font or image).
* *object* (CanvasObject): object to use
* *attName* (Constant | Number): attribute to get value. Must be ATTR_XXX. See “some useful variables” for more details
*
(
nds)
Get an attribute value. Return type depends of the attribute (number, font or image).
- object (CanvasObject): object to use
- attName (Constant | Number): attribute to get value. Must be ATTR_XXX. See “some useful variables” for more details
Void Canvas.setObjOnTop(canvas, object)
Void Canvas.setObjOnTop(canvas, object)* (_nds_)
Make a CanvasObject on the first plan of a Canvas.
* *canvas* (Canvas) : Canvas in which we work.
* *object* (CanvasObject) : Object that we want to set on Top.
*
(
nds)
Make a CanvasObject on the first plan of a Canvas.
- canvas (Canvas) : Canvas in which we work.
- object (CanvasObject) : Object that we want to set on Top.
Void Canvas.removeObj(canvas, object)
Void Canvas.removeObj(canvas, object)* (_nds_)
Delete an CanvasObject in a Canvas.
* *canvas* (Canvas) : Canvas in which we want to delete an Object.
* *object* (CanvasObject) : Object that we want to delete.
=== Rumble ===
*
(
nds)
Delete an CanvasObject in a Canvas.
- canvas (Canvas) : Canvas in which we want to delete an Object.
- object (CanvasObject) : Object that we want to delete.
Boolean Rumble.isInserted()
Boolean Rumble.isInserted()* (_nds_)
Check if a rumble pack is inserted.
*
(
nds)
Check if a rumble pack is inserted.
Void Rumble.set(status)
Void Rumble.set(status)* (_nds_)
Set the rumble status.
* *status* (Boolean): status of the rumble (
(
nds)
Set the rumble status.
- status (Boolean): status of the rumble (
true
true: ON,
: ON, false
false: OFF)
=== Motion ===
*
: OFF)
Boolean Motion.init
Boolean Motion.init* (_nds_)
Init the motion system if a motion device is detected. Return
(
nds)
Init the motion system if a motion device is detected. Return
true
true
if a motion device is detected.
*
if a motion device is detected.
Void Motion.calibrate
Void Motion.calibrate* (_nds_)
Calibrate the motion system.
*
(
nds)
Calibrate the motion system.
Number Motion.readX
Number Motion.readX* (_nds_)
Read the X tilt of the motion.
*
(
nds)
Read the X tilt of the motion.
Number Motion.readY
Number Motion.readY* (_nds_)
Read the Y tilt of the motion.
*
(
nds)
Read the Y tilt of the motion.
Number Motion.readZ
Number Motion.readZ* (_nds_)
Read the Z tilt of the motion.
*
(
nds)
Read the Z tilt of the motion.
Number Motion.accelerationX
Number Motion.accelerationX* (_nds_)
Read the X acceleration of the motion.
*
(
nds)
Read the X acceleration of the motion.
Number Motion.accelerationY
Number Motion.accelerationY* (_nds_)
Read the Y acceleration of the motion.
*
(
nds)
Read the Y acceleration of the motion.
Number Motion.accelerationZ
Number Motion.accelerationZ* (_nds_)
Read the Z acceleration of the motion.
*
(
nds)
Read the Z acceleration of the motion.
Number Motion.readGyro
Number Motion.readGyro* (_nds_)
Read the gyro value of the motion.
*
(
nds)
Read the gyro value of the motion.
Number Motion.rotation
Number Motion.rotation* (_nds_)
Read the rotation value of the motion.
=== DateTime ===
*
(
nds)
Read the rotation value of the motion.
DateTime DateTime.new()
DateTime DateTime.new()* (_libs_)
Create a new DateTime object.
*
(
libs)
Create a new DateTime object.
DateTime DateTime.getCurrentTime()
DateTime DateTime.getCurrentTime()* (_libs_)
Create a new DateTime object with current time values.
*Attributes* (Numbers):
* *
(
libs)
Create a new DateTime object with current time values.
Attributes (Numbers):
-
year
year*
* *
-
month
month*
* *
-
day
day*
* *
-
hour
hour*
* *
-
minute
minute*
* *
-
second
second*
*NOTE*: see examples for more details.
=== Wifi ===
*
NOTE: see examples for more details.
Void Wifi.connectWFC()
Void Wifi.connectWFC()* (_nds_)
Connect the DS to the Wifi connection. Use the firmware configuration. So, you need to configure your connection with an official DS game.
*
(
nds)
Connect the DS to the Wifi connection. Use the firmware configuration. So, you need to configure your connection with an official DS game.
Void Wifi.initDefault()
Void Wifi.initDefault()* (_nds_)
Init the DS Wifi system. Must be done before all Wifi functions except Wifi.connectWFC(). Don't use with Wifi.connectWFC().
*
(
nds)
Init the DS Wifi system. Must be done before all Wifi functions except Wifi.connectWFC(). Don't use with Wifi.connectWFC().
Void Wifi.autoConnectWFC()
Void Wifi.autoConnectWFC()* (_nds_)
Same as Wifi.connectWFC() but used after Wifi.initDefault().
*
(
nds)
Same as Wifi.connectWFC() but used after Wifi.initDefault().
Void Wifi.scanAP()
Void Wifi.scanAP()* (_nds_)
Set the DS in scan mode for AP detection (Access Points such as Livebox, Freebox, Neufbox...). When starting, the DS searches all the time but doesn't warn for a found connection.
*
(
nds)
Set the DS in scan mode for AP detection (Access Points such as Livebox, Freebox, Neufbox...). When starting, the DS searches all the time but doesn't warn for a found connection.
Number Wifi.getNumAP()
Number Wifi.getNumAP()* (_nds_)
Return the number of AP found after a Wifi.scanAP(). The search may be long.
*
(
nds)
Return the number of AP found after a Wifi.scanAP(). The search may be long.
Tableau Wifi.newAP()
Tableau Wifi.newAP()* (_nds_)
Return an empty table with AP data. There are:
* *
(
nds)
Return an empty table with AP data. There are:
-
ssid
ssid* (String) : name of the network's AP
* *
(String) : name of the network's AP -
bssid
bssid* (String) :
* *
(String) : -
macaddr
macaddr* (String) : MAC address of the AP
* *
(String) : MAC address of the AP -
channel
channel* (Number) : network channel number
* *
(Number) : network channel number -
rssi
rssi* (Number) : signal strength
* *
(Number) : signal strength -
maxrate
maxrate* (Number) : communication speed (1M or 2M)
* *
(Number) : communication speed (1M or 2M) -
protection
protection* (String) : Wifi protection (NONE, WEP, WPA)
* *
(String) : Wifi protection (NONE, WEP, WPA) -
adhoc
adhoc* (Boolean) : is the connection adhoc (
(Boolean) : is the connection adhoc (true
true) or not (
) or not (false
false)
* *
) -
active
active* (Boolean) : is the connection active (
(Boolean) : is the connection active (true
true) or not (
) or not (false
false)
*
)
Tableau Wifi.getAP(numap)
Tableau Wifi.getAP(numap)* (_nds_)
Return data about the AP with the number
(
nds)
Return data about the AP with the number
numap
numap
found by
found by
Wifi.scanAP()
Wifi.scanAP()
.
* *numap* (Number) : number of the AP.
*
.
- numap (Number) : number of the AP.
Number Wifi.connectAP(numap, numkey, key)
Number Wifi.connectAP(numap, numkey, key)* (_nds_)
Make a association request to the AP of index
(
nds)
Make a association request to the AP of index
numap
numap
with the key number
with the key number
numkey
numkey
and the WEP key
and the WEP key
key
key
.
If you intend to associate with an unprotected AP set
.
If you intend to associate with an unprotected AP set
numkey
numkey
to 1 and
to 1 and
key
key
to an empty String ("").
to an empty String ("").
numkey
numkey
must be between 1 and 4, but the first key is more often used.
Return -1 if the association is refused.
* *numap* (Number) : AP number
* *numkey* (Number) : key number
* *key* (String) : WEP key.
*
must be between 1 and 4, but the first key is more often used.
Return -1 if the association is refused.
- numap (Number) : AP number
- numkey (Number) : key number
- key (String) : WEP key.
Void Wifi.disconnect()
Void Wifi.disconnect()* (_nds_)
Disconnect the DS from the Wifi connection.
*
(
nds)
Disconnect the DS from the Wifi connection.
Void Wifi.stop()
Void Wifi.stop()* (_nds_)
Disengage the Wifi.
*
(
nds)
Disengage the Wifi.
String Wifi.getLocalConf(choice)
String Wifi.getLocalConf(choice)* (_nds_)
Return data of the DS connection.
* *choix* (Number) :
* *1* : console's IP.
* *2* : gateway.
* *3* : subnet mask.
* *4* : first DNS.
* *5* : second DNS.
* *6* : MAC address of the console
*
(
nds)
Return data of the DS connection.
- choix (Number) :
- 1 : console's IP.
- 2 : gateway.
- 3 : subnet mask.
- 4 : first DNS.
- 5 : second DNS.
- 6 : MAC address of the console
Void Wifi.resetIP()
Void Wifi.resetIP()* (_nds_)
Reset the IP, GateWay, SubnetMask and DNS data.
If called before association, the DS queries the DHCP server.
*
(
nds)
Reset the IP, GateWay, SubnetMask and DNS data.
If called before association, the DS queries the DHCP server.
Void Wifi.setLocalIp(ip, gateway[, subnetmask[, dns1[, dns2]]])
Void Wifi.setLocalIp(ip, gateway[, subnetmask[, dns1[, dns2]]])* (_nds_)
Set the IP, gateWay, subnetMask and DNS.The strings must be formated like "N1.N2.N3.N4" where N is a number between 0 to 255.
* *ip* (String) : IP address.
* *gateway* (String) : gateway address.
* *subnetmask* (String) : subnet mask.
* *dns1* (String) : first DNS.
* *dns2* (String) : second DNS.
*
(
nds)
Set the IP, gateWay, subnetMask and DNS.The strings must be formated like "N1.N2.N3.N4" where N is a number between 0 to 255.
- ip (String) : IP address.
- gateway (String) : gateway address.
- subnetmask (String) : subnet mask.
- dns1 (String) : first DNS.
- dns2 (String) : second DNS.
Socket Wifi.createTCPSocket(host, port)
Socket Wifi.createTCPSocket(host, port)* (_nds_)
Create a TCP socket on a server.
* *host* (String): hostname or IP adress of the server
* *port* (Number): port to use
*
(
nds)
Create a TCP socket on a server.
- host (String): hostname or IP adress of the server
- port (Number): port to use
Socket Wifi.createUDPSocket(host, port)
Socket Wifi.createUDPSocket(host, port)* (_nds_)
Create an UDP socket on a server.
* *host* (String): hostname or IP adress of the server
* *port* (Number): port to use
*
(
nds)
Create an UDP socket on a server.
- host (String): hostname or IP adress of the server
- port (Number): port to use
Void Wifi.closeSocket(socket)
Void Wifi.closeSocket(socket)* (_nds_)
Close a socket (TCP or UDP).
* *socket* (Socket): socket to close
*
(
nds)
Close a socket (TCP or UDP).
- socket (Socket): socket to close
Void Wifi.send(socket, buffer)
Void Wifi.send(socket, buffer)* (_nds_)
Send data to a server using a socket.
* *socket* (Socket): Socket to use
* *buffer* (String): data to send
*
(
nds)
Send data to a server using a socket.
- socket (Socket): Socket to use
- buffer (String): data to send
Number Wifi.checkData(socket)
Number Wifi.checkData(socket)* (_nds_)
Check if there are data in the Wifi buffer and Return the number of character to read.
* *socket* (Socket) : socket to verify.
*
(
nds)
Check if there are data in the Wifi buffer and Return the number of character to read.
- socket (Socket) : socket to verify.
String Wifi.receive(socket, length)
String Wifi.receive(socket, length)* (_nds_)
Receive data from a server using a socket.
* *socket* (Socket): socket to use
* *length* (Number): size of the data to receive
=== Nifi ===
*
(
nds)
Receive data from a server using a socket.
- socket (Socket): socket to use
- length (Number): size of the data to receive
Boolean Nifi.init(channel)
Boolean Nifi.init(channel)* (_nds_)
Init the Wifi in Nifi mode on a channel and return true if success, false otherwise.
* *channel* (Number): the wifi channel where to discuss (must be between 1 and 13).
*
(
nds)
Init the Wifi in Nifi mode on a channel and return true if success, false otherwise.
- channel (Number): the wifi channel where to discuss (must be between 1 and 13).
Void Nifi.changeChannel(channel)
Void Nifi.changeChannel(channel)* (_nds_)
Change the channel where the Nifi discuss.
* *channel* (Number): The new channel (must be between 1 and 13).
*
(
nds)
Change the channel where the Nifi discuss.
- channel (Number): The new channel (must be between 1 and 13).
Void Nifi.stop()
Void Nifi.stop()* (_nds_)
Stop the nifi.
*
(
nds)
Stop the nifi.
Boolean Nifi.checkMessage()
Boolean Nifi.checkMessage()* (_nds_)
Check if a new message is arrived and return true if there is one and false otherwise.
*
(
nds)
Check if a new message is arrived and return true if there is one and false otherwise.
String Nifi.getTrame()
String Nifi.getTrame()* (_nds_)
Get the last trame receive by Nifi even if it's not address to the NDS.
It's max size is 4096 bytes.
*
(
nds)
Get the last trame receive by Nifi even if it's not address to the NDS.
It's max size is 4096 bytes.
Void Nifi.sendMessage(Message)
Void Nifi.sendMessage(Message)* (_nds_)
Send a message on the channel.
* *Message* (String): Message to send. The max size of the message is 2048 bytes.
*
(
nds)
Send a message on the channel.
- Message (String): Message to send. The max size of the message is 2048 bytes.
String Nifi.readMessage()
String Nifi.readMessage()* (_nds_)
Read the last message who's received.
=== Sound ===
==== Sound banks ====
*
(
nds)
Read the last message who's received.
Void Sound.loadBank(filename)
Void Sound.loadBank(filename)* (_nds_)
Load a soundbank from a file in memory.
* *filename* (String): path of the file to load
*
(
nds)
Load a soundbank from a file in memory.
- filename (String): path of the file to load
Void Sound.unloadBank()
Void Sound.unloadBank()* (_nds_)
Unload the sound bank from the memory.
==== Mods ====
*
(
nds)
Unload the sound bank from the memory.
Void Sound.loadMod(id)
Void Sound.loadMod(id)* (_nds_)
Load a module in memory.
* *id* (Number): id of the module to load
*
(
nds)
Load a module in memory.
- id (Number): id of the module to load
Void Sound.unloadMod(id)
Void Sound.unloadMod(id)* (_nds_)
Unload a module from the memory.
* *id* (Number): id of the module to unload
*
(
nds)
Unload a module from the memory.
- id (Number): id of the module to unload
Void Sound.startMod(id, playmode)
Void Sound.startMod(id, playmode)* (_nds_)
Start playing a module already loaded in memory.
* *id* (Number): id of the module to play
* *playmode* (Number): playing mode (
(
nds)
Start playing a module already loaded in memory.
- id (Number): id of the module to play
- playmode (Number): playing mode (
PLAY_ONCE
PLAY_ONCE or
or PLAY_LOOP
PLAY_LOOP)
*
)
Void Sound.pause()
Void Sound.pause()* (_nds_)
Pause all modules.
*
(
nds)
Pause all modules.
Void Sound.resume()
Void Sound.resume()* (_nds_)
Resume all modules.
*
(
nds)
Resume all modules.
Void Sound.stop()
Void Sound.stop()* (_nds_)
Stop all modules.
*
(
nds)
Stop all modules.
Void Sound.setPosition(id, position)
Void Sound.setPosition(id, position)* (_nds_)
Set the cursor position of a module.
* *id* (Number): id of the module
*
(
nds)
Set the cursor position of a module.
- id (Number): id of the module
Boolean Sound.isActive()
Boolean Sound.isActive()* (_nds_)
Return
(
nds)
Return
true
true
if the player is active and
if the player is active and
false
false
if it's not.
*
if it's not.
Void Sound.startJingle(id)
Void Sound.startJingle(id)* (_nds_)
Start playing a module as a jingle.
* *id* (Number): id of the module to play
*
(
nds)
Start playing a module as a jingle.
- id (Number): id of the module to play
Void Sound.setModVolume(volume)
Void Sound.setModVolume(volume)* (_nds_)
Set the volume of the played module.
* *volume* (Number): new volume value between 0 and 1024
*
(
nds)
Set the volume of the played module.
- volume (Number): new volume value between 0 and 1024
Void Sound.setJingleVolume(volume)
Void Sound.setJingleVolume(volume)* (_nds_)
Set the volume of the played jingle.
* *volume* (Number): new volume value between 0 and 1024
*
(
nds)
Set the volume of the played jingle.
- volume (Number): new volume value between 0 and 1024
Void Sound.setModTempo(tempo)
Void Sound.setModTempo(tempo)* (_nds_)
Set the tempo of the module player.
* *tempo* (Number): new tempo value between 512 and 2048
*
(
nds)
Set the tempo of the module player.
- tempo (Number): new tempo value between 512 and 2048
Void Sound.setModPitch(pitch)
Void Sound.setModPitch(pitch)* (_nds_)
Set the pitch of the module player.
* *pitch* (Number): new pitch value
==== SFX ====
*
(
nds)
Set the pitch of the module player.
- pitch (Number): new pitch value
Void Sound.loadSFX(id)
Void Sound.loadSFX(id)* (_nds_)
Load a SFX in the meory.
* *id* (Number): id of the SFX to load
*
(
nds)
Load a SFX in the meory.
- id (Number): id of the SFX to load
Void Sound.unloadSFX(id)
Void Sound.unloadSFX(id)* (_nds_)
Unload a SFX in the meory.
* *id* (Number): id of the SFX to unload
*
(
nds)
Unload a SFX in the meory.
- id (Number): id of the SFX to unload
Handle Sound.startSFX(id)
Handle Sound.startSFX(id)* (_nds_)
Start a sound effect already loaded in memory. Return and handle to this SFX.
* *id* (Number): id of the SFX to start
*
(
nds)
Start a sound effect already loaded in memory. Return and handle to this SFX.
- id (Number): id of the SFX to start
Void Sound.stopSFX(handle)
Void Sound.stopSFX(handle)* (_nds_)
Stop a played SFX.
* *handle* (Handle): handle of a SFX, given by the startSFX function
*
(
nds)
Stop a played SFX.
- handle (Handle): handle of a SFX, given by the startSFX function
Void Sound.releaseSFX(handle)
Void Sound.releaseSFX(handle)* (_nds_)
Mark an effect as low priority.
* *handle* (Handle): handle of a SFX, given by the startSFX function
*
(
nds)
Mark an effect as low priority.
- handle (Handle): handle of a SFX, given by the startSFX function
Void Sound.stopAllSFX()
Void Sound.stopAllSFX()* (_nds_)
Stop all payed SFX.
*
(
nds)
Stop all payed SFX.
Void Sound.setSFXVolume(handle, volume)
Void Sound.setSFXVolume(handle, volume)* (_nds_)
Set the volume of a playing SFX.
* *handle* (Handle): handle of a SFX, given by the startSFX function
* *volume* (Number): new volume value between 0 and 255 (different from Mods)
*
(
nds)
Set the volume of a playing SFX.
- handle (Handle): handle of a SFX, given by the startSFX function
- volume (Number): new volume value between 0 and 255 (different from Mods)
Void Sound.setSFXPanning(handle, panning)
Void Sound.setSFXPanning(handle, panning)* (_nds_)
Set the panning of a playing SFX.
* *handle* (Handle): handle of a SFX, given by the startSFX function
* *panning* (Number): new panning value between 0 (left) and 255 (right)
*
(
nds)
Set the panning of a playing SFX.
- handle (Handle): handle of a SFX, given by the startSFX function
- panning (Number): new panning value between 0 (left) and 255 (right)
Void Sound.setSFXPitch(handle, pitch)
Void Sound.setSFXPitch(handle, pitch)* (_nds_)
Set the pitch of a playing SFX.
* *handle* (Handle): handle of a SFX, given by the startSFX function
* *pitch* (Number): new pitch value
*
(
nds)
Set the pitch of a playing SFX.
- handle (Handle): handle of a SFX, given by the startSFX function
- pitch (Number): new pitch value
Void Sound.setSFXScalePitch(handle, scale)
Void Sound.setSFXScalePitch(handle, scale)* (_nds_)
Set the scaling pitch ratio of a playing SFX.
* *handle* (Handle): handle of a SFX, given by the startSFX function
* *scale* (Number): new scale pitch value
=== INI Files ===
*
(
nds)
Set the scaling pitch ratio of a playing SFX.
- handle (Handle): handle of a SFX, given by the startSFX function
- scale (Number): new scale pitch value
Table INI.load(filename)
Table INI.load(filename)* (_libs_)
Load an INI file and create a table with it.
* *filename* (String): file to load
*
(
libs)
Load an INI file and create a table with it.
- filename (String): file to load
Void INI.save(filename, tab)
Void INI.save(filename, tab)* (_libs_)
Save a table in an INI file.
* *filename* (String): file to load
* *tab* (Table): table to save
Example :
An INI file contains :
{{{
[infos]
name=toto
age=25
}}}
{{{
tab = INI.load(“myfile.ini”)
tab[“infos”][“name”] = “tata”
INI.save(“myfile.ini”, tab)
}}}
This exemple changes the line
(
libs)
Save a table in an INI file.
- filename (String): file to load
- tab (Table): table to save
Example :
An INI file contains :
[infos]
name=toto
age=25
infos
name=toto
age=25
}}}
tab = INI.load(“myfile.ini”)
tab[“infos”][“name”] = “tata”
INI.save(“myfile.ini”, tab)
tab = INI.load(“myfile.ini”)
tab[“infos”][“name”] = “tata”
INI.save(“myfile.ini”, tab)
}}}
This exemple changes the line
name=toto
name=toto
into
into
name=tata
name=tata
.
These tables can only contain Strings!
If you want to store numbers convert them with the
.
These tables can only contain Strings!
If you want to store numbers convert them with the
tostring()
tostring()
function.
=== User's informations ===
==== Functions ====
They are not really useful since the variables below are based on them, but are more convenient to use.
*
function.
They are not really useful since the variables below are based on them, but are more convenient to use.
Number dsUser.getColor()
Number dsUser.getColor()* (_nds_)
Give the color theme, between 0 and 15.
*
(
nds)
Give the color theme, between 0 and 15.
Number dsUser.getBirthDay()
Number dsUser.getBirthDay()* (_nds_)
Give the birth day.
*
(
nds)
Give the birth day.
Number dsUser.getBirthMonth()
Number dsUser.getBirthMonth()* (_nds_)
Give the birth month.
*
(
nds)
Give the birth month.
String dsUser.getName()
String dsUser.getName()* (_nds_)
Give the user's name.
*
(
nds)
Give the user's name.
Number dsUser.getNameLength()
Number dsUser.getNameLength()* (_nds_)
Give the user's name length.
*
(
nds)
Give the user's name length.
String dsUser.getMessage()
String dsUser.getMessage()* (_nds_)
Give the user's personal message.
*
(
nds)
Give the user's personal message.
Number dsUser.getMessageLength()
Number dsUser.getMessageLength()* (_nds_)
Give the user's personal message length.
*
(
nds)
Give the user's personal message length.
Number dsUser.getAlarmHour()
Number dsUser.getAlarmHour()* (_nds_)
Give the alarm hour setting.
*
(
nds)
Give the alarm hour setting.
Number dsUser.getAlarmMinute()
Number dsUser.getAlarmMinute()* (_nds_)
Give the alarm minute setting.
*
(
nds)
Give the alarm minute setting.
Number dsUser.getLanguage()
Number dsUser.getLanguage()* (_nds_)
Give the user's language, between 0 and 5.
*
(
nds)
Give the user's language, between 0 and 5.
Boolean dsUser.getGBAScreen()
Boolean dsUser.getGBAScreen()* (_nds_)
Give the GBA screen setting (
(
nds)
Give the GBA screen setting (
true
true
for the upper screen, and
for the upper screen, and
false
false
for the lower screen).
*
for the lower screen).
Number dsUser.getDefaultBrightness()
Number dsUser.getDefaultBrightness()* (_nds_)
Give the default brightness (between 0 and 3 with a NDS Lite).
*
(
nds)
Give the default brightness (between 0 and 3 with a NDS Lite).
Boolean dsUser.getAutoMode()
Boolean dsUser.getAutoMode()* (_nds_)
Give the auto launching mode setting (
(
nds)
Give the auto launching mode setting (
true
true
if enabled, and
if enabled, and
false
false
if disabled).
==== Variables ====
They are also defined in _nds_.
*
if disabled).
They are also defined in
nds.
(Number) dsUser.color
(Number) dsUser.color*: gives the color theme, between 0 and 15
*
: gives the color theme, between 0 and 15
(Number) dsUser.birthDay
(Number) dsUser.birthDay*: gives the birth day
*
: gives the birth day
(Number) dsUser.birthMonth
(Number) dsUser.birthMonth*: gives the birth month
*
: gives the birth month
(String) dsUser.name
(String) dsUser.name*: gives the user's name
*
: gives the user's name
(Number) dsUser.nameLength
(Number) dsUser.nameLength*: gives the user's name length
*
: gives the user's name length
(String) dsUser.message
(String) dsUser.message*: gives the user's personal message
*
: gives the user's personal message
(Number) dsUser.messageLength
(Number) dsUser.messageLength*: gives the user's personal message length
*
: gives the user's personal message length
(Number) dsUser.alarmHour
(Number) dsUser.alarmHour*: gives the alarm hour setting
*
: gives the alarm hour setting
(Number) dsUser.alarmMinute
(Number) dsUser.alarmMinute*: gives the alarm minute setting
*
: gives the alarm minute setting
(Number) dsUser.language
(Number) dsUser.language*: gives the user's language, between 0 and 5
*
: gives the user's language, between 0 and 5
(Boolean) dsUser.GBAScreen
(Boolean) dsUser.GBAScreen*: gives the GBA screen setting (
: gives the GBA screen setting (
true
true
for the upper screen, and
for the upper screen, and
false
false
for the lower screen)
*
for the lower screen)
(Number) dsUser.defaultBrightness
(Number) dsUser.defaultBrightness*: gives the default brightness (between 0 and 3 with a NDS Lite)
*
: gives the default brightness (between 0 and 3 with a NDS Lite)
(Boolean) dsUser.getAutoMode
(Boolean) dsUser.getAutoMode*: gives the auto launching mode setting (
: gives the auto launching mode setting (
true
true
if enabled, and
if enabled, and
false
false
if disabled)