All Projects → keharriso → Love Nuklear

keharriso / Love Nuklear

Licence: mit
Lightweight immediate mode GUI for LÖVE games

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Love Nuklear

Implot
Immediate Mode Plotting
Stars: ✭ 2,014 (+616.73%)
Mutual labels:  gui, imgui
Imgui
Immediate Mode GUI for C#
Stars: ✭ 133 (-52.67%)
Mutual labels:  gui, imgui
Hello imgui
Hello, Dear ImGui: cross-platform Gui apps for Windows / Mac / Linux / iOS / Android / Emscripten with the simplicity of a "Hello World" app
Stars: ✭ 120 (-57.3%)
Mutual labels:  gui, imgui
Swiftgui
SwiftGUI is an API inspired by SwiftUI DSL, using Dear ImGui as renderer and running on macOS 10.13+ and iOS 11+
Stars: ✭ 74 (-73.67%)
Mutual labels:  gui, imgui
Webgui
An example demo of IMGUI (Immediate Mode GUI) on the web. Using only WebGL, GLFW and ImGui. Suitable for being compiled to web assembly (WASM).
Stars: ✭ 180 (-35.94%)
Mutual labels:  gui, imgui
Imgui Rs
Rust bindings for Dear ImGui
Stars: ✭ 1,258 (+347.69%)
Mutual labels:  gui, imgui
Nukleardotnet
.NET binding for the Nuklear immediate mode GUI
Stars: ✭ 126 (-55.16%)
Mutual labels:  gui, imgui
Giu
Cross platform rapid GUI framework for golang based on Dear ImGui.
Stars: ✭ 862 (+206.76%)
Mutual labels:  gui, imgui
Rapidgui
Unity OnGUI(IMGUI) extensions for Rapid prototyping/development
Stars: ✭ 144 (-48.75%)
Mutual labels:  gui, imgui
Bimpy
imgui for python
Stars: ✭ 144 (-48.75%)
Mutual labels:  gui, imgui
Asap app imgui
Starter project for portable app with optional GUI (GLFW/ImGui) and a rich builtin debug UI. Includes docked windows, log viewer, settings editor, configuration load/save, etc...
Stars: ✭ 70 (-75.09%)
Mutual labels:  gui, imgui
Gooi
LÖVE GUI Library
Stars: ✭ 168 (-40.21%)
Mutual labels:  love2d, gui
Wtk
📺 A cross-platform immediate mode user-interface library. Public domain.
Stars: ✭ 30 (-89.32%)
Mutual labels:  gui, imgui
Horus ui
HorusUI Immediate Mode Graphical User Interface
Stars: ✭ 106 (-62.28%)
Mutual labels:  gui, imgui
Imgui
Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
Stars: ✭ 33,574 (+11848.04%)
Mutual labels:  gui, imgui
Sonyheadphonesclient
A {Windows, macOS, Linux} client recreating the functionality of the Sony Headphones app
Stars: ✭ 123 (-56.23%)
Mutual labels:  gui, imgui
Cvui
A (very) simple UI lib built on top of OpenCV drawing primitives
Stars: ✭ 619 (+120.28%)
Mutual labels:  gui, imgui
Cimgui
c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets
Stars: ✭ 707 (+151.6%)
Mutual labels:  gui, imgui
Imgui sdl
ImGuiSDL: SDL2 based renderer for Dear ImGui
Stars: ✭ 134 (-52.31%)
Mutual labels:  gui, imgui
Nuklear
A single-header ANSI C gui library
Stars: ✭ 13,365 (+4656.23%)
Mutual labels:  gui, imgui

LÖVE-Nuklear

Nuklear module for the LÖVE game engine.

Provides a lightweight immediate mode GUI for LÖVE games.

Example

-- Simple UI example.

local nuklear = require 'nuklear'

local ui

function love.load()
	ui = nuklear.newUI()
end

local combo = {value = 1, items = {'A', 'B', 'C'}}

