Ktx Versions Save

Kotlin extensions for the libGDX game framework

1.10.0-b4

2 years ago

A release with minor API changes in ktx-scene2d and ktx-collections, as well as new features in ktx-app, ktx-ashley, ktxc-collections, and ktx-freetype-async. Includes new utilities for platform-specific code in ktx-app.


  • [UPDATE] Updated to Gradle 7.2.
  • [UPDATE] Updated to Dokka 1.5.30.
  • [FEATURE] (ktx-app) Added Platform object that exposes various utilities for platform-specific code.
    • Platform.currentPlatform returns current ApplicationType or throws GdxRuntimeException if unable to determine.
    • Platform.version returns the current version of the platform (e.g., Android API version, iOS major OS version).
    • Boolean properties that allow to determine current platform:
      • Platform.isAndroid checks if the current platform is Android.
      • Platform.isDesktop checks if the current platform is desktop with graphical application.
      • Platform.isHeadless checks if the current platform is desktop without graphical application.
      • Platform.isiOS checks if the current platform is iOS.
      • Platform.isMobile checks if the current platform is Android or iOS.
      • Platform.isWeb checks if the current platform is HTML/WebGL.
    • Inlined methods that allow to execute code on specific platforms:
      • Platform.runOnAndroid executes an action if the current platform is Android. Returns action result or null.
      • Platform.runOnDesktop executes an action if the current platform is desktop. Returns action result or null.
      • Platform.runOnHeadless executes an action if the current platform is headless desktop. Returns action result or null.
      • Platform.runOniOS executes an action if the current platform is iOS. Returns action result or null.
      • Platform.runOnMobile executes an action if the current platform is Android or iOS. Returns action result or null.
      • Platform.runOnWeb executes an action if the current platform is HTML/WebGL. Returns action result or null.
    • Inlined runOnVersion executes an action if the current platform version is within minimum and maximum values.
  • [FEATURE] (ktx-ashley) Mapper abstract class designed for companion objects of Components. Allows to easily obtain instances of a ComponentMapper corresponding to the enclosing Component class.
  • [FEATURE] (ktx-assets-async) AssetStorage.loadSync(String) now supports optional loading parameters.
  • [FEATURE] (ktx-collections) isEmpty and isNotEmpty extension methods of libGDX collections now support Kotlin contracts. If they return true, the collection is implied not to be null.
  • [CHANGE] (ktx-collections) As IdentityMap now extends ObjectMap, some redundant utilities specific to IdentityMap were removed. From the user point of view, all additional functionalities are covered by the ObjectMap utilities.
  • [FEATURE] (ktx-freetype-async) AssetStorage.loadFreeTypeFontAsync was added, mimicking loadAsync behavior.
  • [FEATURE] (ktx-freetype-async) AssetStorage.loadFreeTypeFontSync was added, mimicking loadSync behavior.
  • [FEATURE] (ktx-freetype-async) AsyncAssetManager.loadFreeTypeFontAsync was added, returning a Deferred<BitmapFont> instance.
  • [CHANGE] (ktx-scene2d) Scene2DSkin.defaultSkin now throws IllegalStateException when accessed before overriding.

1.10.0-b3

2 years ago

