Skip to content

Ulydev/lovecmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

lovecmd

lovecmd is a simple LÖVE interface for the console

image

Setup

Require library, load it and update it

local cmd = require "lovecmd"

function love.load()
  cmd.load()
end

function love.update(dt)
  cmd.update()
end

Register commands (and optional fallback)

cmd:on("myCommand", function()
  print("it works!")
end)

cmd:on(function(name) print(name .. " doesn't exist) end) 

Usage

cmd.load()

initializes thread

cmd.update()

updates internal thread

cmd:on(command, callback)

cmd:on(callback) --default callback if command isn't registered

registers a command - callback is a function which takes as many arguments as your command does (e.g. function (arg1, arg2) print(arg1, arg2) end)

About

a simple LÖVE console interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages