Last Modified: 2023-03-11

Bookstore

TODO

Bookstore app contains the multiple kwik projects(books) inside. The lua files of each book are embedded in the app binary but the assets such as images, audio files of each book are not embedded in the app binary. They are downloadable from a web server. Due to Apple’s regulation, Solar2D does not allow to load the lua files (programming code) via Internet. The lua files must be embedded in the app binary but the other assets can be transfered from http server to the app.

A library page controls which book to be loaded with In App Purchase. User clicks a book icon on thubnail view on a library page, and a purchase dialog appears if user wants to buy one. A project called bookTOC(Table Of Content) contains library.psd and dialog.psd

When you like to add new books, you need to update the model.lua of bookTOC to include a new book information.

You can create as many as books but Bookstore is not designed to hold hundreds of books.


Sample file

Please download the sample project from here.

  Photoshop
   ├── bookFree
   │   ├── page1.psd
   │   └── page2.psd
   ├── bookOne
   │   ├── page1.psd
   │   └── page2.psd
   └── bookTOC
       ├── dialog.psd
       └── library.psd

  Solar2D
    ├── App
    │   ├── bookFree
    │   ├── bookOne
    │   └── bookTOC
    │
    ├── components
    |    ├── bookstore
    |        └── model.lua
    └── main.lua

  BookServer
    ├── compress_assets
    |       └── main.lua
    └── bookstore
        ├── bookFree
        └── bookOne

BooKServer

Solar2D


Solar2D

Solar2D project has main.lua in the root directory.

    ├─App
    │  ├─book01
    │  ├─book02
    │  └─bookTOC
    ├─extlib
    ├─lib

    build.settings
    config.lua
    main.lua

bookTOC

library.psd shows the thumbnail of books and the buttons for purchase and download

dilaog.psd shows a book image and the IAP buttons and information text


bookFree


bookOne

page1.psd


BookServer

Please use the script to zip the image, audio files as zip files