Download Manager V2
Compress Assets
In BookServer folder, you find compress_assets/main.lua for the simulator to make the zip and json files of a book

compress_assets/main.lua
local command = require("compress_assets") command.setServerFolder("win32", "hokkaido") -- macOS command.compress("Spring", "en") --command.updateAsset("Spring", "en", "videos") native.requestExit()
BookSever
the assets of a book project looks like this. It is generated by compress_assets/main.lua
Spring en
p1 folder
assets.json
[ { "page": 1, "images": { "date": 1599452612, "size": 3653058 } }, { "page": 2, "images": { "date": 1599452616, "size": 1633125 } },
page1.json
{ "page":1,"alias":"page1","isTmplt":false, "audios":["lame.wav"], "read2me":[ {"foldername":"data", "filenames":["read.mp3","to.mp3","me.mp3","word.mp3", "by.mp3","word.mp3","audio.mp3"] }], "videos":["kwikplanet.mp4"], "PNGs":["elephant"], "sprites":["butflysprite@4x.png", "butflysprite@2x.png","butflysprite.png"], "particles":[ {"filename":"air_stars.json","PNG":"air_stars.png"}], "WWW":[ {"filename":"index.html","foldername":"img"}], "thumbnails":["p1_thumb@4x.png","p1_thumb@2x.png","p1_thumb.png"], "images":["layer_1@4x.png", "layer_1@2x.png", "layer_1.png"], "shared":["shared@4x.png", "shared@2x.png", "shared.png"] }
Changes in Kwik Panel
Sync Audio and Text:word audio
When Enable word clicking, you can specify the folder of audio files for words.
Web View Replacement
When local file is enabled, you can specify the folder to be included
These assets are copied to build4 folder if export image ON.
- Spritesheet
- Word audio
- Video
- Video
- use pngs
- Particles
Web View
you may select a layer in Layer panel and hold shift key to publish with export image OFF for the selected layer to export the images/the assets
Changes in Kwik Shelf Plugin
plugin folder
- KwkShelf
KwikShelf.lua
TOC/components/store/model.lua
M.downloadManager = “V2” – should be enabled. If not, it behaves as it was before.
extlib/spinner.lua
updateText
- startTime: the start time of a book download
- size: the size in progress
- bookSize:the total size of assets of a book
function obj:updateText() local percent = self.size/self.bookSize local sec = os.difftime( os.time(), self.startTime) local remain = math.floor(sec * (1.0/percent)) local time = os.date("*t", remain) self.spinnerText.text = math.floor(percent*100).." % (" ..self.size .."/" ..self.bookSize .." Mb) \n left " ..time.min..":"..time.sec end
extlib/maker.lua
this maker appears if an update of assets is available. If a previous download process is interrupted, it is treated as an update available.
new
- button: the download button in the dialog or the image object in the thumbnail of TOC page
- group is a sceneGroup of composer
function M.new (button, group) --print(button, group) if button.updateMark == nil then local obj = display.newCircle(0,0,4) obj.x = button.x + button.width/2 obj.y = button.y - button.height/2 obj:setFillColor(1,0,0) group:insert(obj) button.updateMark = obj else button.updateMark.alpha = 1 end end