Releases: libktx/ktx
KTX 1.10.0-rc1
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
) AddedTree.onSelectionChange
extension method that attaches aChangeListener
to aTree
. - [CHANGE] (
ktx-scene2d
) The genericNode
type ofKTreeWidget
was changed toKNode<*>
. - [FEATURE] (
ktx-script
) Added a new module withKotlinScriptEngine
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 toT
.evaluateAs<T>(FileHandle)
: compiles and executes a script from the selected file. Casts the result toT
.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 genericNode
type ofKVisTree
was changed toKNode<*>
.
KTX 1.10.0-b4
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
) AddedPlatform
object that exposes various utilities for platform-specific code.Platform.currentPlatform
returns currentApplicationType
or throwsGdxRuntimeException
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 forcompanion object
s ofComponent
s. Allows to easily obtain instances of aComponentMapper
corresponding to the enclosingComponent
class. - [FEATURE] (
ktx-assets-async
)AssetStorage.loadSync(String)
now supports optional loading parameters. - [FEATURE] (
ktx-collections
)isEmpty
andisNotEmpty
extension methods of libGDX collections now support Kotlin contracts. If they returntrue
, the collection is implied not to be null. - [CHANGE] (
ktx-collections
) AsIdentityMap
now extendsObjectMap
, some redundant utilities specific toIdentityMap
were removed. From the user point of view, all additional functionalities are covered by theObjectMap
utilities. - [FEATURE] (
ktx-freetype-async
)AssetStorage.loadFreeTypeFontAsync
was added, mimickingloadAsync
behavior. - [FEATURE] (
ktx-freetype-async
)AssetStorage.loadFreeTypeFontSync
was added, mimickingloadSync
behavior. - [FEATURE] (
ktx-freetype-async
)AsyncAssetManager.loadFreeTypeFontAsync
was added, returning aDeferred<BitmapFont>
instance. - [CHANGE] (
ktx-scene2d
)Scene2DSkin.defaultSkin
now throwsIllegalStateException
when accessed before overriding.
KTX 1.10.0-b3
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 loadingPolygonRegion
assets out of the box if the default loaders are registered. - [FEATURE] (
ktx-assets-async
)AsyncAssetManager
is a newAssetManager
extension with basic support for Kotlin coroutines.AsyncAssetManager.loadAsync
allows to schedule an asset for loading, returning aDeferred
asset reference.AsyncAssetManager.getDefaultParameters
allows to create a default instance ofAssetLoaderParameters
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-basedContext
methods with automatic dependency injection:newInstanceOf
: constructs an instance of the selected class. Injects constructor dependencies from theContext
.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 forClass
that allows to easily use LibGDX reflection API.ClassReflection
methods exposed asReflectedClass
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 asReflectedClass
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 usingArrayReflection
.KClass
constructor allows creatingReflectedClass
from aKClass
.
reflect<Type>()
function allows to wrap a selected class withReflectedClass
.reflect(KClass<Type>)
function allows to wrap a selectedKClass
withReflectedClass
.reflect(Class<Type>)
function allows to wrap a selectedClass
withReflectedClass
.reflect(String)
function allows to find a selected class by qualified name and wrap it withReflectedClass
.Annotation.get
extension method with a reified type allowing to get an instance of the annotation.
KTX 1.10.0-b2
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 Java1.6
target was deprecated and is incompatible with the latest coroutines library. Note that source compatibility level is still set to1.7
. - [FEATURE] (
ktx-assets
) Addeddiscard
lambda parameter to thepool
factory method that is invoked after an object is rejected from the createdPool
. - [FEATURE] (
ktx-scene2d
) Added support forParticleEffectActor
in Scene2D DSL viaparticleEffect
factory method. - [FEATURE] (
ktx-log
) AddedDEBUG
,INFO
andERROR
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 toLogger.name
. - [CHANGE] (
ktx-log
) Log prefix variables fromLogger
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
) AddedLogger.buildMessage
method that allows to modify logged message structure. This method can be overridden when extending theLogger
class, simplifying the usage of custom message formats.
KTX 1.10.0-b1
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.
KTX 1.9.14-b2
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
) AddedisEmpty
andisNotEmpty
extension function forMapLayers
andMapObjects
collections. - [FEATURE] (
ktx-tiled
) AddedforEachLayer
extension function forTiledMap
to iterate over an exact type ofMapLayer
instances of a specific map. - [FIX] (
ktx-vis
)visScrollPane
andvisSplitPane
now define the correct types forthis
in theinit
lambdas, adding support for Scene2D and VisUI DSL.
KTX 1.9.14-b1
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 additionalclearDepth
boolean parameter that controls whether theGL_DEPTH_BUFFER_BIT
is added to the mask. - [FEATURE] (
ktx-assets-async
) AddedAssetStorageSnapshot
class that stores a copy ofAssetStorage
state for debugging purposes. Supports formatted string output withprettyFormat
. - [FEATURE] (
ktx-assets-async
)AssetStorage
now includestakeSnapshot
andtakeSnapshotAsync
methods that allow to copy and inspect the internal state of the storage for debugging purposes. - [FEATURE] (
ktx-collections
) AddedgetOrPut
extension function for LibGDX map collections includingObjectMap
,IdentityMap
,ArrayMap
andIntMap
.
KTX 1.9.13-b1
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
) AddedSkin.register
extension method that allows to register widget styles with the DSL. - [FEATURE] (
ktx-vis
) AddedflowGroup
factory method that allows to constructFlowGroup
actors. - [CHANGE] (
ktx-vis
)horizontalFlowGroup
andverticalFlowGroup
are now deprecated. UseflowGroup
instead.
KTX 1.9.12-b1
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.
KTX 1.9.11-b2
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
) AddedGdxIdentityMap
andGdxArrayMap
aliases for LibGDXIdentityMap
andArrayMap
collections. - [FEATURE] (
ktx-collections
) Addedset
operator extension method toArrayMap
to support square brackets assignment. - [FEATURE] (
ktx-graphics
) Added optionalCamera
and projection matrix parameters toShapeRenderer.use
. - [FEATURE] (
ktx-scene2d
) Addedimage
builders forNinePatch
,TextureRegion
,Texture
andDrawable
.