Skip to content

Looobay/LOVE2D-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LOVE2D-button

A simple library for creating buttons with LÖVE 2D.

Little warning:

This project is not finished yet so you may encounter some bugs !

Features:

  • Execute function on click
  • Can easily remove buttons with button:delete()
  • You can easily modify the code ! (because it is very lite)

How it's work:

  • First step, require the librarie :
button = require "button.lua"
  • Second step, adding button:new() to love.load(), button:update(dt) to love.update(dt) and button:draw() to love.draw().
function love.load()
  button:new(--Put your button here)
end

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

function love.draw()
  button:draw()
end
  • Third step, create your button in love.load() like this:
ExampleButton = {button:new(300, 150,150,100,{1,1,1}, "Example", {0,0,0}, function()print("Example")end, false)}

DONT FORGET !!! -> YOUR BUTTON IS A TABLE WITH THE button:new() INSIDE.

You can check the example folder to see an example LÖVE2D project with the librarie.

Result:

alt text

Other tips:

  • How to use the button:delete() function:
button:delete(ExampleButton)

About

A simple library for creating buttons with LÖVE 2D.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages