Put Them Together - Bookshelf

BookShelf Overview

Terms

Project setting

For Each book project or TOC project, Ultimate configuration of Kwik4 is default. New Universal or other configuration of Kwik3 are not supported.

Project properites - Book Shelf Project


BookShelf.zip contains the following project folders. Book01 and Book02 projects are shared for BookShelfEmbedded and BookShelfTmplt.

https://kwiksher.com/tutorials/Kwik4/BookShelf.zip

BookShelfPages

A single Kwik project contains multiple episodes. the page asset of each episode is downloadable.

1 Shelf.psd table of contents, user to read an episode or to purchase an episode free
2 ep01.psd Episode01 free
3 ep02_info.psd Episode02 Purchase Information free
4 ep02_1 Episode02-1 paid
5 ep02_2 Episode02-2 paid
6 ep03 Episode03 paid

BookShelfEmbedded

Multiple Kwik projects are bundled with KwikShelf plugin. BookTOC project shows the thumbnail of books. BookTOC and Book{Num} projects are compiled with KwikShelf plugin. The assets of Book{Num} are downloadable.

1 Shelf.psd table of contents for books
2 INFO.psd a Book’s Info is loaded
1 page1.psd
2 page2.psd
3 page3..psd
..

BookShelfTmplt

the master project consists of TOC, INFO and template scenes. The assets from a Book project are loaded to the master project. Each page of a Book project is associated with one of the template scene of the master.

1 Shelf.psd table of contents for books
2 INFO.psd a Book’s Info is loaded
3 title.psd template scene for book’s title page
4 pageA template scene A
5 pageB template scene B
6 pageC template scene C
1 page1.psd loaded to title scene
2 page2.psd loaded to scene A
3 page3..psd loaded to scene B
..

after published, build4/model.lua must be edited for the pages to be associated with the template scene of the master . The detail is described in Tmplt - Book. This model.json tells which tmplt page of the master is associated with a page of Book{num} project


BookServer - Utility to make assets.zip

the following files are used to produce the assets.zip files by zipping, copying&pasting the expected folders. You need to edit each file manually to assign a episode or book name to the variable of scripts

copy_pages for pages

fol=./_book/tutorials/Kwik4/Bookshelf
proj=~/Documents/Kwik/BookshelfPages
...
...
MyCopy Episode02 4
MyCopy Episode02 5
MyCopy Episode03 6

compress_assets for embedded

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

local books = {
    {project = "Book01", serverFolder = "book01"},
    {project = "Book02", serverFolder = "book02"},
}

copy_books for tmplt

fol=./_book/tutorials/Kwik4/Bookshelf

MyCopy Book01 book01
MyCopy Book02 book02

these files above are mainly used after each project is published and compress PNGs are done. The details are described in the sub sections of this document.


Summary


Notes

please read the following information on Monetization and IAP setting&testing.

Kwik' bookshelf implementation does not have a server-side receipt verification. By adding external codes of your own, you may send a product ID and a user unique ID to your server that manages the receipt verification with Apple/Google/Amazon service and controls the downloadable contents.

these Solar2D APIs are not used in Kwik' bookshelf implementation currently. You may add external codes for them. Or please contact me for the feature request if you need them.