[APIs/Libraries/Resources] Things4Löve2D
Posted: Sun Sep 20, 2015 6:09 am
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
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)
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:
Some closed GUIs: (minimized)
Download: Direct LinkFeatures:
Current Features:Planned 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%)
- 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:Creating a Gui:Code: Select all
require "guis"
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)Code: Select all
tutorial = guis.create("Tutorial")
So, at this point if we run this "code" you should be getting an because we didn't configure the gui. To do this you'll need this:Where:Code: Select all
tutorial:setup("Gui4Löve2D",450,70,80,400,20,"red","blue","gold","green")
Then if we run this code (with the other above ¬¬') we should get this "nice" looking GUI:
- 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")
You'll be saying: "But that's not a gui, its just a rectangle of color"
And I'll answer: "Just right click it..."
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:Where:Code: Select all
tutorial:addelement("label",{kind = "label", x = 5, y = 25, col="lgray" ,text = "This Element is a Label"})
If we run this, we should get something similar to this:
- "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
To be Continued...
Utils4Löve2D
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 LinkFeatures:
Current Features:Planned 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)
- 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
Character Range:Code: Select all
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]\"_<>|äëïöüáéíóúàèìòù¨âêîôû^~ÄËÏÖÜÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