Download Now
Forums

    Reference Codebot.Render.Assets.pas

    Part of the Codebot Render package

    The Codebot.Render.Assets unit finds the assets of your program, the fonts, images, sounds, and other files it loads while it runs. An asset is named by its path below the assets folder, with forward slashes, such as fonts/roboto.ttf. On macOS the folders above your program are searched for the assets folder too.

    Normally assets are files in the assets folder beside your program. If you set an AssetKey on your host, your program keeps its assets in one dat file beside it instead, named after the program, such as cardgames.dat, whenever that file is there. An asset that isn't in the dat file is still looked for in the assets folder. Every byte of a dat file is changed with xor by the four bytes of the key, so it can't be read without the key. Your program builds its own dat file when you start it with --build-dat, which the hosts handle before opening a window.

    AssetOpen opens an asset from either place as a stream, AssetExists tells you whether there is one, and AssetText reads one as text. The canvas, textures, and audio each have a method that loads from an asset by name.

    Items 18 items

    NameKindLine
    AssetBuildRequestedfunction121
    AssetBuildSwitchconstant57
    AssetExistsfunction94
    AssetFindFilefunction89
    AssetFindFolderfunction91
    AssetFoldervariable65
    AssetKeyvariable63
    AssetNotFoundprocedure104
    AssetOpenfunction97
    AssetPackActivefunction82
    AssetPackBuildfunction109
    AssetPackDatafunction86
    AssetPackFileNamefunction80
    AssetProgramFileNamefunction78
    AssetRequirefunction100
    AssetTextfunction102
    AssetXorprocedure75
    EAssetErrorclass53