Skip to content

Commit

Permalink
Adds resourceSound and resourceMusic (#2160)
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Feb 24, 2024
1 parent fa902ec commit a58d1c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions korge/src/korlibs/korge/resources/ResourcesExt.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package korlibs.korge.resources

import korlibs.audio.format.*
import korlibs.audio.sound.*
import korlibs.image.bitmap.*
import korlibs.image.font.readBitmapFont
import korlibs.image.font.readFont
Expand All @@ -17,3 +19,5 @@ fun resourceBitmap(@ResourcePath path: String, mipmaps: Boolean = true, cache: R
fun resourceFont(@ResourcePath path: String, mipmaps: Boolean = true, cache: ResourceCache = ResourceCache.LOCAL) = resource(cache) { root[path].readFont(mipmaps = mipmaps) }
fun resourceBitmapFont(@ResourcePath path: String, mipmaps: Boolean = true, cache: ResourceCache = ResourceCache.LOCAL) = resource(cache) { root[path].readBitmapFont(mipmaps = mipmaps) }
fun resourceTtfFont(@ResourcePath path: String, preload: Boolean = false, cache: ResourceCache = ResourceCache.LOCAL) = resource(cache) { root[path].readTtfFont() }
fun resourceSound(@ResourcePath path: String, props: AudioDecodingProps = AudioDecodingProps.DEFAULT, cache: ResourceCache = ResourceCache.LOCAL) = resource(cache) { root[path].readSound(props) }
fun resourceMusic(@ResourcePath path: String, props: AudioDecodingProps = AudioDecodingProps.DEFAULT, cache: ResourceCache = ResourceCache.LOCAL) = resource(cache) { root[path].readMusic(props) }

0 comments on commit a58d1c8

Please sign in to comment.