Skip to main content

FlixelPathsUtil

View source

class

org.flixelgdx.util.FlixelPathsUtil

public final class FlixelPathsUtil

Utility class for simplifying asset paths and libGDX FileHandles.

Methods

asset(String)

public static FileHandle asset(String path)

shared(String)

public static FileHandle shared(String path)

fontAsset(String)

public static FileHandle fontAsset(String path)

xmlAsset(String)

public static FileHandle xmlAsset(String path)

sharedImageAsset(String)

public static FileHandle sharedImageAsset(String path)

external(String)

public static FileHandle external(String path)

resolveAudioPath(String)

public static String resolveAudioPath(String path)

Resolves an internal asset path to an absolute filesystem path that the native audio backend can open directly.

When running from the IDE the working directory is the assets/ folder, so the raw relative path works as-is. When running from a packaged JAR the assets are embedded as classpath resources and native engines cannot open them by name. In that case the resource is extracted to a temp file on first call, and the temp file's absolute path is returned. Results are cached so repeated calls for the same path do not produce extra temp files.

Parameters:

NameDescription
pathThe internal asset path, e.g. "shared/sounds/foo.ogg".

Returns: An absolute filesystem path that the audio backend can open.

See Also: FlixelAssetManager.resolveAudioPath