The first release to include the ktx-reflect module with new reflection utilities. Includes notable new features in ktx-collections, ktx-inject, and ktx-assets-async.


  • [UPDATE] Updated to Kotlin 1.5.31.
  • [UPDATE] Updated to Kotlin Coroutines 1.5.2.
  • [FEATURE] (ktx-assets-async) AssetStorage now supports loading PolygonRegion assets out of the box if the default loaders are registered.
  • [FEATURE] (ktx-assets-async) AsyncAssetManager is a new AssetManager extension with basic support for Kotlin coroutines.
    • AsyncAssetManager.loadAsync allows to schedule an asset for loading, returning a Deferred asset reference.
    • AsyncAssetManager.getDefaultParameters allows to create a default instance of AssetLoaderParameters for a selected asset.
    • AsyncAssetManager.setLoaderParameterSupplier has to be called for each custom asset loader in order to enable asynchronous loading without explicitly passing loader parameters.
  • [FEATURE] (ktx-collections) Factory methods for LibGDX arrays of primitives:
    • gdxBooleanArrayOf
    • gdxByteArrayOf
    • gdxCharArrayOf
    • gdxShortArrayOf
    • gdxIntArrayOf
    • gdxLongArrayOf
    • gdxFloatArrayOf
  • [FEATURE] (ktx-inject) New reflection-based Context methods with automatic dependency injection:
    • newInstanceOf: constructs an instance of the selected class. Injects constructor dependencies from the Context.
    • bind<Type>: registers a provider that creates a new instance of selected class via reflection each time it is requested.
    • bindSingleton<Type>: creates, registers, and returns a singleton of selected class using reflection.
  • [FEATURE] (ktx-reflect) Added a new module with reflection utilities.
    • Reflection annotation, which requires opt-in, allows marking functionalities that rely on reflection.
    • ReflectedClass is an inlined wrapper for Class that allows to easily use LibGDX reflection API.
      • ClassReflection methods exposed as ReflectedClass read-only properties:
        • simpleName
        • isMemberClass
        • isStatic
        • isArray
        • isPrimitive
        • isEnum
        • isAnnotation
        • isInterface
        • isAbstract
        • componentType
        • constructors
        • methods
        • declaredMethods
        • fields
        • declaredFields
        • annotations
        • declaredAnnotations
        • interfaces
        • enumConstants
      • ClassReflection methods exposed as ReflectedClass methods with improved Kotlin class handling:
        • isInstance
        • isAssignableFrom
        • newInstance
        • getConstructor
        • getDeclaredConstructor
        • getMethod
        • getDeclaredMethod
        • getField
        • getDeclaredField
        • isAnnotationPresent
        • getAnnotation
        • getDeclaredAnnotation
      • Additional ReflectedClass utilities:
        • constructor property allows to extract the only class constructor if it is available.
        • newArrayInstance method allows to create a type array of the given size using ArrayReflection.
        • KClass constructor allows creating ReflectedClass from a KClass.
    • reflect<Type>() function allows to wrap a selected class with ReflectedClass.
    • reflect(KClass<Type>) function allows to wrap a selected KClass with ReflectedClass.
    • reflect(Class<Type>) function allows to wrap a selected Class with ReflectedClass.
    • reflect(String) function allows to find a selected class by qualified name and wrap it with ReflectedClass.
    • Annotation.get extension method with a reified type allowing to get an instance of the annotation.

1.10.0-b2

2 years ago

A maintenance release with improved support for the new LibGDX 1.10.0 features. Includes a minor refactoring of the ktx-log module.


  • [UPDATE] Updated to Gradle 7.0.2.
  • [UPDATE] Updated to Kotlin 1.5.21.
  • [UPDATE] Updated to Kotlin Coroutines 1.5.1.
  • [UPDATE] Updated to VisUI 1.5.0.
  • [CHANGE] The JVM target compatibility of all modules was set to 1.8, since Java 1.6 target was deprecated and is incompatible with the latest coroutines library. Note that source compatibility level is still set to 1.7.
  • [FEATURE] (ktx-assets) Added discard lambda parameter to the pool factory method that is invoked after an object is rejected from the created Pool.
  • [FEATURE] (ktx-scene2d) Added support for ParticleEffectActor in Scene2D DSL via particleEffect factory method.
  • [FEATURE] (ktx-log) Added DEBUG, INFO and ERROR constants with default logger tags.
  • [CHANGE] (ktx-log) Default tags are no longer wrapped in square brackets. This caused a change of the logs structure.
  • [CHANGE] (ktx-log) Logger.tag variable was renamed to Logger.name.
  • [CHANGE] (ktx-log) Log prefix variables from Logger were removed. Message tags are now configurable directly through the constructor.
  • [CHANGE] (ktx-log) Logger name is no longer a part of the message tag. Instead, it is now prepended to the message. This causes a change of the logs structure.
  • [FEATURE] (ktx-log) Added Logger.buildMessage method that allows to modify logged message structure. This method can be overridden when extending the Logger class, simplifying the usage of custom message formats.

1.10.0-b1

3 years ago

Maintenance release with support for LibGDX 1.10.0.


  • [UPDATE] Updated to LibGDX 1.10.0.
  • [CHANGE] The Java source compatibility and JVM target version of the KTX modules was changed from 1.6 to 1.7.

1.9.14-b2

3 years ago

