Ktx Versions Save

Kotlin extensions for the libGDX game framework

1.12.1-rc1

6 months ago

The first release to support libGDX 1.12.1.


  • [UPDATE] Updated to libGDX 1.12.1.
  • [UPDATE] Updated to Kotlin 1.9.20.
  • [UPDATE] Updated to Kotlin Coroutines 1.7.3.
  • [UPDATE] Updated to VisUI 1.5.3.
  • [UPDATE] Updated to Dokka 1.9.10.
  • [FEATURE] (ktx-math) New extension and factory functions were introduced to Vector4, offering similar utilities to the other vectors.
    • vec4 factory methods allow creating new Vector4 instances with default and named parameters.
    • +=, -=, *=, /= mutating operators are now supported.
    • +, - (including unary -), ++, --, *, / operators are now supported, returning new instances of vectors as a result.
    • Vectors are now comparable by length, adding support for <, >, <=, >= operators.
    • Vector4 instances can now be deconstructed into 4 four values (X, Y, Z, W) using extension component methods.
    • dot infix function allows calculating the dot product of 2 vectors.

Known issues:

  • (ktx-assets) Pools created via the pool factory method do not reset the discarded objects by default, which is inconsistent with the libGDX pool behavior. To replicate this, pass a discard lambda parameter calling reset on the discarded objects that implement the Poolable interface.

1.12.0-rc1

9 months ago

The first release to officially support libGDX 1.12.0 and Kotlin 1.9.0.


  • [UPDATE] Updated to libGDX 1.12.0.
  • [UPDATE] Updated to Kotlin 1.9.0.
  • [UPDATE] Updated to Kotlin Coroutines 1.7.2.
  • [UPDATE] Updated to VisUI 1.5.2.
  • [UPDATE] Updated to Dokka 1.8.20.
  • [MISC] KTX project should now work locally under JDK 17, including the test suite.
  • [FEATURE] (ktx-app) KtxInputAdapter now supports the touchCancelled event handling. By default, it calls the touchUp method for consistency with the previous libGDX versions.

1.11.0-rc6

11 months ago

The first KTX release to support the gdxAI library with a new module: ktx-ai. Includes notable updates to core dependencies.


  • [UPDATE] Updated to Kotlin 1.8.21.
  • [UPDATE] Updated to Kotlin Coroutines 1.7.1.
  • [UPDATE] Updated to Gradle 7.6.1.
  • [UPDATE] Updated to Dokka 1.8.10.
  • [FEATURE] (ktx-ai) new KTX module with utilities and type-safe builders for gdxAI.
    • Type aliases to avoid name clashes with common libraries:
      • GdxAiSequence<E> for com.badlogic.gdx.ai.btree.branch.Sequence<E>
      • GdxAiSelector<E> for com.badlogic.gdx.ai.btree.branch.Selector<E>
      • GdxAiRandom<E> for com.badlogic.gdx.ai.btree.decorator.Random<E>
    • Extension functions for building behavior trees:
      • add
      • behaviorTree
      • dynamicGuardSelector
      • parallel
      • randomSelector
      • randomSequence
      • selector
      • sequence
      • alwaysFail
      • alwaysSucceed
      • include
      • invert
      • random
      • repeat
      • semaphoreGuard
      • untilFail
      • untilSuccess
      • failureLeaf
      • successLeaf
      • waitLeaf

1.11.0-rc5

1 year ago

A maintenance release with a bug fix in ktx-assets-async for older Android devices.


  • [UPDATE] Updated to Kotlin 1.8.10.
  • [FIX] (ktx-assets-async) AssetStorage no longer uses ConcurrentHashMap.getOrDefault method unsupported on older Android devices.

1.11.0-r4

1 year ago

A maintenance release with support for Kotlin 1.8.0 and notable documentation improvements.


  • [UPDATE] Updated to Kotlin 1.8.0.
  • [UPDATE] Updated to VisUI 1.5.1.
  • [MISC] Project README now includes installation instructions for new projects using gdx-liftoff.
  • [MISC] Sample KTX projects are now generated by gdx-liftoff on every release.
  • [MISC] Removed migration guides from ktx-scene2d and ktx-vis README files. If you are migrating from an old KTX version, please refer to the 1.11.0-rc3 tag.
  • [FEATURE] (ktx-assets-async) AssetStorage.silenceAssetManagerWarnings property was added, allowing to silence logging on non-fatal AssetLoader issues.
  • [FEATURE] (ktx-assets-async) AssetManagerWrapper warnings caused by AssetLoader issues were extended and improved.

Known issues:

  • [BUG] (ktx-assets-async) AssetStorage might work incorrectly on older Android devices due to access to unsupported Java APIs (ConcurrentHashMap.getOrDefault).

1.11.0-rc3

1 year ago

