All Projects → qeffects → helium

qeffects / helium

Licence: BSD-2-Clause license
No description or website provided.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to helium

screenmanager
Stackable Screen/State Management for the LÖVE framework.
Stars: ✭ 29 (-60.81%)
Mutual labels:  love2d
synthein
A space ship building and combat game
Stars: ✭ 16 (-78.38%)
Mutual labels:  love2d
iqm-exm
IQM & EXM model format specs, Blender exporter, and LÖVE loader.
Stars: ✭ 35 (-52.7%)
Mutual labels:  love2d
drop
A LÖVE visualizer and music player
Stars: ✭ 17 (-77.03%)
Mutual labels:  love2d
Emmy-love-api
LÖVE2D API
Stars: ✭ 36 (-51.35%)
Mutual labels:  love2d
sOS
Solar Operating System - The ASCII OS nobody asked for.
Stars: ✭ 11 (-85.14%)
Mutual labels:  love2d
RetroLove
A collection of simple games built with the LOVE game framework.
Stars: ✭ 13 (-82.43%)
Mutual labels:  love2d
bump-3dpd
A 3D collision detection library for Lua.
Stars: ✭ 59 (-20.27%)
Mutual labels:  love2d
batteries
Reusable dependencies for games made with lua (especially with love)
Stars: ✭ 194 (+162.16%)
Mutual labels:  love2d
lovelive
💕 Live coding framework for LÖVE(2D Game Engine)
Stars: ✭ 27 (-63.51%)
Mutual labels:  love2d
LoveNES2D
NES emulator for Love2D
Stars: ✭ 23 (-68.92%)
Mutual labels:  love2d
lua-namegen
Lua Name Generator
Stars: ✭ 48 (-35.14%)
Mutual labels:  love2d
catui
A very light-weight GUI library for the Löve2D
Stars: ✭ 84 (+13.51%)
Mutual labels:  love2d
logivi
Git visualisation software written in Lua.
Stars: ✭ 16 (-78.38%)
Mutual labels:  love2d
love-atom
Smart autocompletion for the LÖVE framework in Atom.
Stars: ✭ 34 (-54.05%)
Mutual labels:  love2d
Helium.js
Automating Universal React Applications
Stars: ✭ 63 (-14.86%)
Mutual labels:  helium
helium
Helium is a small, simple, modular constructor with some pre-built components for your convenience.
Stars: ✭ 67 (-9.46%)
Mutual labels:  helium
learn2love
Book for learning programming with Lua and LÖVE.
Stars: ✭ 34 (-54.05%)
Mutual labels:  love2d
Love-Debug-Graph
An fps/memory/misc graph utillity for Löve2D
Stars: ✭ 29 (-60.81%)
Mutual labels:  love2d
shaderview
A GLSL shader development tool for the LÖVE game framework.
Stars: ✭ 22 (-70.27%)
Mutual labels:  love2d

alt text

Helium

Helium main menu demo

a main menu demo made with helium, in action, find it here

Basic overview:

Helium is practically more like a UI framework than a fully fledged UI library. The idea is to build custom and build simple.

Getting started:

Load helium with local helium = require 'helium' or check out the pre-configured demo repository

The structure of an element's function is:

function(param, view)
	--State/setup/load
	return function()
		--Rendering zone
	end
end

and you can make that function into an element 'factory' like this:

elementCreator = helium(function(param, view)

	return function()

	end
end)

then you call the element factory with a table of parameters that will get passed to the element and optionally width and height:

element = elementCreator({text = 'foo-bar'}, 100, 20)

this will create a new instance of the element, and then you can draw it to whatever position you wish (x, y):

element:draw(100, 100)

A quick detour in to 'scenes' which are a collection of elements to be drawn onscreen

A scene is necessary to start drawing elements, so let's create one like this and set it to active:

local scene = helium.scene.new(true)
scene:activate()

Then you can draw and update the scene in love's functions:

function love.update(dt)
	scene:update(dt)
end

function love.draw()
	--drawn below the ui element
	scene:draw()
	--drawn above the ui elements
end

Let's draw a rectangle with text with the previous skeleton and functions:

local helium = require 'helium'
local scene = helium.scene.new(true)
scene:activate()

local elementCreator = helium(function(param, view)

	return function()
		love.graphics.setColor(0.3, 0.3, 0.3)
		love.graphics.rectangle('fill', 0, 0, view.w, view.h)
		love.graphics.setColor(1, 1, 1)
		love.graphics.print('hello world')
	end
end)

local element = elementCreator({text = 'foo-bar'}, 100, 20)
--Needs to be called only once, to draw and then :undraw to stop drawing it onscreen
element:draw(100, 100)

function love.update(dt)
	scene:update(dt)
end

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

As you can see, you can use regular love.graphics functions inside the element's rendering function, furthermore you don't have to worry about coordinates, as x:0,y:0 inside the element's rendering function will always be the element's onscreen x,y, and the element's dimensions are passed in the view table.

Also whatever you pass to the factory here

local element = elementCreator({text = 'foo-bar'}, 100, 20)

is accessible in the param table like so:

local elementCreator = helium(function(param, view)
	return function()
		love.graphics.setColor(0.3, 0.3, 0.3)
		love.graphics.rectangle('fill', 0, 0, view.w, view.h)
		love.graphics.setColor(1, 1, 1)
		love.graphics.print(param.text)
	end
end)

View the resulting hello world repository here

Or continue on to the State and Input guide: Here
If you are using gamestates, scene guide will be of interest: Here
For a more general overview of the whole library: Module index

Also check out the helium configuration values: Config

There's also a main menu example project available here: Project

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].