Assets

Assets

TBI

https://www.kwiksher.com/doc/kwik_tutorial/interactions/drag_kwikcatpuzzle/


model

  UI.editor.assets = {
    audios = {
      {
        name = "click.mp3",
        path = "audios/short",
        links = {{page = "page1"}}
      }
    },
    videos = {
      {
      name = "videoA.mp4",
      path = "videos",
      links = {{page= "page01", layers = {"layerOne"}}}
      },
      {
        name = "videoB.mp4",
        path = "videos",
        links = {{page= "page01", layers = {"layerTwo"}}}
        }
    },
    sprites = {}

  }

UI

TBI

  • displaying layer’s name(s) that is linked to each media
  • select a media and create a new layer with a replacement component
    • or layer selectbox to choose one for the replacement

Create a new layer with a selected media

  1. select filename

    preview video?

  2. select the icon on the top of asset table swith component view.

    Please select a layer for replacement or hold + key to add a new layer

    TODO if assetTable is open, don’t show layer props Table

    save button will add a layer as same as the filename w/o extension

    renaming a layer needs to update layerName_class.lua, models and the entry in layers table in index.lua. Use layer properties for renaming

  3. edit cotnrol props

    TODO hide the icons of assset table

    TODO update video props

  4. save button

    TODO


REST API

editor asset selectors.tree new, modiy, delete (hide filter for selectbox) show (doGet) > assetsTable

/book/assets
/book/assets/audios
/book/assets/audios/short
/book/assets/audios/long
/book/assets/audios/sync
/book/assets/images
/book/assets/sprites
/book/assets/videos
  • doPut

    assets audio, video, spritesheet, synctext

    fetch it from url

    openapi plugin whisper with timecode? ⭐️

    dummy assets from sample and rename to use it

  • doPost for an asset to preview?

    this needs a position to tell where to insert it in layers’tree so use

    POST /book/page/newLayer/?class=video
    
    file: video.mp4
  • save it to App/book/models/assets.json

    lfs to traverse files in asset folder except images. This table is also updated from replacement tools for instance, user selects a video replacement and choose a videoA.mp4 to layerOne on page1,

    • page1/layerA_video.json

    • assets.json from the lua table editor.assets

      {
        audios = {},
        fonts = {},
        -- images = {}
        particles = {},
        sprites = {},
        videos = {
          {
          name = "videoA.mp4",
          path = "videos",
          links = {{page= "page01", layers = {"imageOne"}},
                  {page= "page02", layers = {"iamgeTwo"}}}
          },
        },
      }

editor > assets

  • select

    videoA.mp4 layers = page1/layerOne, page2/layerTwo

    option only current page

  • add

    a new layer is added to index.lua with the asset class with deafult props on a current page

  • modify

    edit and save properties

  • delete

    remove layers, option to delete from a disk


BinaryArchive

https://github.com/siudesu/BinaryArchive

Bookstore tool

Use BookServer/compress_assets/main.lua