This is an old revision of the document!


Using AssetsManager

The AssetsManager is the core component in effective media management inside your Gorilla3D application.

Models, textures, audio and so on will be cached for faster access and reusage. You can build packages within the AssetsManager for modular media management.

For example: you could build a package for the main character and reference to it in every scene package. Scene packages are extremly useful for compact and fast loading of all data of a specific scene.

Package

An assets package is the management unit to handle groups and their attached assets. It is allowed to store a package as zip-archive or to use as in-memory package.

Groups

Each package provides a number of fixed group entries to organize media content.

  • GORILLA_ASSETS_MODEL
  • GORILLA_ASSETS_TEXTURE
  • GORILLA_ASSETS_AUDIO
  • GORILLA_ASSETS_VIDEO
  • GORILLA_ASSETS_MISC
  • GORILLA_ASSETS_DIALOGUE
  • GORILLA_ASSETS_INVENTORY

Assets

A media file is represented as extended TGorillaAsset instance inside in a specific group in an assets package. Depending on the media type the asset holds the data.

TGorillaModelAsset

Uses the internal model format TModelDef to hold data in memory, but when writing those to the zip-package it stores alle model data as *.G3D file.

TGorillaTextureAsset

Holds the texture as TBitmap in memory, but writes as bmp, jpg or png to zip-package.

TGorillaAudioAsset

TGorillaVideoAsset

TGorillaMiscAsset

TGorillaDialogueAsset

TGorillaInventoryAsset

DesignTime

You can find the TGorillaAssetsManager component in the toolbar. Simply drag and drop onto your form.

In the next step we need to create a new package in “Packages” property by the Delphi collection editor.

Example

Alternatively you can create the assets manager and packages at runtime.

Form1.pas
  FAssetsManager := TGorillaAssetsManager.Create(Self);
  FAssetsManager.AddEmptyPackage(GORILLA_PACKAGE_DEFAULT);