-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlove2dwords.lua
More file actions
24 lines (16 loc) · 778 Bytes
/
love2dwords.lua
File metadata and controls
24 lines (16 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- Love2D 'middleware' to use Love2D with Forth language.
-- Copyright 2021 Rob Probin, released under MIT license, see file LICENSE
--
-- Can we add these automatically somehow with introspection?
-- Number of parameters might be tricky?
-- at least make a table?
add_new_word('love', function() push(love) end)
add_new_word('love.graphics.print', function()
drop() -- drop length
love.graphics.print(pop(), pop(), pop())
end)
add_new_word('love.keyboard.setTextInput1', function() love.keyboard.setTextInput(pop()) end)
-- love.keyboard.setTextInput( enable, x, y, w, h )
add_new_word('love.keyboard.hasTextInput', function() push(love.keyboard.hasTextInput()) end)
local utf8 = require("utf8")
add_new_word("love_utf8", function() push(utf8) end)