summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McMackins II <contact@mcmackins.org>2017-08-30 06:45:23 -0500
committerDavid McMackins II <contact@mcmackins.org>2017-08-30 06:45:23 -0500
commit05b518fa5a081298a5d96735afe06c9f2ba7a64d (patch)
treec2042575c0310d610ab31fb44d926888455516f1
parent1162eec93e09dc1400d0c4e24e76b54cf918558b (diff)
Add typing function
-rw-r--r--gui.lua4
-rw-r--r--main.lua4
-rw-r--r--state.lua6
3 files changed, 14 insertions, 0 deletions
diff --git a/gui.lua b/gui.lua
index 3be7121..5b3ea83 100644
--- a/gui.lua
+++ b/gui.lua
@@ -112,6 +112,10 @@ function GuiComponent:settext(text)
self.text = text
end
+function GuiComponent:type(c)
+
+end
+
function GuiComponent:_halfheight()
return self:h() / 2
end
diff --git a/main.lua b/main.lua
index 5d351ed..c3af13e 100644
--- a/main.lua
+++ b/main.lua
@@ -43,6 +43,10 @@ function love.load()
setstate(MainMenuState())
end
+function love.textinput(c)
+ activestate:textinput(c)
+end
+
function love.keypressed(key, isrepeat)
activestate:keypressed(key, isrepeat)
end
diff --git a/state.lua b/state.lua
index 86af1cc..0700f8c 100644
--- a/state.lua
+++ b/state.lua
@@ -104,6 +104,12 @@ function State:draw()
0.5, 0.5)
end
+function State:textinput(c)
+ if self._activecomponent and self._activecomponent.usereditable then
+ self._activecomponent:type(c)
+ end
+end
+
function State:keypressed(key, isrepeat)
end