Skip to content

matiasvlevi/lu5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua interpreter for Creative Coding

Provides a similar experience to p5.js with opengl wrappers.

We are not and we do not claim to be affiliated with p5.js or the processing foundation


This sketch draws a circle at position 300, 300.

See API Documentation for more

function setup()
    createWindow(600, 600);
end

function draw()
    background(51);

    circle(300, 300, 32);
end

Build

You can download a built executable for lu5 here, or you can build it yourself assuming you have the right dependencies installed (opengl, glfw, lua, freetype2).

If you encounter any problems with your build or runtime, it is encouraged to submit an issue and steps to reproduce.

GNU/Linux

Build with make

make

you can then install the executable in /usr/bin

sudo make install

Windows

Windows builds are done in an MSYS2 environement with mingw64 installed.

Install dependencies

pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-lua mingw-w64-x86_64-glfw mingw-w64-x86_64-freetype

build

make PLATFORM=win

Running Lua Sketches

Specify the path of the file you want to execute

lu5 file.lua


Preview

x = 100
vx = 7;

function setup()
	createWindow(400, 400);
	
	-- Lock fps
	frameRate(60);
end

function draw()
	background(51);
	
	-- render fps
	text('fps: ' .. frameRate(), 20, 10);

	-- render circle
	circle(x, 200, 32);

	-- bounce
	if (x > width-16 or x < 16) then
		vx = -vx;
	end

	-- move
	x = x + vx;
end



Contributions

Contributions to expand the lu5 api are welcomed.

Read the contribution docs