1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-27 16:39:29 +00:00
ctrµLua: Lua homebrewing for 3DS
Find a file
2016-09-17 19:13:50 +02:00
data Added ctr.gfx.text and the Bitsream Vera font 2015-08-19 14:32:53 +02:00
doc Fixed sublime-completions doc building 2016-04-02 19:03:24 +02:00
libs Added a missing file 2016-08-05 18:45:26 +02:00
sdcard/3ds/ctruLua Added a way to communicate easily between threads. The API _will_ change and be unified. 2016-09-17 19:13:50 +02:00
source Added a way to communicate easily between threads. The API _will_ change and be unified. 2016-09-17 19:13:50 +02:00
.gitignore Added a way to build the documentation as .sublime-completions files (make build-doc-st) 2016-02-29 19:42:52 +01:00
icon.png Changed the icon, and deleted the test files. 2016-04-02 18:41:25 +02:00
LICENSE Create LICENSE 2015-08-18 13:30:11 +02:00
Makefile Updated all the libs, added citro3d, added ctr.swkbd (WIP, untested) 2016-08-05 17:30:24 +02:00
README.md README rewrite 2016-06-27 20:16:38 +02:00

ctrµLua

banner

Warning: the 'u' in the repo's name is a 'µ', not a 'u'.

Users part

How to install

  • Download ctruLua.zip from the releases (for something stable) or the CI server (for more features)
  • Unzip it on your SD card, in a folder inside your homebrews folder; if you use HBL, extract it in /3ds/ctrulua/
  • Put some scripts wherever you want, just remember where
  • Launch CtrµLua from your homebrew launcher
  • Use the shell to run your scripts

Homebrewers part

Builds build status

Hello world

local ctr = require("ctr")
local gfx = require("ctr.gfx")
local hid = require("ctr.hid")

while ctr.run() do
	hid.read()
	local keys = hid.keys()
	if keys.held.start then break end
	
	gfx.start(gfx.TOP)
		gfx.text(2, 2, "Hello, world !")
	gfx.stop()
	
	gfx.render()
end

This script will print "Hello, world !" on the top screen, and will exit if the user presses Start. This is the "graphical" version; there's also a text-only version, based on the console:

local ctr = require("ctr")
local gfx = require("ctr.gfx")
local hid = require("ctr.hid")

gfx.console()
print("Hello, world !")

while ctr.run() do
	hid.read()
	local keys = hid.keys()
	if keys.held.start then break end
	
	gfx.render()
end

gfx.disableConsole()

Lua API Documentation

  • An online version of the documentation can be found here
  • To build the documentation, run make build-doc-html (requires LDoc).

Developers part

Build instructions

  • Setup your environment as shown here : http://3dbrew.org/wiki/Setting_up_Development_Environment
  • Clone this repository and run the command make build-all to build all the dependencies.
  • If you only made changes to ctrµLua, run make to rebuild ctrµLua without rebuilding all the dependencies.

May not work under Windows.

Credits