Since KorGE 4.0.3, there is a new autogenerated class called
KR. This is similar to Android
and provides a type-safe way of accessing resources. It exposes all the files in the resources folder,
and provides reading shortcuts for images and sounds. In the case of folders ended with
.atlas it generates
automatically an optimized atlas of the images, and provides a way to access them.
KorGE IntelliJ plugin will also display previews for files and atlases:
You can see it in action in the KorGE youtube channel with the KorGE Chess tutorial.
KorIO offers a
resourcesVfs global property that holds a Virtual File System that include the
src/commonMain/resources in all the targets.
With the injector, or as part of the
Scene class, you have access to a
It is a MoutableVfs, where the
resourcesVfs is mounted at
This allows you to load resources from different sources like a cache folder, or a base URL.
KorGE supports directly or indirectly several kind of resources.
You can read bitmaps with:
All the targets support at least
JPEG bitmap loading.
Sound and Music
You can read sound files with:
All targets support