https://github.com/potatojam/defold-html-loader
https://github.com/potatojam/defold-html-loader
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/potatojam/defold-html-loader
- Owner: potatojam
- License: mit
- Created: 2022-09-14T15:37:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-18T16:33:16.000Z (about 1 year ago)
- Last Synced: 2024-11-30T19:44:14.473Z (6 months ago)
- Language: Lua
- Size: 99.6 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-defold - HTML Loader
README
# HTML Loader for Defold
This extension adds a loading percentage with frame and a spinning circle in the corner. You can also change the background color and set the size for the splash image.

The circle will be hidden when the game is loaded.
You can show it again and add text with percentages. For example when you load resources with liveupdate.```lua
function init(self)
if html_loader then
html_loader.show()
html_loader.set_text("Loading")self.percent = 0
timer.delay(0.2, true, function(self, handle, time_elapsed)
self.percent = self.percent + 1
html_loader.set_progress(self.percent)
if self.percent == 100 then
timer.cancel(handle)
html_loader.hide()
end
end)
end
end
```## The `game.project` Settings
You can set these **optional** settings in `game.project`.
```ini
[html_loader]
background_size = 80%
background_color = rgba(255,255,255,1)
loader_main_color = rgba(26, 114, 235, 1)
loader_additional_color = rgba(26, 114, 235, 0.2)
loader_frame_color = rgba(255, 255, 255, 1)
```* `background_size` string _optional_ Overloads the splash image size value for ".canvas-app-canvas". None by default.
* `background_color` string _optional_ Overloads the background color value for ".canvas-app-canvas". None by default.
* `loader_main_color` string _optional_ The main color of the loader. Used in circle, progress bar and text. Default: **#1a72eb**
* `loader_additional_color` string _optional_ The additional color of the loader. Used in circle, progress bar. Default: **rgba(1, 1, 255, 0.2)**
* `loader_frame_color` string _optional_ Frame color around progress text. Default: **white**## Credits
Made by [PotatoJam](https://github.com/potatojam).
### License
MIT license