LogoPixi’VN

Gestione degli assets in ink

As explained in more detail here, it is recommended to initialize the asset matrix at project start and load the assets and think about when the assets should be loaded.

On ink you have less control than in Javascript/Typescript over how and when to load assets. On ink, pixi-vn provides a single function that load assets before a label starts.

La sintassi è la seguente:

# + [operation] + [assets or bundle] + [list of URL/path of the image]

  • #: It is a special character used by ink syntax for use a special script.
  • [operation]: It is the operation that you want to do. The available operations are:
    • load: It loads with await the assets or bundle (Assets.load or Assets.loadBundle).
    • lazyload: It loads the assets or bundle in the background (Assets.backgroundLoad or Assets.backgroundLoadBundle).
  • [assets or bundle]: It is the type of asset that you want to load. The available types are:
    • assets: It loads the assets.
    • bundle: It loads the bundle.
  • [list of URL/path of the image]: It is the list of URL/path of the images that you want to show. Se hai inizializzato la matrice delle risorse, puoi utilizzare l'alias della texture. Tieni presente che per scrivere https:// in ink devi usare https:\/\/ perché // è considerato un commento in ink.
=== start ===
# lazyload bundle main_menu start
# load assets eggHead flowerTop my_video
# show image eggHead
# show image flowerTop
# show video my_video
# pause
-> start