All Projects → upvalue → love-repl

upvalue / love-repl

Licence: other
Magic-free in-game REPL for the Love game engine

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to love-repl

drop
A LÖVE visualizer and music player
Stars: ✭ 17 (-54.05%)
Mutual labels:  love
Love-Calculator
Let's Calculate love with real data. Love Calculator by Mohammed Cha
Stars: ✭ 54 (+45.95%)
Mutual labels:  love
RetroLove
A collection of simple games built with the LOVE game framework.
Stars: ✭ 13 (-64.86%)
Mutual labels:  love-game-engine
LoveTree
🌴爱情树,将相爱的时刻永远珍藏 (微信,QQ可完美查看)https://ajlovechina.github.io/LoveTree/
Stars: ✭ 295 (+697.3%)
Mutual labels:  love
ConfessionGuys
告白小人微信小程序
Stars: ✭ 22 (-40.54%)
Mutual labels:  love
love
❤️
Stars: ✭ 58 (+56.76%)
Mutual labels:  love
super-sphere
A minimal action game by Kenneth Reitz.
Stars: ✭ 37 (+0%)
Mutual labels:  love
lovector
A pure-lua vector graphics processing and rendering library for LÖVE 2D
Stars: ✭ 29 (-21.62%)
Mutual labels:  love
lovedebug
A fixed and updated repo of LOVEDEBUG
Stars: ✭ 22 (-40.54%)
Mutual labels:  love
JHLikeButton
❤️点赞动画,点赞星星,点赞爱心,抖音点赞 ❤️
Stars: ✭ 41 (+10.81%)
Mutual labels:  love
learn2love
Book for learning programming with Lua and LÖVE.
Stars: ✭ 34 (-8.11%)
Mutual labels:  love
wwwtf.berlin
wwwtf, a ~week of events organized for and by the web community
Stars: ✭ 46 (+24.32%)
Mutual labels:  love
love-atom
Smart autocompletion for the LÖVE framework in Atom.
Stars: ✭ 34 (-8.11%)
Mutual labels:  love
openSMB2
An open source reimplementation of Super Mario Bros. 2 written in Lua and LÖVE.
Stars: ✭ 17 (-54.05%)
Mutual labels:  love
lovelive
💕 Live coding framework for LÖVE(2D Game Engine)
Stars: ✭ 27 (-27.03%)
Mutual labels:  love
prisoners
حبس از دید اعداد واقعی - Persian translation for "Incarceration in real numbers"
Stars: ✭ 22 (-40.54%)
Mutual labels:  love
tailwindcss-dash-docset
TailwindCSS Dash Docset, built with the Dash Docset Builder in PHP. We needed it. 🌈️
Stars: ✭ 37 (+0%)
Mutual labels:  love
puppy-love
A cryptographically secure couple matching platform with strong guarantees
Stars: ✭ 61 (+64.86%)
Mutual labels:  love
loverocks
LÖVE + Luarocks
Stars: ✭ 80 (+116.22%)
Mutual labels:  love-game-engine

Magic-free in-game REPL for the Love game engine. Released under the Boost 1.0 license. (Credit is not required but would be appreciated)

I say magic free because it does not override any Love functions, but it does require you to add hooks into your code in order to work.

See main.lua for an example. The background used in the demo is from David Brown on flickr, used under the Creative Commons license.

console closed console open

Use

  • Enter: Evaluate line
  • Left/Right: Move cursor in line
  • Backspace: Delete letter behind cursor
  • Delete: Delete letter at cursor
  • Ctrl-A: Beginning of line
  • Ctrl-E: End of line
  • Escape: Clear current line
  • Up/Down: Navigate through history for a line to edit
  • Mouse wheel: Scroll through history
  • Home: Scroll to top
  • End: Scroll to bottom
  • Page up: Scroll up a page
  • Page down: Scroll down a page
  • F8: Default toggle key

Functions

repl.initialize()

Should be called during love.load() to initialize the module, but after specifying any settings (such as max lines), and after setting Love's graphical mode.

repl.toggle()

Toggle the REPL.

repl.toggled() : boolean

Returns true if the REPL has been toggled.

repl.eval(text : string, add_to_history : boolean) : boolean

Enter and evaluate TEXT at the REPL. Normally triggered by a user entering text, but can be called directly from code if desired. If ADD_TO_HISTORY is true, the line will be added to the user-navigable history if it is successfully evaluated. Returns true if evaluation was successful, false if not.

repl.print(value)

Print value to the REPL. Great for debug messages. REPL does not need to be open for this to work.

repl.keypressed(k, isrepeat)
repl.mousepressed(x, y, button)
repl.textinput(t)

Use these functions to pass input through to the REPL.

repl.draw()

Render the REPL.

Variables

repl.font : Font

The font to use when rendering. Vera Sans 12pt by default. Requires a monospace font, or multi-line rendering might get messed up.

repl.screenshot = true

If true, take a screenshot when toggled and set repl.background to a darkened version of it.

repl.dark_factor = 0.6

The amount by which the background will be darkened, lower is darker. Should be between 0 and 1.

repl.background : Drawable

Image to use as REPL background. If neither this or screenshot is set, love-repl will clear to black.

repl.max_lines = 1000

The maximum number of lines to keep. Must be set before initialize() is called. Includes both user-entered and program generated lines.

repl.max_history = 1000

The maximum number of history lines to keep. Must be set before initialize() is called.

repl.toggle_key = "f8"

The Love KeyConstant that will cause the REPL to close itself.

repl.clear_key = "escape"

The Love KeyConstant that will clear the current line.

repl.on_close : function

A hook that will be called when the REPL is closed.

repl.wrapping = false

Enable word wrapping via love.graphics.printf. Note that it is necessary to use a monospaced font with word wrapping.

Issues

  • No word wrapping
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].