Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

CtruLua 3DS: Difference between revisions

From GameBrew
(Created page with "{{Infobox 3DS homebrew | title = ctruLua | image = https://dlhb.gamebrew.org/3dshomebrew/ctrulua-01.png|250px | type = Game engine | version = V1.0 | licence = Mixed | author...")
 
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox 3DS homebrew
{{Infobox 3DS Homebrews
| title = ctruLua
|title=ctrµLua
| image = https://dlhb.gamebrew.org/3dshomebrew/ctrulua-01.png|250px
|image=Ctrulua2.png
| type = Game engine
|description=A Lua interpreter for 3DS, brought to life by the remnants of the Lua community.
| version = V1.0
|author=Firew0lf, Reuh, Negi
| licence = Mixed
|lastupdated=2016/11/27
| author = Firew0lf, Reuh, Negi
|type=Game Engine
| website = https://github.com/ctruLua/ctruLua
|version=1.0
| download = https://dlhb.gamebrew.org/3dshomebrew/ctruLua-1.0.rar
|license=Mixed
| source = https://dlhb.gamebrew.org/3dshomebrew/ctruLua-1.0.rar
|download=[https://dlhb.gamebrew.org/3dshomebrews/ctrulua.7z 1.0] & [https://reuh.eu/ctrulua/ci/ctrulua CI Server]
|website=http://ctrulua.github.io
|source=https://github.com/ctruLua/ctruLua
}}
}}
<youtube>Pc3rhzx25_A</youtube>
ctrµLua is a Lua parser for 3DS. It's born within the µLua community as an attempt to bring their favorite piece of software to the 3DS. The result ended being mighty different from what was µLua itself.
 
With the latest release, ctrµLua supports all the most common features needed to create a 2D game or app.
 
==Features==
* HID (everything).
* 2D graphics.
* 3D support (with 2D graphics).
* Texture loading and saving (PNG, JPEG, BMP, a lot of other formats).
* Fonts (TTF, a lot of other formats).
* Maps (.csv).
* Sound (WAV and OGG with/without streaming).
* Sockets (TCP and UDP).
* HTTP contexts (with/without SSL).
* Infrared communication (untested on hardware).
* UDS services (local wireless communication).
* Filesystem.
* LZLib (zlib compression).
* ROMFS.
* Camera.
* Microphone.
* Threads.
* PTM services.
* Head tracking.
* APT services.
* User and system informations.
* News.
 
==Installation==
===Installing===
Unzip ctrµLua on your SD card, in a folder inside your homebrews folder; if you use HBL, extract it in <code>/3ds/ctrulua/</code>
 
Put some scripts wherever you want, just remember where.
 
Launch CtrµLua from your Homebrew Launcher, then use the shell to run your scripts.
 