A maintenance release with notable dependency updates and a minor VisUI module bug fix.


  • [UPDATE] Updated to Ashley 1.7.4.
  • [UPDATE] Updated to Kotlin 1.4.32.
  • [UPDATE] Updated to Kotlin Coroutines 1.4.3.
  • [UPDATE] Updated to Gradle 6.8.3.
  • [UPDATE] Updated to Dokka 1.4.30.
  • [MISC] Due to the newly added support for multimodule projects in Dokka, published documentation URLs will change.
  • [FEATURE] (ktx-tiled) Added isEmpty and isNotEmpty extension function for MapLayers and MapObjects collections.
  • [FEATURE] (ktx-tiled) Added forEachLayer extension function for TiledMap to iterate over an exact type of MapLayer instances of a specific map.
  • [FIX] (ktx-vis) visScrollPane and visSplitPane now define the correct types for this in the init lambdas, adding support for Scene2D and VisUI DSL.

1.9.14-b1

3 years ago

The first release to support LibGDX 1.9.14. Includes notable debugging extension for ktx-assets-async.


  • [UPDATE] Updated to LibGDX 1.9.14.
  • [UPDATE] Updated to Kotlin 1.4.30.
  • [UPDATE] Updated to VisUI 1.4.11.
  • [FEATURE] (ktx-app) clearScreen now accepts additional clearDepth boolean parameter that controls whether the GL_DEPTH_BUFFER_BIT is added to the mask.
  • [FEATURE] (ktx-assets-async) Added AssetStorageSnapshot class that stores a copy of AssetStorage state for debugging purposes. Supports formatted string output with prettyFormat.
  • [FEATURE] (ktx-assets-async) AssetStorage now includes takeSnapshot and takeSnapshotAsync methods that allow to copy and inspect the internal state of the storage for debugging purposes.
  • [FEATURE] (ktx-collections) Added getOrPut extension function for LibGDX map collections including ObjectMap, IdentityMap, ArrayMap and IntMap.

1.9.13-b1

3 years ago

The first release to support LibGDX 1.9.13. Maintenance release with some notable dependencies updates.


  • [UPDATE] Updated to LibGDX 1.9.13.
  • [UPDATE] Updated to Kotlin 1.4.21-2.
  • [UPDATE] Updated to VisUI 1.4.8.
  • [FEATURE] (ktx-style) Added Skin.register extension method that allows to register widget styles with the DSL.
  • [FEATURE] (ktx-vis) Added flowGroup factory method that allows to construct FlowGroup actors.
  • [CHANGE] (ktx-vis) horizontalFlowGroup and verticalFlowGroup are now deprecated. Use flowGroup instead.

1.9.12-b1

3 years ago

The first KTX release with support for LibGDX 1.9.2.


  • [UPDATE] Updated to LibGDX 1.9.12.
  • [UPDATE] Updated to Kotlin 1.4.20.
  • [UPDATE] Updated to Kotlin Coroutines 1.4.2.

1.9.11-b2

3 years ago

A release that features relatively minor additions, but major changes in terms of internal project architecture and documentation generation. The project was updated to the latest Gradle version with Kotlin DSL, and the latest Dokka version with an overhauled auto generated UI.


  • [UPDATE] Updated to Kotlin 1.4.10.
  • [UPDATE] Updated to Kotlin Coroutines 1.4.0.
  • [UPDATE] Updated to Gradle 6.7.
  • [UPDATE] Updated to Dokka 1.4.10-2.
  • [MISC] Groovy Gradle scripts and configuration files migrated to Kotlin.
  • [MISC] The generated sources documentation is vastly improved and moved to a new URL.
  • [FEATURE] (ktx-collections) Added GdxIdentityMap and GdxArrayMap aliases for LibGDX IdentityMap and ArrayMap collections.
  • [FEATURE] (ktx-collections) Added set operator extension method to ArrayMap to support square brackets assignment.
  • [FEATURE] (ktx-graphics) Added optional Camera and projection matrix parameters to ShapeRenderer.use.
  • [FEATURE] (ktx-scene2d) Added image builders for NinePatch, TextureRegion, Texture and Drawable.

1.9.11-b1

3 years ago

The first release to officially support LibGDX 1.9.11. No major changes otherwise.


  • [UPDATE] Updated to LibGDX 1.9.11.
  • [UPDATE] Updated to Kotlin Coroutines 1.3.6.
  • [UPDATE] Updated VisUI to 1.4.6.
  • [FEATURE] (ktx-scene2d) Added a generic container factory method that supports adding a custom actor.