Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itzkiwisky/andromeda
A simple asset database and loader
https://github.com/itzkiwisky/andromeda
Last synced: 2 months ago
JSON representation
A simple asset database and loader
- Host: GitHub
- URL: https://github.com/itzkiwisky/andromeda
- Owner: itzKiwiSky
- License: mit
- Created: 2024-07-22T12:20:56.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-07-22T12:55:46.000Z (6 months ago)
- Last Synced: 2024-09-01T08:06:10.581Z (5 months ago)
- Language: Lua
- Size: 131 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![alt text](andromeda_logo.png)
# Andromeda
A simple asset database and loader.
Is simple and super customizable, allowing you to change the loading screen style.It can load audio files, images and video recursivly
## Usage
Basic usage
```lua
function love.load(args)
-- importing the library --
andromeda = require 'andromeda'-- initialize a new database --
assetdb = andromeda.newDB()-- queue the search --
assetdb:queueLoad("assets/images")
-- begin with the importing and displaying the loading screen --
assetdb:initialize()
endfunction love.draw()
love.graphics.print("All assets loaded", 90, 90)
end
```## adding a new loading screen
To add a new loading screen, the external file must follow this template:
```lua
return {
create = function(path)
-- this function is used to define variables that will be used during the loading screen display --
-- like images ---- the "path" parameter is used internally to get the current path of the library --
-- it can be ignore by the final user --
end,
present = function(progress, max)
-- this function is used to actually draw the loading content in the screen --
-- all the images defined by the create function can be used here --
-- the "progress" parameter is used to track the current item count --
-- the "max" parameter always will return the total item count --
-- it can be used to create custom progress bars, progress percentage, etc. --
end
}
```after creating the file, now you can import it to the loader
```lua
function love.load(args)
andromeda = require 'andromeda'assetdb = andromeda.newDB()
assetdb:setPreloadScreen("myCustomScreen.lua")
-- all loading stuff --
end
```---
Check the demo main.lua file to see the actual use.
# License
This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See [LICENSE](LICENSE) for details.