Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danomatika/loaf-ingredients

A set of useful Lua classes & libraries for projects using loaf: lua, osc, and openframeworks
https://github.com/danomatika/loaf-ingredients

loaf lua openframeworks

Last synced: 3 months ago
JSON representation

A set of useful Lua classes & libraries for projects using loaf: lua, osc, and openframeworks

Awesome Lists containing this project

README

        

loaf-ingredients
================

A set of useful Lua classes & libraries for projects using loaf:

>loaf is an interpreter for [openFrameworks](http://openframeworks.cc/) which allows you to write OF applications in the [Lua](http://www.lua.org/) scripting language. This means you can quickly create using openFrameworks but without having to compile C++ or use a heavy IDE like Xcode or Visual Studio. A built-in OSC (Open Sound Control) server enables loaf to communicate natively with other creative coding and music applications over a network connection.

[Dan Wilcox](http://danomatika.com) 2017-2022

Ingredients List
----------------

The ingredients are a mix of traditional Lua tables and reusable loaf class objects. The naming convention followed is for classes to begin with uppercase letters.

* hui: the "Hooey UI", simple window & view hierarchy for UIs based on Apple's UIKit
* panel: a simple vertical gui panel inspired by ofxGui, uses hui
* resources: a loaf resource manager
* SimpleSprite: simple sprite animation class using a sprite sheet
* Scaler: a loaf 2d render scaler class
* Timer: a simple millisecond timer class
* Warper: a quad warper using an fbo
* options: super simple commandline options parser

Documentation can be found in the source files and in examples.

Examples are found on the `examples` directory. They can be run by either drag & dropping the Lua scripts onto loaf or via the commandline:

loaf examples/huitest.lua

Screenshots:

![huitest](doc/huitest.png)
**huitest**: multiple hui.Windows with enclosed hui.Views, active window has a red border

![testpanel](doc/testpanel.png)
**testpanel**: panel with label and sliders, inspired by ofxGui

![testwarper](doc/testwarper.png)
**testwarper**: quad warper in edit mode

Usage
-----

Download or clone this repository and place the .lua files and/or subfolders you want to use into a folder in your project, say "libs". To use the loaf resource manager, you might have the following project layout:

project/libs/resources.lua
project/assets/hellokitty.png
project/main.lua

In main.lua, you can then import and use resources.lua via the require keyword:

local resources = "libs.resources"
local image = resources.add("hellokitty", "assets/hellokitty.png")

Note the "libs.resources" which includes the "libs" subfolder. The same is true for libraries within a folder as require will automatically search for an init.lua file as well.