The first stable release to support a new KTX module: ktx-artemis.


  • [UPDATE] Updated to Kotlin 1.7.22.
  • [UPDATE] Updated to Dokka 1.7.20.
  • [FEATURE] (ktx-ashley) Added tagFor<Component> utility functions that automatically create a mapper for a flag component. These properties can be used to check for Component presence within the Entity, as well as automatically add and remove Component instances upon property modification.
  • [FEATURE] (ktx-artemis) new KTX module with Artemis-odb entity component system utilities: ktx-artemis.
    • ArchetypeBuilder.add and ArchetypeBuilder.remove extension methods for adding and removing components from an ArchetypeBuilder.
    • oneOf, allOf, exclude DSL and extension methods for Aspect.Builder.
    • EntityEdit.plusAssign operator function for adding components.
    • EntityEdit.with builder function for adding components to an entity.
    • EntityEdit.remove extension function for removing components from an entity.
    • EntityTransmuterFactory.add and EntityTransmuterFactory.remove extension functions for adding and removing components from an EntityTransmuterFactory.
    • ComponentMapper.contains operator function to check if an entity has a component.
    • World.edit extension builder function to edit an entity.
    • World.entity extension builder function to create and edit an entity.
    • World.get operator function for retrieving a system which returns null if it doesn't exist.
    • World.getSystem extension function for retrieving a system which throws an exception if it doesn't exist.
    • World.mapperFor extension function for retrieving a ComponentMapper instance.
  • [FEATURE] (ktx-assets-async) AssetStorage now stores a basic path-to-type map, which allows it to support more AssetManager methods called by some AssetLoader implementations. These include:
    • AssetManager.contains(String)
    • AssetManager.get(String)
    • AssetManager.get(String, Boolean)
    • AssetManager.get(String, Class, Boolean)
    • AssetManager.getAssetType(String)
    • AssetManager.isLoaded(String)
    • AssetManager.unload(String)
    • AssetManager.getDependencies(String)
    • AssetManager.getReferenceCount(String)

Known issues:

  • [BUG] (ktx-assets-async) AssetStorage might work incorrectly on older Android devices due to access to unsupported Java APIs (ConcurrentHashMap.getOrDefault).

1.11.0-rc2

1 year ago

Maintenance release with support for Kotlin 1.7 and Dokka 1.7, as well as several new utilities.


  • [UPDATE] Updated to Kotlin 1.7.10.
  • [UPDATE] Updated to Kotlin Coroutines 1.6.4.
  • [UPDATE] Updated to Dokka 1.7.10.
  • [MISC] New Dokka theme is available on the documentation website.
  • [FEATURE] (ktx-actors) Added Actor.onEnter, Actor.onExit, Actor.onEnterEvent and Actor.onExitEvent extension methods that attach ClickListener instances listening for enter and exit events.
  • [FEATURE] (ktx-ashley) Added ComponentDelegate and OptionalComponentDelegate that allow accessing component via Entity extension properties.
  • [FEATURE] (ktx-ashley) Added propertyFor<Component> and optionalPropertyFor<Component> utility functions that automatically create a mapper for the component delegates.

1.11.0-rc1

1 year ago

The first stable release to support libGDX 1.11.0.


  • [UPDATE] Updated to libGDX 1.11.0.
  • [MISC] Gradle dependencies changed from compile-only to API scope.
  • [FEATURE] (ktx-app) Added gdxError utility that throws a GdxRuntimeException.
  • [FIX] (ktx-assets-async) Fixed a niche bug with AsyncAssetManager which could lead to missed custom user callbacks after attempting to load the same asset concurrently with loadAsync.

1.10.0-rc2

2 years ago

A maintenance release with notable changes to the ktx-ashley and ktx-script modules.


  • [UPDATE] Updated to Kotlin 1.6.21.
  • [UPDATE] Updated to Kotlin Coroutines 1.6.1.
  • [FEATURE] (ktx-ashley) Added utilities for working with Ashley's EntityListener interface:
    • EntityAdditionListener: an interface extending EntityListener that only requires implementation of the entityAdded method.
    • EntityRemovalListener: an interface extending EntityListener that only requires implementation of the entityRemoved method.
    • Engine.onEntityAdded and Engine.onEntityRemoved extension methods that create entity listeners from lambdas.
    • Wrappers for Engine.onEntityAdded and Engine.onEntityRemoved for IteratingSystem, IntervalIteratingSystem and SortedIteratingSystem that use system's Family and Engine automatically.
  • [FEATURE] (ktx-script) Added KotlinScriptEngine.evaluateOn methods that can execute scripts with a custom receiver.
  • [CHANGE] (ktx-script) Generic libGDX and Java exceptions replaced with a custom ScriptEngineException.

1.10.0-rc1

2 years ago

The first release to support a new KTX module: ktx-script with a Kotlin scripting engine.

Note that the KTX stable versions will have a -rc suffix instead of -b from now on.


  • [UPDATE] Updated to Kotlin 1.6.10.
  • [UPDATE] Updated to Kotlin Coroutines 1.6.0.
  • [MISC] Links to the libGDX wiki were updated.
  • [MISC] Stable KTX releases are now marked with the -rc suffix.
  • [FEATURE] (ktx-actors) Added Tree.onSelectionChange extension method that attaches a ChangeListener to a Tree.
  • [CHANGE] (ktx-scene2d) The generic Node type of KTreeWidget was changed to KNode<*>.
  • [FEATURE] (ktx-script) Added a new module with KotlinScriptEngine evaluating Kotlin scripts in runtime.
    • evaluate(String): compiles and executes a script passed as a string.
    • evaluate(FileHandle): compiles and executes a script from the selected file.
    • evaluateAs<T>(String): compiles and executes a script passed as a string. Casts the result to T.
    • evaluateAs<T>(FileHandle): compiles and executes a script from the selected file. Casts the result to T.
    • set(String, Any): adds a variable to the script execution context.
    • get(String): returns the current value assigned to the selected variable.
    • remove(String): removes the variable registered under the given name.
    • import(String, String?): adds an import to the script context. Accepts optional alias.
    • importAll(vararg String), importAll(Iterable<String>): adds the selected imports to the script context.
    • setPackage(String): sets the package for the scripts.
  • [CHANGE] (ktx-vis) The generic Node type of KVisTree was changed to KNode<*>.