LÖVE-Nuklear - a lightweight immediate mode GUI

Showcase your libraries, tools and other projects that help your fellow love users.
grump
Party member
Posts: 496
Joined: Sat Jul 22, 2017 7:43 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by grump » Tue May 01, 2018 7:37 pm

There's a pull request on Github that fixes things inside love-nuklear to make it compatible with LÖVE 11. The author seems to have abandoned the lib though :(

Some things can't be fixed with the setColor hack - the color picker is broken and requires a fix in the C code.

keharriso
Prole
Posts: 22
Joined: Fri Nov 16, 2012 9:34 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by keharriso » Fri Dec 14, 2018 8:18 pm

LÖVE-Nuklear is back and better than ever in v2.5. If anyone has any problems, please add an issue to the github repo. Thanks, and good luck with your projects!
Last edited by keharriso on Sat Feb 09, 2019 2:15 am, edited 1 time in total.
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games

totalvamp
Prole
Posts: 3
Joined: Sun Mar 20, 2016 11:47 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by totalvamp » Mon Feb 04, 2019 7:32 pm

Loving it so far, however I'm confused on how to handle textinput, there is no example of this either.

Does anyone have an example on how to get every text input into a text input?

keharriso
Prole
Posts: 22
Joined: Fri Nov 16, 2012 9:34 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by keharriso » Mon Feb 04, 2019 11:57 pm

The edit widget is probably what you're looking for.

Simple example:

Code: Select all

local nuklear = require 'nuklear'

local ui

function love.load()
	love.keyboard.setKeyRepeat(true)
	ui = nuklear.newUI()
end

local edit = {value = 'Hello, world!'}

function love.update(dt)
	ui:frameBegin()
	if ui:windowBegin('Text Input', 100, 100, 200, 80,
			'border', 'title', 'movable') then
		ui:layoutRow('dynamic', 30, 1)
		local state, changed = ui:edit('field', edit)
		if changed then
			print(edit.value)
		end
	end
	ui:windowEnd()
	ui:frameEnd()
end

function love.draw()
	ui:draw()
end

function love.keypressed(key, scancode, isrepeat)
	ui:keypressed(key, scancode, isrepeat)
end

function love.keyreleased(key, scancode)
	ui:keyreleased(key, scancode)
end

function love.mousepressed(x, y, button, istouch, presses)
	ui:mousepressed(x, y, button, istouch, presses)
end

function love.mousereleased(x, y, button, istouch, presses)
	ui:mousereleased(x, y, button, istouch, presses)
end

function love.mousemoved(x, y, dx, dy, istouch)
	ui:mousemoved(x, y, dx, dy, istouch)
end

function love.textinput(text)
	ui:textinput(text)
end

function love.wheelmoved(x, y)
	ui:wheelmoved(x, y)
end
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests