ApiFourDotZeroDotOne: Contents
  Introduction
  API
    Variables
    Functions and their table
      Screen
      Colors
      Controls
      Images
      Timers
      Sprites
      Debug
      System
      Fonts
      Maps
      Scroll Maps
      Canvas
      Rumble
      Motion
      DateTime
      Wifi
      Sound
      INI Files
      User's informations

Api Four Dot Zero Dot One

4.0 API.

Introduction

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).

API

Variables

  • MICROLUA_VERSIONMICROLUA_VERSION* (_libs_): version of Micro Lua (String). * * (libs): version of Micro Lua (String).
  • SCREEN_WIDTHSCREEN_WIDTH*, *, SCREEN_HEIGHTSCREEN_HEIGHT* (_libs_): width and height of the screens. * * (libs): width and height of the screens.
  • NB_FPSNB_FPS* (_libs_): number of frame per second automatically updated each second. You can display it with a (libs): number of frame per second automatically updated each second. You can display it with a screen.print()screen.print() between between screen.startDrawing()screen.startDrawing() and and screen.stopDrawing()screen.stopDrawing(). Don’t display it in the debug console. * *. Don’t display it in the debug console.
  • SCREEN_UPSCREEN_UP*, *, SCREEN_DOWNSCREEN_DOWN* (_libs_): screen number where to draw. See examples for more details. * * (libs): screen number where to draw. See examples for more details.
  • RAMRAM* and * and VRAMVRAM* (_libs_): destination where to load some object. See examples for more details. * * (libs): destination where to load some object. See examples for more details.
  • ATTR_X1ATTR_X1*, *, ATTR_Y1ATTR_Y1*, *, ATTR_X2ATTR_X2*, *, ATTR_Y2ATTR_Y2*, *, ATTR_X3ATTR_X3*, *, ATTR_Y3ATTR_Y3*, *, ATTR_COLORATTR_COLOR*, *, ATTR_COLOR1ATTR_COLOR1*, *, ATTR_COLOR2ATTR_COLOR2*, *, ATTR_COLOR3ATTR_COLOR3*, *, ATTR_COLOR4ATTR_COLOR4*, *, ATTR_TEXTATTR_TEXT*, *, ATTR_VISIBLEATTR_VISIBLE*, *, ATTR_FONTATTR_FONT*, *, ATTR_IMAGEATTR_IMAGE* (_libs_): attributes used in canvas. * * (libs): attributes used in canvas.
  • ALPHA_RESETALPHA_RESET* (_libs_): blending coefficient value to reset alpha transparency. Is equal to 100. * * (libs): blending coefficient value to reset alpha transparency. Is equal to 100.
  • PLAY_LOOPPLAY_LOOP*, *, PLAY_ONCEPLAY_ONCE*: arguments to play mods respectively loop and once. * *: arguments to play mods respectively loop and once.
  • mustCountFPSmustCountFPS*: regulate the FPS couting system. It is an internal variable, you should never have to deal with it. * *: regulate the FPS couting system. It is an internal variable, you should never have to deal with it.
  • Debug.isDebugOnDebug.isDebugOn*, *, Debug.debugTextDebug.debugText* and * and Debug.debugColorDebug.debugColor*: variables used by the debug system. You should only modify them by using the : variables used by the debug system. You should only modify them by using the DebugDebug functions. == Functions and their table == === Screen === * functions.

Functions and their table

Screen

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.getAlpha()Number screen.getAlpha()* (_nds_) Give the current alpha layer. * (nds)

Give the current alpha layer.

Void screen.setAlpha(level [, layer])Void screen.setAlpha(level [, layer])* (_nds_) Set the alpha blending of the layer. * *level* (Number): blending coefficient, between 0 (fully transparent) and 100 (fully opaque; reset the transparency) * *layer* (Number): layer index; you should use (nds)

Set the alpha blending of the layer.
  • level (Number): blending coefficient, between 0 (fully transparent) and 100 (fully opaque; reset the transparency)
  • layer (Number): layer index; you should use screen.getAlpha()screen.getAlpha() to automatically keep the count. Only optional with opaque drawing (level = 100) If you need to draw something opaque without resetting layers index count, just give a level of 99. * to automatically keep the count. Only optional with opaque drawing (level = 100)
