ktx v1.9.8-b1 Release Notes

Release Date: 2018-01-27 // over 6 years ago
  • 🚀 The first release that contains ktx-freetype and ktx-freetype-async modules: FreeType font loading utilities. The transition from Kotlin 1.1 to 1.2 also allowed us to use default functional parameters in inlined methods, which simplified some APIs. It also contains notable changes and simplifications of the ktx-inject API.


    • ⚡️ [UPDATE] Updated to LibGDX 1.9.8.
    • ⚡️ [UPDATE] Updated to Kotlin 1.2.21.
    • ⚡️ [UPDATE] Updated to Kotlin Coroutines 0.22.
    • ⚡️ [UPDATE] Updated to Gradle 4.4.
    • ⚡️ [UPDATE] Updated to VisUI 1.4.0.
    • [CHANGE] (ktx-scene2d) Duplicate functions in Scene2D building DSL were removed thanks to optional default lambda parameters in inlined functions (added in Kotlin 1.2). Due to the limitation in inlined methods, there used to be two inlined methods for each actor to support syntax both with braces (init block) and without. Now there is just one factory method supporting both syntax variants per widget. This should not affect most application, but might require
      Kotlin 1.2 usage.
    • [CHANGE] (ktx-ashley) Default functional parameters were added to create, entity and with, simplifying the implementation and making configuration blocks optional.
    • [CHANGE] (ktx-inject) Parameters of bindSingleton consuming multiple classes have been swapped to be more compatible with the bind functions.
    • [CHANGE] (ktx-inject) bind and bindSingleton methods consuming multiple classes now take KClass as parameters instead of Class, so now you can use YourType::class instead of more verbose YourType::class.java.
    • [FEATURE] (ktx-style) Initiation blocks of Skin and Scene2D actor styles are now optional.
    • [FEATURE] (ktx-vis-style) Initiation blocks of VisUI actor styles are now optional.
    • [FEATURE] (ktx-box2d) Initiation blocks of fixtures and joints are now optional thanks to default lambda parameters in inlined functions.
    • [FEATURE] (ktx-inject) Add higher-order function parameters for bindSingleton to allow the use of lambda expressions.

      fun createCircle(body: Body) { // Before - would not compile without additional braces: body.circle(radius = 2f) {} // Now - braces are optional (lambda parameter defaults to no-op): body.circle(radius = 2f) }

    • [FEATURE] (ktx-freetype) Implemented ktx-freetype module.

      • AssetManager.registerFreeTypeFontLoaders allows to register all loaders necessary to handle FreeType font assets.
      • AssetManager.loadFreeTypeFont provides Kotlin DSL for loading of FreeType fonts.
      • freeTypeFontParameters function provides Kotlin DSL for building FreeType font loading parameters.
      • FreeTypeFontGenerator.generateFont extension function allows to generate BitmapFont with Kotlin DSL.
    • [FEATURE] (ktx-freetype-async) Implemented ktx-freetype-async module.

      • AssetStorage.registerFreeTypeFontLoaders allows to register all loaders necessary to handle FreeType font assets.
      • AssetStorage.loadFreeTypeFont provides Kotlin DSL for asynchronous loading of FreeType fonts.
    • [FIX] (ktx-box2d) As LibGDX 1.9.8 fixes its ChainShape implementation, ChainShape utilities are supported once again.