Pack.getOptions

Read options of the given resource.

struct Pack
const
getOptions
(
string res
)

Parameters

res string

Relative path to the resource.

Return Value

Type: const(ResourceOptions)*

A pointer to the resource's options.

Examples

// Load the pack
auto pack = getPack("res/samerion-retro/pack.json");

// Check root options
const rootOptions = pack.getOptions("");
assert(!rootOptions.interpolate);
assert(rootOptions.tileSize == 32);

// Check if getOptions correctly handles resources that don't have any options set directly
assert(pack.getOptions("cells/grass") is pack.getOptions("cells/grass/not-existing"));

Meta