If you need to draw something opaque without resetting layers index count, just give a level of 99.

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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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 or SCREEN_UP or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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
Boolean screen.getMainLcd()Boolean screen.getMainLcd()* (_libs_) Give the screen uLibrary is drawing on ( (libs)

Give the screen uLibrary is drawing on (truetrue for upper screen, for upper screen, falsefalse for the lower screen). * for the lower screen).

Void screen.setSpaceBetweenScreens(space)Void screen.setSpaceBetweenScreens(space)* (_libs_, _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 * (libs, 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()* (_libs_) Initialise some stuff about the screens. It is done automatically, so you should have nothing to care about this. * (libs)

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()* (_libs_) Start a new drawing and configure 2D. You should have nothing to care about this. * (libs)

Start a new drawing and configure 2D. You should have nothing to care about this.

Void screen.endDrawing()Void screen.endDrawing()* (_libs_) End drawing. You will never need to use it (use (libs)

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()* (_libs_) Wait for the VBlank period to reach 60FPS. You will never need to use it (using (libs)

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).

Colors

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)

Controls

Void Controls.read()Void Controls.read()* (_libs_) Read the controls and update all control structures. ==== Stylus ==== These are numbers or booleans. Everything here is defined in the _libs_. * (libs)

Read the controls and update all control structures.

Stylus

These are numbers or booleans. Everything here is defined in the libs.

Stylus.XStylus.X*: x-coordinate of the stylus *: x-coordinate of the stylus

Stylus.YStylus.Y*: y-coordinate of the stylus *: y-coordinate of the stylus

Stylus.heldStylus.held*: is the stylus held on the screen *: is the stylus held on the screen

Stylus.releasedStylus.released*: is the stylus released *: is the stylus released

Stylus.doubleClickStylus.doubleClick: : truetrue* if stylus do a double click * if stylus do a double click

Stylus.deltaXStylus.deltaX*: delta x of the stylus movement *: delta x of the stylus movement

Stylus.deltaYStylus.deltaY*: delta y of the stylus movement *: delta y of the stylus movement

Stylus.newPressStylus.newPress: : truetrue* if stylus do a new press ==== Keys ==== These are booleans. Everything here is defined in the _libs_. ( if stylus do a new press

Keys

These are booleans. Everything here is defined in the libs.

([KEY]KEY can take the following values : * can take the following values : AA, , BB, , XX, , YY, , LL, , RR, , StartStart, , SelectSelect, , UpUp, , DownDown, , LeftLeft, , RightRight*) *)

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: : truetrue* if the key does a new press === Images === * if the key does a new press

Images

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): truetrue to activate the mirroring, to activate the mirroring, falsefalse 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): truetrue to activate the mirroring, to activate the mirroring, falsefalse 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

Timers

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.

Sprites

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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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 truetrue 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

Debug

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

System

String System.currentDirectory()String System.currentDirectory()* (_libs_) Get the current working directory. * (libs)

Get the current working directory.

Void System.changeDirectory(path)Void System.changeDirectory(path)* (_libs_) Change the current working directory. * *path* (String): path of the directory * (libs)

Change the current working directory.
  • path (String): path of the directory
Void System.remove(name)Void System.remove(name)* (_libs_) Remove a file or an empty folder. * *name* (String): name of the file or directory to remove * (libs)

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)* (_libs_) 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 * (libs)

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)* (_libs_) Create a new directory. * *name* (String): path and name of the directory * (libs)

Create a new directory.
  • name (String): path and name of the directory
Table System.listDirectory(path)Table System.listDirectory(path)* (_libs_) List all files and folders of a directory. * *path* (String): path of the directory to list * *NOTE*: See examples for more details. * (libs)

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()* (_libs_) Give the current amount of used VRAM (seems to return some weird number). * (libs)

Give the current amount of used VRAM (seems to return some weird number).

Number System.CurrentVramFree()Number System.CurrentVramFree()* (_libs_) Give the current amount of free VRAM. * (libs)

Give the current amount of free VRAM.

Number System.CurrentPalUsed()Number System.CurrentPalUsed()* (_libs_) Give the current amount of used palette memory (seems to return some weird number). * (libs)

Give the current amount of used palette memory (seems to return some weird number).

Number System.CurrentPalFree()Number System.CurrentPalFree()* (_libs_) Give the current amount of free palette memory. === Fonts === * (libs)

Give the current amount of free palette memory.

Fonts

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.
  • font (Font): font to use
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

Maps

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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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

Scroll Maps

ScrollMap ScrollMap.new(image, mapfile, width, height, tileWidth, tileHeight)ScrollMap ScrollMap.new(image, mapfile, width, height, tileWidth, tileHeight)* (_nds_) * *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)

  • 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(scrollmap)Void ScrollMap.draw(scrollmap)* (_nds_) Draw a ScrollMap. * *scrollmap* (ScrollMap): ScrollMap to draw * (nds)

Draw a ScrollMap. Void ScrollMap.scroll(scrollmap, x, y)Void ScrollMap.scroll(scrollmap, x, y)* (_nds_) Scroll a ScrollMap. * *scrollmap* (ScrollMap): ScrollMap to scroll * *x* (Number): x scrolling in pixel * *y* (Number): y scrolling in pixel * (nds)

Scroll a ScrollMap.
  • scrollmap (ScrollMap): ScrollMap to scroll
  • x (Number): x scrolling in pixel
  • y (Number): y scrolling in pixel
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 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 = nilcanvas = 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_UPSCREEN_UP or or SCREEN_DOWNSCREEN_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.

Rumble

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 (truetrue: ON, : ON, falsefalse: OFF) === Motion === *: OFF)

Motion

Boolean Motion.initBoolean 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 truetrue if a motion device is detected. * if a motion device is detected.

Void Motion.calibrateVoid Motion.calibrate* (_nds_) Calibrate the motion system. * (nds)

Calibrate the motion system.

Number Motion.readXNumber Motion.readX* (_nds_) Read the X tilt of the motion. * (nds)

Read the X tilt of the motion.

Number Motion.readYNumber Motion.readY* (_nds_) Read the Y tilt of the motion. * (nds)

Read the Y tilt of the motion.

Number Motion.readZNumber Motion.readZ* (_nds_) Read the Z tilt of the motion. * (nds)

Read the Z tilt of the motion.

Number Motion.accelerationXNumber Motion.accelerationX* (_nds_) Read the X acceleration of the motion. * (nds)

Read the X acceleration of the motion.

Number Motion.accelerationYNumber Motion.accelerationY* (_nds_) Read the Y acceleration of the motion. * (nds)

Read the Y acceleration of the motion.

Number Motion.accelerationZNumber Motion.accelerationZ* (_nds_) Read the Z acceleration of the motion. * (nds)

Read the Z acceleration of the motion.

Number Motion.readGyroNumber Motion.readGyro* (_nds_) Read the gyro value of the motion. * (nds)

Read the gyro value of the motion.

Number Motion.rotationNumber Motion.rotation* (_nds_) Read the rotation value of the motion. === DateTime === * (nds)

Read the rotation value of the motion.

DateTime

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):
yearyear, , monthmonth, , dayday, , hourhour, , minuteminute, , secondsecond* * *NOTE*: See examples for more details. === Wifi === *
  • NOTE: See examples for more details.

Wifi

Void Wifi.connectWFC()Void Wifi.connectWFC()* (_nds_) Connect the DS to the Wifi connection. Use the firmware configurations. So, you need to configure your connection with an official DS game. * (nds)

Connect the DS to the Wifi connection. Use the firmware configurations. So, you need to configure your connection with an official DS game.

Void Wifi.initDefault()Void Wifi.initDefault()* (_nds_) Init the DS wifi. Must do before all over wifi function except Wifi.connectWFC(). Don't use with Wifi.connectWFC(). * (nds)

Init the DS wifi. Must do before all over wifi function except Wifi.connectWFC(). Don't use with Wifi.connectWFC().

Void Wifi.autoConnectWFC()Void Wifi.autoConnectWFC()* (_nds_) Same as Wifi.connectWFC() but use after Wifi.initDefault(). * (nds)

Same as Wifi.connectWFC() but use after Wifi.initDefault().

Void Wifi.scanAP()Void Wifi.scanAP()* (_nds_) Set the DS in scan Mode for AP detection (Access Point like Livebox, Freebox, Neufbox...). When start, the DS search all the time but don't prevent the connection or else thing. * (nds)

Set the DS in scan Mode for AP detection (Access Point like Livebox, Freebox, Neufbox...). When start, the DS search all the time but don't prevent the connection or else thing.

Number Wifi.getNumAP()Number Wifi.getNumAP()* (_nds_) Return the number of AP find after a Wifi.scanAP(). the search may be long. * (nds)