function love.update(dt)
	ui:frameBegin()
	if ui:windowBegin('Simple Example', 100, 100, 200, 160,
			'border', 'title', 'movable') then
		ui:layoutRow('dynamic', 30, 1)
		ui:label('Hello, world!')
		ui:layoutRow('dynamic', 30, 2)
		ui:label('Combo box:')
		if ui:combobox(combo, combo.items) then
			print('Combo!', combo.items[combo.value])
		end
		ui:layoutRow('dynamic', 30, 3)
		ui:label('Buttons:')
		if ui:button('Sample') then
			print('Sample!')
		end
		if ui:button('Button') then
			print('Button!')
		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

Building

Windows binaries are available for each release.

To build the library yourself, grab the code with:

$ git clone --recursive https://github.com/keharriso/love-nuklear.git

Next, you need to compile the code to a native Lua module.

Compiling with CMake on Linux

  1. First, ensure you have a C compiler and the cmake and luajit or lua51-luajit (for openSUSE) packages installed, as well as libluajit-5.1-dev (for Ubuntu/Debian), luajit-devel (for Fedora), or lua51-luajit-devel (for openSUSE) if your distro has one of these packages.
  2. Create a new folder next to love-nuklear called love-nuklear-build.
  3. Open a terminal inside love-nuklear-build.
  4. Compile the library with
$ cmake -DCMAKE_BUILD_TYPE=Release ../love-nuklear
$ make
  1. Locate nuklear.so in the build folder.

Via GNU Guix

LÖVE-Nuklear is also available as a Guix package, and can thus be directly downloaded and built via:

$ guix package --install love-nuklear

Compiling with CMake and MinGW on Windows

  1. Install CMake and MinGW or MinGW-w64.
  2. Download the source code for LuaJIT.
  3. Open a command window inside the LuaJIT folder (the one that contains "README").
  4. Compile LuaJIT with
$ mingw32-make
  1. Remember the path to lua51.dll inside the LuaJIT src folder.
  2. Run the CMake GUI.
  3. Click "Browse Source" at the top right, then select the love-nuklear folder.
  4. Enter a path for the build folder. It should be separate from the source folder.
  5. Press "Configure" at the bottom.
  6. Select "MinGW Makefiles" from the generator drop list, then click "Finish".
  7. You should receive an error. This is normal.
  8. Open the LUA tree by clicking the triangle on the left.
  9. Replace "LUA_INCLUDE_DIR-NOTFOUND" with the path to the LuaJIT src folder.
  10. Replace "LUA_LIBRARY-NOTFOUND" with the path to lua51.dll inside the LuaJIT src folder.
  11. Click "Generate" at the bottom.
  12. Open a command window inside the build folder.
  13. Compile with
$ mingw32-make
  1. Locate nuklear.dll inside the build folder.

Compiling with CMake and MSVC on Windows

  1. Install CMake and Visual Studio. Community or Express edition is sufficient.
  2. Download the source code for LuaJIT.
  3. Open a Visual Studio Command Prompt (x86 or x64 depending on what architecture you need) and set the current directory to the LuaJIT folder (the one that contains "README"). Also remember this path.
  4. At the VS Command Prompt, set your current directory to src then execute msvcbuild.bat. This will create lua51.dll, lua51.lib, and luajit.exe
  5. Now open new command prompt window inside the love-nuklear folder.
  6. Type set "LUA_DIR=<path to directory at step 3>"
  7. Then type cmake -Bbuild -H. -A Win32 -DLUA_INCLUDE_DIR=%LUA_DIR%\src -DLUA_LIBRARY=%LUA_DIR%\src\lua51.lib -DCMAKE_INSTALL_PREFIX=%CD%\install. If you previously compile LuaJIT using x64 VS command prompt, replace Win32 with x64 at above command.
  8. Then type cmake --build build --config Release --target install and you'll found nuklear.dll inside "install" folder.

Documentation

A complete description of all functions and style properties, alongside additional examples, is available at the LÖVE-Nuklear wiki.

License

Copyright (c) 2016 Kevin Harrison, released under the MIT License (see LICENSE for details).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].