Server assets

BookServer

Preparation

Later the script file(copy_pages.bat, copy_pages.command) will put it into the image folders of pages. build4/assets/images/p##/copyright.txt. After published your project, you can use copy_pages.bat(WIN) or copy_pages.command(MAC)

For Episode02 * build4/assets/images/p4 * build4/assets/images/p5 * zip the image files of Episode2-1 and Episode2-2 together as Episode02/assets.zip. The zip contains copyright.txt and image files.

Episode02/assets.zip

assets
    └──images
        ├── p4
        │   ├── copyright.txt
        │   ├── layer_1.png
        │   ├── layer_1@2x.png
        │   └── layer_1@4x.png
        └── p5
            ├── copyright.txt
            ├── layer_1.png
            ├── layer_1@2x.png
            └── layer_1@4x.png

For Episode03 * build4/assets/images/p6 * zipping the image files of Episode3 as Episode03/assets.zip

Episode03/assets.zip

    assets
        └─images
            └─p6

After the project published, run copy_pages.bat(WIN), copy_pages.command(MAC) and the zip files are created in BookServer folder.

Then please put them on a http server.

In the sample BookSever folder, the path is like this

\Bookshelf

the host url and path are defined in tmplt/components/store/model.lua

local YourHost  = "http://localhost:8080"
M.URL           = YourHost.."/bookShelf/"
M.backgroundImg = "bg.png"

Run copy_pages script

After the kwik project is published, please run the copy_pages.bat(WIN) or copy_pages.command(MAC) to make the asset zip files.

You need to edit the script file for the episode name with the properties. For instance, Episode02 consists of page4 and page5, Episode03 is page6. You need to write the following codes to tell the script which ones to be copied from BookShelfPages project.

copy_pages.bat (WIN)

call :MyCopy Episode02 4
call :MyCopy Episode02 5
call :MyCopy Episode03 6

copy_pages.command (MAC)

MyCopy Episode02 4
MyCopy Episode02 5
MyCopy Episode03 6

WIN, type and hit enter key

cd ~/Documents/Kwik/BookServer
copy_pages.bat

MAC, type and hit enter key

cd ~/Documents/Kwik/BookServer
source copy_pages.command

please put the zip files to your http server that you have set in store/model.lua

tmplt/components/store/model.lua

local YourHost  = "http://localhost:8080"
M.URL           = YourHost.."/bookShelf/"
M.backgroundImg = "bg.png"

After copy_pages script is used, the image folders of the episodes are removed from build4/assets/images.