diff options
author | David McMackins II <contact@mcmackins.org> | 2017-08-30 06:45:23 -0500 |
---|---|---|
committer | David McMackins II <contact@mcmackins.org> | 2017-08-30 06:45:23 -0500 |
commit | 05b518fa5a081298a5d96735afe06c9f2ba7a64d (patch) | |
tree | c2042575c0310d610ab31fb44d926888455516f1 | |
parent | 1162eec93e09dc1400d0c4e24e76b54cf918558b (diff) |
Add typing function
-rw-r--r-- | gui.lua | 4 | ||||
-rw-r--r-- | main.lua | 4 | ||||
-rw-r--r-- | state.lua | 6 |
3 files changed, 14 insertions, 0 deletions
@@ -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 @@ -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 @@ -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 |