Skyline Lua API  Version 1.0
Lua Script Reference for Skyline Game Engine.
resource Class Reference

#include <LUA_API_Resource.h>

Public Member Functions

void prepareMesh (string meshName)
 Preload a mesh in the loading stages of a game before spawning. This will stop any pops as resources are loaded in during runtime. More...
 
void prepareMaterial (string materialName)
 Preload a material in the loading stages of a game before using or calling it. This will stop any pops as resources are loaded in during runtime. More...
 
void preparePreset (string presetName)
 Preload a preset and all associated resources such as meshes, skeletons, textures and material/ shaders. This will stop any pops as resources are loaded in during runtime. More...
 

Detailed Description

This area covers the resource preloading functions. Use as resource.function(); For more information on how these functions can be used please visit the User Manual - https://home.aurasoft-skyline.co.uk

To use these functions, you will need to activate the dynamic sky.

Member Function Documentation

void resource::prepareMaterial ( string  materialName)

Preload a material in the loading stages of a game before using or calling it. This will stop any pops as resources are loaded in during runtime.

When passing this name, it automatically looks and loads _adv and _deferred variations.

Parameters
materialName: The material name to load. This is the name that would exist inside a .material file

Here is a Small Example of how to use this function:

obj = 0;
function onInit(objID)
    obj = objID;
    resource.prepareMaterial("Proto_Blue");
end
void resource::prepareMesh ( string  meshName)

Preload a mesh in the loading stages of a game before spawning. This will stop any pops as resources are loaded in during runtime.

Parameters
meshName: The meshname to preload. The .mesh is required.

Here is a Small Example of how to use this function:

obj = 0;
function onInit(objID)
    obj = objID;
    resource.prepareMesh("Emitter.mesh");
end

-- call spawn routines in other functions etc...
void resource::preparePreset ( string  presetName)

Preload a preset and all associated resources such as meshes, skeletons, textures and material/ shaders. This will stop any pops as resources are loaded in during runtime.

Do not put .preset on the end as it is not required. Only .preset files are loaded, .xPreset file are for editor use only. .preset is a binary file and therefore faster to load.

This is useful to do in the onInit before spawning presets.

Parameters
presetName: The preset name to load all resources from.

Here is a Small Example of how to use this function:

obj = 0;
function onInit(objID)
    obj = objID;
    resource.preparePreset("myCharacter");
end

The documentation for this class was generated from the following file: