ktx.assets.files.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktx-assets Show documentation
Show all versions of ktx-assets Show documentation
LibGDX assets management utilities for Kotlin applications.
The newest version!
@file:Suppress("NOTHING_TO_INLINE")
package ktx.assets
import com.badlogic.gdx.Files.FileType
import com.badlogic.gdx.Files.FileType.Internal
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle
/**
* @return [FileHandle] instance pointing to a classpath file. Its path matches this string.
*/
inline fun String?.toClasspathFile(): FileHandle = Gdx.files.classpath(this)
/**
* @return [FileHandle] instance pointing to an internal file. Its path matches this string.
*/
inline fun String?.toInternalFile(): FileHandle = Gdx.files.internal(this)
/**
* @return [FileHandle] instance pointing to a local file. Its path matches this string.
*/
inline fun String?.toLocalFile(): FileHandle = Gdx.files.local(this)
/**
* @return [FileHandle] instance pointing to an external file. Its path matches this string.
*/
inline fun String?.toExternalFile(): FileHandle = Gdx.files.external(this)
/**
* @return [FileHandle] instance pointing to an absolute file. Its path matches this string.
*/
inline fun String?.toAbsoluteFile(): FileHandle = Gdx.files.absolute(this)
/**
* @param path the path of the requested file.
* @param type type of the requested file. Defaults to [FileType.Internal].
* @return [FileHandle] instance pointing to a file with the selected path and type.
*/
inline fun file(path: String, type: FileType = Internal): FileHandle = Gdx.files.getFileHandle(path, type)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy