VfsFile

data class VfsFile(val vfs: Vfs, val path: String) : VfsNamed

A virtual file or directory on a file system.

Author

Colton Daily

Constructors

Link copied to clipboard
fun VfsFile(vfs: Vfs, path: String)

Functions

Link copied to clipboard
inline suspend fun <T> decodeFromString(): T
Link copied to clipboard
operator fun get(path: String): VfsFile
Link copied to clipboard
Link copied to clipboard
suspend fun read(): ByteBuffer
Link copied to clipboard
suspend fun readBytes(): ByteArray
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun readLines(): List<String>
Link copied to clipboard
Link copied to clipboard
suspend fun readString(): String
Link copied to clipboard
fun relativePathTo(relative: VfsFile): String?
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val pathInfo: PathInfo
Link copied to clipboard
Link copied to clipboard
val vfs: Vfs

Extensions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Loads a TextureAtlas from the given path. Currently, supports only JSON atlas files.

Link copied to clipboard
actual suspend fun VfsFile.readAudioClip(): AudioClip

Loads audio from the path as an AudioClip.

expect suspend fun VfsFile.readAudioClip(): AudioClip

Loads audio from the path as an AudioClip.

actual suspend fun VfsFile.readAudioClip(): AudioClip

Loads audio from the path as an AudioClip.

actual suspend fun VfsFile.readAudioClip(): AudioClip

Loads audio from the path as an AudioClip.

Link copied to clipboard
actual suspend fun VfsFile.readAudioStream(): AudioStream

Streams audio from the path as an AudioStream.

expect suspend fun VfsFile.readAudioStream(): AudioStream

Streams audio from the path as an AudioStream.

actual suspend fun VfsFile.readAudioStream(): AudioStream

Streams audio from the path as an AudioStream.

actual suspend fun VfsFile.readAudioStream(): AudioStream

Streams audio from the path as an AudioStream.

Link copied to clipboard
suspend fun VfsFile.readBitmapFont(filter: TexMagFilter = TexMagFilter.NEAREST, mipmaps: Boolean = true, preloadedTextures: List<TextureSlice> = listOf()): BitmapFont

Reads a bitmap font.

Link copied to clipboard
suspend fun VfsFile.readGltfModel(loadTexturesAsynchronously: Boolean = false): Model

Loads a glTF / glb model from the path and converts it to a Model.

Link copied to clipboard
suspend fun VfsFile.readLDtkMapLoader(atlas: TextureAtlas? = null, tilesetBorder: Int = 2): LDtkMapLoader

Reads the VfsFile as a LDtkMapLoader. This will read the LDtk file and create a loader to allow flexible loading of LDtkWorld or LDtkLevel. This loader should be cached and reused when loading separate levels.

Link copied to clipboard
actual suspend fun VfsFile.readPixmap(): Pixmap
expect suspend fun VfsFile.readPixmap(): Pixmap

Loads an image from the path as a Pixmap.

actual suspend fun VfsFile.readPixmap(): Pixmap

Loads an image from the path as a Pixmap.

actual suspend fun VfsFile.readPixmap(): Pixmap
Link copied to clipboard
actual suspend fun VfsFile.readTexture(minFilter: TexMinFilter, magFilter: TexMagFilter, mipmaps: Boolean): Texture

Loads an image from the path as a Texture. This will call Texture.prepare before returning!

expect suspend fun VfsFile.readTexture(minFilter: TexMinFilter = TexMinFilter.NEAREST, magFilter: TexMagFilter = TexMagFilter.NEAREST, mipmaps: Boolean = true): Texture

Loads an image from the path as a Texture. This will call Texture.prepare before returning!

actual suspend fun VfsFile.readTexture(minFilter: TexMinFilter, magFilter: TexMagFilter, mipmaps: Boolean): Texture

Loads an image from the path as a Texture. This will call Texture.prepare before returning!

actual suspend fun VfsFile.readTexture(minFilter: TexMinFilter, magFilter: TexMagFilter, mipmaps: Boolean): Texture

Loads an image from the path as a Texture. This will call Texture.prepare before returning!

Link copied to clipboard
suspend fun VfsFile.readTiledMap(atlas: TextureAtlas? = null, tilesetBorder: Int = 2, mipmaps: Boolean = true): TiledMap

Reads the VfsFile as a TiledMap. Any loaders and assets will be cached for reuse/reloading.

Link copied to clipboard
suspend fun VfsFile.readTtfFont(chars: String = CharacterSets.LATIN_ALL): TtfFont
Link copied to clipboard
actual suspend fun VfsFile.writePixmap(pixmap: Pixmap)
expect suspend fun VfsFile.writePixmap(pixmap: Pixmap)

Write pixmap to disk.

actual suspend fun VfsFile.writePixmap(pixmap: Pixmap)
actual suspend fun VfsFile.writePixmap(pixmap: Pixmap)