Return the number of AP find after a Wifi.scanAP(). the search may be long.

Tableau Wifi.newAP()Tableau Wifi.newAP()* (_nds_) Return an empty table with AP datas. There are: * ssid : (String) Name of the network's AP. * bssid : (String) * macaddr : (String) address Mac of the AP. * channel : (Int) the network channel number. * rssi : (Int) the signal strength. * maxrate : (Int) The communication speed (1M or 2M) * protection : (String) The wifi protection (NONE, WEP, WPA) * adhoc : (Booléen) Indicates if there is an adhcoc connection or not(true or false) * active : (Booléen) Indiates if the connection is active or not(true or false) * (nds)

Return an empty table with AP datas. There are:
  • ssid : (String) Name of the network's AP.
  • bssid : (String)
  • macaddr : (String) address Mac of the AP.
  • channel : (Int) the network channel number.
  • rssi : (Int) the signal strength.
  • maxrate : (Int) The communication speed (1M or 2M)
  • protection : (String) The wifi protection (NONE, WEP, WPA)
  • adhoc : (Booléen) Indicates if there is an adhcoc connection or not(true or false)
  • active : (Booléen) Indiates if the connection is active or not(true or false)
Tableau Wifi.getAP(numap)Tableau Wifi.getAP(numap)* (_nds_) Return the AP's datas with the number numap find by the Wifi.scanAP() function. * *numap* (Number) : number of the AP. * (nds)

Return the AP's datas with the number numap find by the Wifi.scanAP() function.
  • 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 numap AP with the key number numkey with the WEPkey key. If you make association with a non protect AP set 1 in numkey and ("") in key. numkey must be between 1 and 4. But generaly it's the first key was used. Return -1 if the association is refused. * *numap* (Number) : number of the AP. * *numkey* (Number) : number of the key. * *key* (String) : WEPkey. * (nds)

Make a association request to the numap AP with the key number numkey with the WEPkey key. If you make association with a non protect AP set 1 in numkey and ("") in key. numkey must be between 1 and 4. But generaly it's the first key was used. Return -1 if the association is refused.
  • numap (Number) : number of the AP.
  • numkey (Number) : number of the key.
  • key (String) : WEPkey.
Void Wifi.disconnect()Void Wifi.disconnect()* (_nds_) Disconnect the DS form the Wifi connection. * (nds)

Disconnect the DS form the Wifi connection.

Void Wifi.stop()Void Wifi.stop()* (_nds_) Disangage the Wifi. * (nds)

Disangage the Wifi.

String Wifi.getLocalConf(choix)String Wifi.getLocalConf(choix)* (_nds_) Return data of the DS connection. * *choix* (Number) : * *1* Return the IP of DS. * *2* Return the GateWay's DS. * *3* Return the subnetMask of the DS. * *4* Return the DNS1 of the DS. * *5* Return the DNS2 of the DS. * *6* Return the address MAC of the DS. * (nds)

Return data of the DS connection.
  • choix (Number) :
    • 1 Return the IP of DS.
    • 2 Return the GateWay's DS.
    • 3 Return the subnetMask of the DS.
    • 4 Return the DNS1 of the DS.
    • 5 Return the DNS2 of the DS.
    • 6 Return the address MAC of the DS.
Void Wifi.resetIP()Void Wifi.resetIP()* (_nds_) Reset the IP, GateWay, SubnetMask and DNS data. If call before association, The DS query the DHCP server. * (nds)

Reset the IP, GateWay, SubnetMask and DNS data. If call before association, The DS query 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) : the SubnetMask. * *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) : the SubnetMask.
  • 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 === Sound === ==== Sound banks ==== * (nds)

Receive data from a server using a socket.
  • socket (Socket): Socket to use
  • length (Number): size of the data to receive

Sound

Sound banks

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.

Mods

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_ONCEPLAY_ONCE or or PLAY_LOOPPLAY_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 truetrue if the player is active and if the player is active and falsefalse 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

SFX

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

INI Files

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=totoname=toto into into name=tataname=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.

User's informations

Functions

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 (truetrue for the upper screen, and for the upper screen, and falsefalse 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 (truetrue if enabled, and if enabled, and falsefalse if disabled). ==== Variables ==== They are also defined in _nds_. * if disabled).

Variables

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 (truetrue for the upper screen, and for the upper screen, and falsefalse 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 (truetrue if enabled, and if enabled, and falsefalse if disabled)