This document explains how to set up multiple LÖVE installations. Make sure you have all dependencies for the versions of LÖVE you want to install.
Make a directory to install LÖVE source and binaries into.
mkdir $HOME/love/
local ffi = require("ffi") | |
local lua = require("luajit") | |
local sdl = require("SDL2") | |
local message_type = "struct {uint8_t*to_ptr; size_t to_len; uint8_t*from_ptr; size_t from_len;} *" | |
local state = lua.L.newstate() | |
lua.L.openlibs(state) | |
local ok = lua.L.loadstring(state, [[ |
local function check (self) | |
if not self.isDirty then | |
return self | |
end | |
self.length = 0 | |
local item = self.firstItem | |
while item do | |
self.length = self.length + 1 | |
self.items[self.length] = item | |
item = self.itemAfter[item] |
local function wrap (text, limit) | |
local font = love.graphics.getFont() | |
local lines = {{ width = 0 }} | |
local advance = 0 | |
local lastSpaceAdvance = 0 | |
local function append (word, space) | |
local wordAdvance = font:getWidth(word) | |
local spaceAdvance = font:getWidth(space) | |
local words = lines[#lines] |
// Test it on https://love2d.org/wiki/love.thread.newThread | |
// TODO: dl notes: https://love2d.org/wiki/GraphicsFeature | |
// TODO: box notes: https://love2d.org/wiki/love.event.push | |
var picker = document.createElement('select') | |
picker.onchange = function () { | |
applyFilter(this.options[this.selectedIndex].value) | |
} |
#include <lua.h> | |
#include <lauxlib.h> | |
int tuple (lua_State *L) { | |
/* first upvalue is number of tuple values */ | |
int argc = luaL_checkint(L, lua_upvalueindex(1)); | |
/* if arg is "#", return number of tuple values */ | |
const char *count = luaL_optstring(L, 1, ""); | |
if (count[0] == '#') { |
-- A Lua port of Johannes Baagøe's Alea | |
-- From http://baagoe.com/en/RandomMusings/javascript/ | |
-- Johannes Baagøe <baagoe@baagoe.com>, 2010 | |
-- Mirrored at: | |
-- https://github.com/nquinlan/better-random-numbers-for-javascript-mirror | |
local floor = math.floor |