Server Assets

BookServer

Preparation

After published your Book's projects, you can use compress_assets/main.lua

compress_assets/main.lua

local command = require("compress_assets")

command.setServerFolder("macos", "bookshelf")
--command.setServerFolder("win32", "bookshelf")

-- the name of Kwik project and the name of In App Purchase product
--
local books = {
    {project = "Book01", serverFolder = "book01"},
    {project = "Book02", serverFolder = "book02"},
}

-- Use Online Images needs an image file
--
local onLineImages = {
    {project = "Book01", serverFolder = "book01", image = "build4/assets/images/p1/bg@4x.png"},
    {project = "Book02", serverFolder = "book02", image = "build4/assets/images/p1/bg@4x.png"},
}

Notice: if the master app is set with multiple languaes, and Use Online Image is true, the book's thumbnail image is requested with lang ID. For instance,


http-server

Please prepare a http-server and put the contents of BookServer folder.

http-server

(base) ymmtnyMac:Kwik ymmtny$ cd BookServer
(base) ymmtnyMac:BookServer ymmtny$ http-server
Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8080
Hit CTRL-C to stop the server

Update an asset

compress_assets/main.lua has command.updateAsset function

--
-- update page1, videos 
--
local project      = "Book02"
local serverFolder = "book02"
local page         = 1
local type         = "images"

--   command.updateAsset(project, serverFolder, page, type)

--[[
    "audios"
    "read2me"
    "PNGs"
    "sprites"
    "particles"
    "WWW"
    "thumbnails"
    "images"
    "shared"
]] 

About Kwik

Kwik assets are stored in build4/assets folder

other modification of Layer replacements