===Building===
Setup your environment as shown [http://3dbrew.org/wiki/Setting_up_Development_Environment here].
 
Clone this repository and run the command <code>make build-all</code> to build all the dependencies.
 
If you only made changes to ctrµLua, run <code>make</code> to rebuild ctrµLua without rebuilding all the dependencies.
 
'''Note:''' May not work under Windows.
 
==User guide==
===Hello world===
 
<source lang="lua">local ctr = require(""ctr"")
local gfx = require(""ctr.gfx"")
local hid = require(""ctr.hid"")


What is ctr�Lua? ctr�Lua, note the case, is, as you can deduce, a Lua parser for 3DS. It's born within the �Lua community as an attempt to bring their favorite piece of software to the 3DS. The result ended being mighty different from what was �Lua itself.
What can it do? You'll have to ask the guys at development. Or check the TODO list on GitHub. Most of the features we wanted are in, there may be a few bugfixes left to do though.
What about the lads that made it? - Organization members Firew0lf We're... pretty sure he's a huge nerd. No, more like nerd king. He's one of the two developers on the project, and probably the one most eager to expand it. He also goes by geeker and I personally believe he must be yelling at all times IRL.
Reuh Same, a developer. Pretty mature and really silent, I mean it, sometimes I wonder if he died in front of his screen. Also probably a nerd.
Negi Loud-mouthed and pretty much useless. He did the shitty icon. A giga-nerd and self-proclaimed "community"-manager because no one takes care of this damned website and because it's fun. He never participates in code and unintentionally got credited.
With Special Thanks To... - Non-member contributors VideahGams Oh, and...The lads before that? - Projects built upon Please note that this list is almost certainly incomplete.
smea, for the ctrulib. And...Credits to whoever made the code they might have helped themselves on, if they did, that is. They don't really keep me updated on that.
= ctr�Lua =
[[File:https://www.dropbox.com/s/cqmtoohyx6t7q7c/banner.png?raw=1|frame|none|alt=|caption banner]]
Warning: the 'u' in the repo's name is a '�', not a 'u'.
=== Users part ===
==== How to install ====
* Download ctruLua.zip from the [https://github.com/ctruLua/ctruLua/releases releases] (for something stable) or the [http://ci.reuh.tk/ctrulua 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 <code>/3ds/ctrulua/</code>
* 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 [[File:http://ci.reuh.tk/ctrulua.png|build status]] ====
* Most recent working build: [http://ci.reuh.tk/ctrulua/builds/latest/artifacts/ctruLua.3dsx ctruLua.3dsx]
* See http://ci.reuh.tk/ctrulua for all the builds.
==== Hello world ====
<source lang="lua">local ctr = require("ctr")
local gfx = require("ctr.gfx")
local hid = require("ctr.hid")
while ctr.run() do
while ctr.run() do
hid.read()
hid.read()
local keys = hid.keys()
local keys = hid.keys()
if keys.held.start then break end
if keys.held.start then break end
gfx.start(gfx.TOP)
  gfx.text(2, 2, ""Hello, world !"")
gfx.stop()
gfx.render()
end</source>


gfx.start(gfx.TOP)
This script will print "Hello, world !" on the top screen, and will exit if the user presses Start.  
gfx.text(2, 2, "Hello, world !")
 
gfx.stop()
This is the "graphical" version; there's also a text-only version, based on the console:
 
<source lang="lua">local ctr = require(""ctr"")
local gfx = require(""ctr.gfx"")
local hid = require(""ctr.hid"")


gfx.render()
end</source>
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:
<source lang="lua">local ctr = require("ctr")
local gfx = require("ctr.gfx")
local hid = require("ctr.hid")
gfx.console()
gfx.console()
print("Hello, world !")
print(""Hello, world !"")
 
while ctr.run() do
while ctr.run() do
hid.read()
hid.read()
local keys = hid.keys()
local keys = hid.keys()
if keys.held.start then break end
if keys.held.start then break end
gfx.render()
end


gfx.render()
end
gfx.disableConsole()</source>
gfx.disableConsole()</source>
==== Lua API Documentation ====
 
* An online version of the documentation can be found [http://reuh.tk/ctrulua here]
===Lua API Documentation===
* An online version of the documentation can be found [http://reuh.tk/ctrulua here].
* To build the documentation, run <code>make build-doc-html</code> (requires [https://github.com/stevedonovan/LDoc LDoc]).
* To build the documentation, run <code>make build-doc-html</code> (requires [https://github.com/stevedonovan/LDoc LDoc]).
=== Developers part ===
 
==== Build instructions ====
==Changelog==
* Setup your environment as shown here : http://3dbrew.org/wiki/Setting_up_Development_Environment
'''v1.0 Build f118baa'''
* Clone this repository and run the command <code>make build-all</code> to build all the dependencies.
* Sprite library.
* If you only made changes to ctr�Lua, run <code>make</code> to rebuild ctr�Lua without rebuilding all the dependencies.
* Configurable filepicker.
May not work under Windows.
* Shell to select and launch scripts.
=== Credits ===
* Configurable keyboard library.
* '''Smealum''' and everyone who worked on the ctrulib: https://github.com/smealum/ctrulib
* Text editor with Lua syntax highlighting.
* '''Xerpi''' for the [https://github.com/xerpi/sf2dlib sf2dlib], [https://github.com/xerpi/sftdlib sftdlib] and [https://github.com/xerpi/sfillib sfillib]
* Code examples.
* '''All the [https://citra-emu.org/ Citra] developers'''
 
* '''Everyone who worked on [http://devkitpro.org/ DevKitARM]'''
[https://github.com/ctruLua/ctruLua/releases Release notes.]
* '''Nothings''' for the [https://github.com/nothings/stb stb] libs
 
* Everyone who worked on the other libs we use
==Credits==
With this release, ctr�Lua supports all the most common features needed to create a 2D game or app. See the README.md for installation and usage instructions.
* Smealum and everyone who worked on the [https://github.com/smealum/ctrulib ctrulib].
Build f118baa.
* Xerpi for the [https://github.com/xerpi/sf2dlib sf2dlib], [https://github.com/xerpi/sftdlib sftdlib] and [https://github.com/xerpi/sfillib sfillib].
Working features:
* All the [https://citra-emu.org Citra] developers.
HID (everything) 2D graphics 3D support (with 2D graphics) Texture loading and saving (PNG, JPEG, BMP, a lot of other formats) Fonts (TTF, a lot of other formats) Maps (.csv) Sound (WAV and OGG with/without streaming) Sockets (TCP and UDP) HTTP contexts (with/without SSL) Infrared communication (untested on hardware) UDS services (local wireless communication) Filesystem LZLib (zlib compression) ROMFS Camera Microphone Threads PTM services Head tracking APT services User and system informations News Lua scripts included with the release:
* Everyone who worked on [http://devkitpro.org DevKitARM].
Sprite library Configurable filepicker Shell to select and launch scripts Configurable keyboard library Text editor with Lua syntax highlighting Code examples Not working at the moment:
* Nothings for the [https://github.com/nothings/stb stb] libs.
TCP server socket (#10) Returning to the HB menu when exiting ctr�Lua (#5). Use L+R+Down+B to return to the HB launcher instead. Todo:
* Everyone who worked on the other libs we use.
Maybe h.264 decoding. Maybe. 3D drawing / migrating to citro3D
 
==External links==
* Official website - http://ctrulua.github.io
* GitHub - https://github.com/ctruLua/ctruLua

Latest revision as of 06:24, 6 Mayıs 2024

ctrµLua
Ctrulua2.png
General
AuthorFirew0lf, Reuh, Negi
TypeGame Engine
Version1.0
LicenseMixed
Last Updated2016/11/27
Links
[1.0 & CI Server Download]
Website
Source

ctrµLua is a Lua parser for 3DS. It's born within the µLua community as an attempt to bring their favorite piece of software to the 3DS. The result ended being mighty different from what was µLua itself.

With the latest release, ctrµLua supports all the most common features needed to create a 2D game or app.

Features

  • HID (everything).
  • 2D graphics.
  • 3D support (with 2D graphics).
  • Texture loading and saving (PNG, JPEG, BMP, a lot of other formats).
  • Fonts (TTF, a lot of other formats).
  • Maps (.csv).
  • Sound (WAV and OGG with/without streaming).
  • Sockets (TCP and UDP).
  • HTTP contexts (with/without SSL).
  • Infrared communication (untested on hardware).
  • UDS services (local wireless communication).
  • Filesystem.
  • LZLib (zlib compression).
  • ROMFS.
  • Camera.
  • Microphone.
  • Threads.
  • PTM services.
  • Head tracking.
  • APT services.
  • User and system informations.
  • News.

Installation

Installing

Unzip ctrµLua 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, then use the shell to run your scripts.

Building

Setup your environment as shown here.

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.

Note: May not work under Windows.

User guide

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

Changelog

v1.0 Build f118baa

  • Sprite library.
  • Configurable filepicker.
  • Shell to select and launch scripts.
  • Configurable keyboard library.
  • Text editor with Lua syntax highlighting.
  • Code examples.

Release notes.

Credits

External links

Advertising: