This is a port of Lua 5.3.5 for 3DS with interfaces for the most common 3DS libraries
A: Enter Directory / Run Script B: Move up one directory Y: Change Option Start: Exit to HBL
The program currently has basic support for debugging with LRDB. To enable it, change the debugger option to lrdb before launching the script. LRDB is supported in VSCode with the following extension: https://marketplace.visualstudio.com/items?itemName=satoren.lrdb
You can use the standard Lua libraries to run script, as well as the following modules which have been preloaded. It is reccomended you take a look at the lua/ directory for exemples and demonstrations on how to use Lua with the 3DS libraries. This program does not come with any file transfer utilities built-in, so you need to either copy your scripts to the SD card or use another program like ftpd (https://github.com/mtheall/ftpd) to do so.
Those are the function for drawing 2D graphics
Draws an image at the screen at coordinates (x, y) with the provided scale and depth. Applies a tint if provided.
Draws text at coordinates (x, y) with the provided scale, depth and color
Draws a solid rectangle at coordinates (x, y) with the provided color
Draws a rectangle at coordinates (x, y) with the specified dimensions and colors.
The colors are for each corner of the rectangle: color1: top-left, color2: top-right, color3: bottom-left, color4: bottom-right
Draws a triangle with corners at coordinates (x1, y1), (x2, y2), (x3, y3) with the specified color and depth
Draws a triangle with corners at coordinates (x1, y1), (x2, y2), (x3, y3) with the depth and a specified color for each corner
Draws a circle or radius r at coordinates (x, y) with the specified color and depth
Draws a circle or radius r at coordinates (x, y) with the depth and a specified color for each corner
Draws an ellipse or width w and height h at coordinates (x, y) with the specified color and depth
Draws an ellipse or radius r at coordinates (x, y) with the depth and a specified color for each corner
Loads and returns the sprite sheet with the specified path
Returns the image at the specified index in the spritesheet. Index starts at 1.
Takes the 4 arguments in the range 0-255 and transforms them to a u32 value representing this color
Takes a table with the r, g, b, and a fields in the range 0-255 and transforms it to a u32 value representing this color
This module exposes functions to allow the use of a game loop in the program.
Starts a rendering loop that runs as long as exit() is not called. It continuously calls the global function onRender if it is defined. This should be at the end of your main file, before cleanup code if necessary.
Requests the exit of the game loop. The loop will complete and do the necessary cleanup once the current call of the onRender function returns.
Cancels a previous exit request. This allows you to call the loop function again to restart the rendering loop.
This module exposes the controls of the console.
Returns the keys that have been pressed down since the last HID scan. If you use the game loop, the keys are scanned every loop iteration.
Returns the keys that are currently being held.
This modules allows you to get information on the current system configuration
Returns the console region, as a string if asString is true, or as an integer code otherwise
Returns the console langugage, as a string if asString is true, or as an integer code otherwise
Returns the console model, as a string if asString is true, or as an integer code otherwise
Returns if NFC is supported on this console