[SOLVED] Dirtylarry Input Not working

I’m having trouble using the dirtylarry input template in my GUI. It is not recording the input. Everything else appears to be working correctly (specifically buttons).

There are no errors printed to the console. The separate input fields do appear to get focus, it just does not register the keystrokes (appears to be my only problem).

Showing that the input has focus:

My code is below:

local dirtylarry = require "dirtylarry.dirtylarry"

function init(self)
	msg.post(".", "acquire_input_focus")
    gui.set_text(gui.get_node("login_username/content"), "")
	gui.set_text(gui.get_node("login_password/content"), "")
	self.login_username = ""
	self.login_password = ""

end

function final(self)
	msg.post(".", "release_input_focus")
end

function close(self)
	msg.post("main:/controller#script", "show_menu")
end

function on_input(self, action_id, action)
	
	self.login_username = dirtylarry:input("login_username", action_id, action, gui.KEYBOARD_TYPE_DEFAULT, "Username")
    self.login_password = dirtylarry:input("login_password", action_id, action, gui.KEYBOARD_TYPE_PASSWORD, "Password")
	
	dirtylarry:button("close_button", action_id, action, function()
		close(self)
	end)
end

1 Like

Looks like my problem was that I needed to add a text trigger… :frowning:

1 Like

Glad you solved it! :thumbsup: Just a quick question, love the font, what is it? :smiley:

1 Like

It’s called Baloo Thambi … Very beautiful game font and free for commercial use :slight_smile:

Baloo Thambi Download

1 Like