[APIs/Libraries/Resources] Things4Löve2D

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
armisius
Prole
Posts: 10
Joined: Fri Aug 21, 2015 5:57 pm

[APIs/Libraries/Resources] Things4Löve2D

Post by armisius »

Things4Löve2D ~ In heavy development
In this topic I will be posting some interesting APIs and Libraries that I'm working on, also resources and fonts, some of the contents are not mine, so, if I mention or upload some I will put the author's page with it. As most of the APIs/Libraries are in development, there are lot of planned features, and therefore lots of updates (yay!). Let me know what you think about this, and most important, comment, post things you'll want to see here
Gui4Löve2D ~ Uses Utils4Löve2D (but I'll make it standalone later)
Image
Gui4Löve2D is a Library/API that implements windows based Guis (yes, like Windows(tm) is.) is really easy to use, to setup, and (obviously) to add to your project. You can edit them to contain certain elements, and customize their colors (also the GUI's colors), you can hide them, and even minimize them!
Some open GUIs with elements:
Image
Some closed GUIs: (minimized)
Image
Download: Direct Link
Features:
Current Features:
  • Create Guis
  • Minimize Guis (right click toggles the GUI)
  • Detect Selected Gui
  • Movable Guis (no shitty self.x = mouse.x)
  • Customize Gui's Colors
  • Add Customizable Labels
  • Add Customizable Buttons (95%)
Planned Features:
  • Add Sliders
  • Add Images
  • Add Input Text Fields
  • Make Buttons nicer
How To :D
To get involved with these guis, download the Lib/API, don't forget to download also Utils4Löve2D.
Importing Gui4Löve2D:

Code: Select all

require "guis"
Creating a Gui:

Code: Select all

tutorial = guis.create("Tutorial")
Where "Tutorial" is the index name of the GUI (it is for the automation code, you'll not need this in any other piece of code)

So, at this point if we run this "code" you should be getting an Image because we didn't configure the gui. To do this you'll need this:

Code: Select all

tutorial:setup("Gui4Löve2D",450,70,80,400,20,"red","blue","gold","green")
Where:
  • tutorial is where you saved the gui, remember? you'll be using it, so memorize it!
  • "Gui4Löve2D" is the title of the GUI
  • 450 is the width of the GUI
  • 70 is the height of the GUI
  • 80 is the x position in the screen
  • 400 is the y postion in the screen
  • 20 is the height of the control bar
  • "red" is the background of the GUI ~ OPTIONAL (DEFAULT IS "lgray")
  • "blue" is the control bar's background color ~ OPTIONAL (DEFAULT IS "gray")
  • "gold" is the color of the control's bar when dragging the GUI ~ OPTIONAL (DEFAULT IS "yellow")
  • "green" is the color of the title of the GUI ~ OPTIONAL (DEFAULT IS "white")
Then if we run this code (with the other above ¬¬') we should get this "nice" looking GUI:
Image
You'll be saying: "But that's not a gui, its just a rectangle of color"
And I'll answer: "Just right click it..."
Image
And there is your very first (and empty) GUI, you can move it with left mouse button and... not so much, yet.

Yay! we got the first part, lets move on, elements!

So, you want to your gui to be more alive uh? Thats why I'm here, to teach you the magic of the:

Code: Select all

tutorial:addelement("label",{kind = "label", x = 5, y = 25, col="lgray" ,text = "This Element is a Label"})
Where:
  • "label" is the name of the element.
  • {
    • kind is the type of the element ("label" / "button")
    • x is the position, RELATIVE to the GUI
    • y is the position, RELATIVE to the GUI
    • col is the color of the (in this case) text
    • text is the text to display
    }
If we run this, we should get something similar to this:
Image
To be Continued...
Utils4Löve2D
Image
Utils4Löve2D is a Library/API for the ones that code so hard they need functions for every line of code, this implements lot of functions to ease the "coding"
Download: Direct Link
Features:
Current Features:
  • Print every value of a table as text in a new line. utils.multiprint(list,x,y,col)
  • Show a message box with custom Label and Title. utils.msgbox(str,title)
  • Returns a table { x, y } with the mouse positions. utils.getm()
  • Draw a coloured rectangle. utils.drawrec(x,y,width,height,col)
  • Check if the given position is in the given area. utils.posinarea(x,y,areax,areay,areaxx,areayy)
  • Remove the extension of files (file.png >> file). utils.trimext(filename)
  • Returns the working directory. utils.work_dir()
  • Scans a dir for folders or files. utils.scandir(path,scan_type)
  • Converts a string in a table with the specified separator (99%). utils.stt(string)
  • Converts a string in a rgb code ("red" >> {255,0,0}). utils.ttrgb(string)
  • Draws a previously indexed image. utils.drawimage(image)
  • Print given information as text with custom color in a given position. utils.print(input,x,y,col)
  • Converts a table to a string separated by user given separator. utils.tts(table,separator)
Planned Features:
  • Print text with a bounding box so, if the text reachs the character limit, makes a new line (80%).utils.boxprint(text,x,y,width,col)
  • A "complete" dictionary of colors (3%)

    Code: Select all

    --CURRENT COLORS
    colors = {
      red = {255,0,0},
      green = {0,255,0},
      blue = {0,0,255},
      white = {255,255,255},
      black = {0,0,0},
      gray = {111,111,111},
      lgray = {150,150,150},
      yellow = {255,255,0},
      orange = {255,130,0},
      lblue = {64, 100, 255},
      lred = {255, 79, 79},
      brown = {165,42,42},
      gold = {255,215,0},
      purple = {128,0,128},
    }
Resources4Löve2D
This section I'm reserving it to post good art that I managed to get with author's permission.
From Neorciseisgood

Art Style: Pixel Art / 2D Sidescroller ~ They're not animated
Sprite Cantity: 1400
Sprite About: Birds / Containers / Flowers / Food / Foreground / Fungi / Furniture / Glassware / Heroes / Manga & Anime / Plants /Super Smash Brothers 4 / Tools / Weapons
Sprite Gallery: DevianArt
Packed Files: Direct Link~2.87 MB
Modifications that I made
Art Style: Font
Art From: Löve2D Wiki
Sprite Cantity: 1
Image
Character Range:

Code: Select all

 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]\"_<>|äëïöüáéíóúàèìòù¨âêîôû^~ÄËÏÖÜÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛ
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: [APIs/Libraries/Resources] Things4Löve2D

Post by ivan »

Gui is a ton of work to do well so I have no good suggestions there. As for the utils4love lib I think you need a specific direction. The point of a lib is to perform a very specific task so you can reuse it. Looking at the functions I see drawing code string manipulation - it looks more like a collection of code rather than a lib. It's a start though so keep workinf on it. :)
armisius
Prole
Posts: 10
Joined: Fri Aug 21, 2015 5:57 pm

Re: [APIs/Libraries/Resources] Things4Löve2D

Post by armisius »

ivan wrote:Gui is a ton of work to do well so I have no good suggestions there. As for the utils4love lib I think you need a specific direction. The point of a lib is to perform a very specific task so you can reuse it. Looking at the functions I see drawing code string manipulation - it looks more like a collection of code rather than a lib. It's a start though so keep workinf on it. :)
Yeah, I know, the "GUI" needs a lot of work that I'm on, but a few days ago I went on vacations and I couldn't keep working on it, but as I return to my computer, I'll update everything.
Post Reply

Who is online

Users browsing this forum: No registered users and 151 guests