getOptions

Read options of the given resource.

@safe
getOptions
(,
string path
)

Parameters

pack Pack

Pack to read from.

path string

Relative path to the resource.

Return Value

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