See also: the official libGDX changelog.
- [UPDATE] Updated to libGDX 1.13.1.
- [UPDATE] Updated to Kotlin 2.1.10.
- [UPDATE] Updated to Kotlin Coroutines 1.10.1.
- [UPDATE] Updated to VisUI 1.5.5.
- [UPDATE] Updated to Dokka 2.0.0.
- [CHANGE] (
ktx-app)KtxGamenow callsresizeaftershowwhencreateorsetScreenare called. This behavior now matches the officialGameimplementation.
- [UPDATE] Updated to Kotlin 1.9.25.
- [UPDATE] Updated to Kotlin Coroutines 1.8.1.
- [UPDATE] Updated to Gradle 7.6.4.
- [UPDATE] Updated to Dokka 1.9.20.
- [MISC] JDK 11 or newer is now required to build the KTX project.
- [CHANGE] (
ktx-assets) Thepoolfactory method now attempts to resetPoolableobjects with the defaultdiscardlambda to match the default libGDX pool behavior. Pass a custom function to override it. - [FEATURE] (
ktx-math) Added component deconstructing operators for 2D shapes:Rectangle: x, y, width, heightEllipse: x, y, width, heightCircle: x, y, radiusPolygon: x, yPolyline: x, y
- [CHANGE] (
ktx-scene2d)imagefactory method can now be called without parameters or withnullto create anImagewithout aDrawable. - [FEATURE] (
ktx-tiled) Addeduseextension method toBatchTiledMapRendererthat automatically callsbeginRender()andendRender().
- [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 toVector4, offering similar utilities to the other vectors.vec4factory methods allow creating newVector4instances 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. Vector4instances can now be deconstructed into 4 four values (X, Y, Z, W) using extension component methods.dotinfix function allows calculating the dot product of 2 vectors.
- [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)KtxInputAdapternow supports thetouchCancelledevent handling. By default, it calls thetouchUpmethod for consistency with the previous libGDX versions.
- [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>forcom.badlogic.gdx.ai.btree.branch.Sequence<E>GdxAiSelector<E>forcom.badlogic.gdx.ai.btree.branch.Selector<E>GdxAiRandom<E>forcom.badlogic.gdx.ai.btree.decorator.Random<E>
- Extension functions for building behavior trees:
addbehaviorTreedynamicGuardSelectorparallelrandomSelectorrandomSequenceselectorsequencealwaysFailalwaysSucceedincludeinvertrandomrepeatsemaphoreGuarduntilFailuntilSuccessfailureLeafsuccessLeafwaitLeaf
- Type aliases to avoid name clashes with common libraries:
- [UPDATE] Updated to Kotlin 1.8.10.
- [FIX] (
ktx-assets-async)AssetStorageno longer usesConcurrentHashMap.getOrDefaultmethod unsupported on older Android devices.
- [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-liftoffon every release. - [MISC] Removed migration guides from
ktx-scene2dandktx-visREADME files. If you are migrating from an old KTX version, please refer to the 1.11.0-rc3 tag. - [FEATURE] (
ktx-assets-async)AssetStorage.silenceAssetManagerWarningsproperty was added, allowing to silence logging on non-fatalAssetLoaderissues. - [FEATURE] (
ktx-assets-async)AssetManagerWrapperwarnings caused byAssetLoaderissues were extended and improved.
- [UPDATE] Updated to Kotlin 1.7.22.
- [UPDATE] Updated to Dokka 1.7.20.
- [FEATURE] (
ktx-ashley) AddedtagFor<Component>utility functions that automatically create a mapper for a flag component. These properties can be used to check forComponentpresence within theEntity, as well as automatically add and removeComponentinstances upon property modification. - [FEATURE] (
ktx-artemis) new KTX module with Artemis-odb entity component system utilities:ktx-artemis.ArchetypeBuilder.addandArchetypeBuilder.removeextension methods for adding and removing components from anArchetypeBuilder.oneOf,allOf,excludeDSL and extension methods forAspect.Builder.EntityEdit.plusAssignoperator function for adding components.EntityEdit.withbuilder function for adding components to an entity.EntityEdit.removeextension function for removing components from an entity.EntityTransmuterFactory.addandEntityTransmuterFactory.removeextension functions for adding and removing components from anEntityTransmuterFactory.ComponentMapper.containsoperator function to check if an entity has a component.World.editextension builder function to edit an entity.World.entityextension builder function to create and edit an entity.World.getoperator function for retrieving a system which returns null if it doesn't exist.World.getSystemextension function for retrieving a system which throws an exception if it doesn't exist.World.mapperForextension function for retrieving aComponentMapperinstance.
- [FEATURE] (
ktx-assets-async)AssetStoragenow stores a basic path-to-type map, which allows it to support moreAssetManagermethods called by someAssetLoaderimplementations. 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)
- [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) AddedActor.onEnter,Actor.onExit,Actor.onEnterEventandActor.onExitEventextension methods that attachClickListenerinstances listening for enter and exit events. - [FEATURE] (
ktx-ashley) AddedComponentDelegateandOptionalComponentDelegatethat allow accessing component viaEntityextension properties. - [FEATURE] (
ktx-ashley) AddedpropertyFor<Component>andoptionalPropertyFor<Component>utility functions that automatically create a mapper for the component delegates.
- [UPDATE] Updated to libGDX 1.11.0.
- [MISC] Gradle dependencies changed from compile-only to API scope.
- [FEATURE] (
ktx-app) AddedgdxErrorutility that throws aGdxRuntimeException. - [FIX] (
ktx-assets-async) Fixed a niche bug withAsyncAssetManagerwhich could lead to missed callbacks after attempting to load the same asset concurrently withloadAsync.
- [UPDATE] Updated to Kotlin 1.6.21.
- [UPDATE] Updated to Kotlin Coroutines 1.6.1.
- [FEATURE] (
ktx-ashley) Added utilities for working with Ashley'sEntityListenerinterface:EntityAdditionListener: an interface extendingEntityListenerthat only requires implementation of theentityAddedmethod.EntityRemovalListener: an interface extendingEntityListenerthat only requires implementation of theentityRemovedmethod.Engine.onEntityAddedandEngine.onEntityRemovedextension methods that create entity listeners from lambdas.- Wrappers for
Engine.onEntityAddedandEngine.onEntityRemovedforIteratingSystem,IntervalIteratingSystemandSortedIteratingSystemthat use system'sFamilyandEngineautomatically.
- [FEATURE] (
ktx-script) AddedKotlinScriptEngine.evaluateOnmethods that can execute scripts with a custom receiver. - [CHANGE] (
ktx-script) Generic libGDX and Java exceptions replaced with a customScriptEngineException.
- [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
-rcsuffix. - [FEATURE] (
ktx-actors) AddedTree.onSelectionChangeextension method that attaches aChangeListenerto aTree. - [CHANGE] (
ktx-scene2d) The genericNodetype ofKTreeWidgetwas changed toKNode<*>. - [FEATURE] (
ktx-script) Added a new module withKotlinScriptEngineevaluating 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 genericNodetype ofKVisTreewas changed toKNode<*>.
- [UPDATE] Updated to Gradle 7.2.
- [UPDATE] Updated to Dokka 1.5.30.
- [FEATURE] (
ktx-app) AddedPlatformobject that exposes various utilities for platform-specific code.Platform.currentPlatformreturns currentApplicationTypeor throwsGdxRuntimeExceptionif unable to determine.Platform.versionreturns the current version of the platform (e.g., Android API version, iOS major OS version).- Boolean properties that allow to determine current platform:
Platform.isAndroidchecks if the current platform is Android.Platform.isDesktopchecks if the current platform is desktop with graphical application.Platform.isHeadlesschecks if the current platform is desktop without graphical application.Platform.isiOSchecks if the current platform is iOS.Platform.isMobilechecks if the current platform is Android or iOS.Platform.isWebchecks if the current platform is HTML/WebGL.
- Inlined methods that allow to execute code on specific platforms:
Platform.runOnAndroidexecutes an action if the current platform is Android. Returns action result or null.Platform.runOnDesktopexecutes an action if the current platform is desktop. Returns action result or null.Platform.runOnHeadlessexecutes an action if the current platform is headless desktop. Returns action result or null.Platform.runOniOSexecutes an action if the current platform is iOS. Returns action result or null.Platform.runOnMobileexecutes an action if the current platform is Android or iOS. Returns action result or null.Platform.runOnWebexecutes an action if the current platform is HTML/WebGL. Returns action result or null.
- Inlined
runOnVersionexecutes an action if the current platform version is within minimum and maximum values.
- [FEATURE] (
ktx-ashley)Mapperabstract class designed forcompanion objects ofComponents. Allows to easily obtain instances of aComponentMappercorresponding to the enclosingComponentclass. - [FEATURE] (
ktx-assets-async)AssetStorage.loadSync(String)now supports optional loading parameters. - [FEATURE] (
ktx-collections)isEmptyandisNotEmptyextension methods of libGDX collections now support Kotlin contracts. If they returntrue, the collection is implied not to be null. - [CHANGE] (
ktx-collections) AsIdentityMapnow extendsObjectMap, some redundant utilities specific toIdentityMapwere removed. From the user point of view, all additional functionalities are covered by theObjectMaputilities. - [FEATURE] (
ktx-freetype-async)AssetStorage.loadFreeTypeFontAsyncwas added, mimickingloadAsyncbehavior. - [FEATURE] (
ktx-freetype-async)AssetStorage.loadFreeTypeFontSyncwas added, mimickingloadSyncbehavior. - [FEATURE] (
ktx-freetype-async)AsyncAssetManager.loadFreeTypeFontAsyncwas added, returning aDeferred<BitmapFont>instance. - [CHANGE] (
ktx-scene2d)Scene2DSkin.defaultSkinnow throwsIllegalStateExceptionwhen accessed before overriding.
- [UPDATE] Updated to Kotlin 1.5.31.
- [UPDATE] Updated to Kotlin Coroutines 1.5.2.
- [FEATURE] (
ktx-assets-async)AssetStoragenow supports loadingPolygonRegionassets out of the box if the default loaders are registered. - [FEATURE] (
ktx-assets-async)AsyncAssetManageris a newAssetManagerextension with basic support for Kotlin coroutines.AsyncAssetManager.loadAsyncallows to schedule an asset for loading, returning aDeferredasset reference.AsyncAssetManager.getDefaultParametersallows to create a default instance ofAssetLoaderParametersfor a selected asset.AsyncAssetManager.setLoaderParameterSupplierhas 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:gdxBooleanArrayOfgdxByteArrayOfgdxCharArrayOfgdxShortArrayOfgdxIntArrayOfgdxLongArrayOfgdxFloatArrayOf
- [FEATURE] (
ktx-inject) New reflection-basedContextmethods 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.Reflectionannotation, which requires opt-in, allows marking functionalities that rely on reflection.ReflectedClassis an inlined wrapper forClassthat allows to easily use libGDX reflection API.ClassReflectionmethods exposed asReflectedClassread-only properties:simpleNameisMemberClassisStaticisArrayisPrimitiveisEnumisAnnotationisInterfaceisAbstractcomponentTypeconstructorsmethodsdeclaredMethodsfieldsdeclaredFieldsannotationsdeclaredAnnotationsinterfacesenumConstants
ClassReflectionmethods exposed asReflectedClassmethods with improved Kotlin class handling:isInstanceisAssignableFromnewInstancegetConstructorgetDeclaredConstructorgetMethodgetDeclaredMethodgetFieldgetDeclaredFieldisAnnotationPresentgetAnnotationgetDeclaredAnnotation
- Additional
ReflectedClassutilities:constructorproperty allows to extract the only class constructor if it is available.newArrayInstancemethod allows to create a type array of the given size usingArrayReflection.KClassconstructor allows creatingReflectedClassfrom aKClass.
reflect<Type>()function allows to wrap a selected class withReflectedClass.reflect(KClass<Type>)function allows to wrap a selectedKClasswithReflectedClass.reflect(Class<Type>)function allows to wrap a selectedClasswithReflectedClass.reflect(String)function allows to find a selected class by qualified name and wrap it withReflectedClass.Annotation.getextension method with a reified type allowing to get an instance of the annotation.
- [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.6target was deprecated and is incompatible with the latest coroutines library. Note that source compatibility level is still set to1.7. - [FEATURE] (
ktx-assets) Addeddiscardlambda parameter to thepoolfactory method that is invoked after an object is rejected from the createdPool. - [FEATURE] (
ktx-scene2d) Added support forParticleEffectActorin Scene2D DSL viaparticleEffectfactory method. - [FEATURE] (
ktx-log) AddedDEBUG,INFOandERRORconstants 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.tagvariable was renamed toLogger.name. - [CHANGE] (
ktx-log) Log prefix variables fromLoggerwere 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.buildMessagemethod that allows to modify logged message structure. This method can be overridden when extending theLoggerclass, simplifying the usage of custom message formats.
- [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.
- [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) AddedisEmptyandisNotEmptyextension function forMapLayersandMapObjectscollections. - [FEATURE] (
ktx-tiled) AddedforEachLayerextension function forTiledMapto iterate over an exact type ofMapLayerinstances of a specific map. - [FIX] (
ktx-vis)visScrollPaneandvisSplitPanenow define the correct types forthisin theinitlambdas, adding support for Scene2D and VisUI DSL.
- [UPDATE] Updated to libGDX 1.9.14.
- [UPDATE] Updated to Kotlin 1.4.30.
- [UPDATE] Updated to VisUI 1.4.11.
- [FEATURE] (
ktx-app)clearScreennow accepts additionalclearDepthboolean parameter that controls whether theGL_DEPTH_BUFFER_BITis added to the mask. - [FEATURE] (
ktx-assets-async) AddedAssetStorageSnapshotclass that stores a copy ofAssetStoragestate for debugging purposes. Supports formatted string output withprettyFormat. - [FEATURE] (
ktx-assets-async)AssetStoragenow includestakeSnapshotandtakeSnapshotAsyncmethods that allow to copy and inspect the internal state of the storage for debugging purposes. - [FEATURE] (
ktx-collections) AddedgetOrPutextension function for libGDX map collections includingObjectMap,IdentityMap,ArrayMapandIntMap.
- [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.registerextension method that allows to register widget styles with the DSL. - [FEATURE] (
ktx-vis) AddedflowGroupfactory method that allows to constructFlowGroupactors. - [CHANGE] (
ktx-vis)horizontalFlowGroupandverticalFlowGroupare now deprecated. UseflowGroupinstead.
- [UPDATE] Updated to libGDX 1.9.12.
- [UPDATE] Updated to Kotlin 1.4.20.
- [UPDATE] Updated to Kotlin Coroutines 1.4.2.
- [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) AddedGdxIdentityMapandGdxArrayMapaliases for libGDXIdentityMapandArrayMapcollections. - [FEATURE] (
ktx-collections) Addedsetoperator extension method toArrayMapto support square brackets assignment. - [FEATURE] (
ktx-graphics) Added optionalCameraand projection matrix parameters toShapeRenderer.use. - [FEATURE] (
ktx-scene2d) Addedimagebuilders forNinePatch,TextureRegion,TextureandDrawable.
- [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 genericcontainerfactory method that supports adding a custom actor.
- [MISC] Added
ktlintformatting. Contributors are asked to runformatGradle task before committing files. - [CHANGE] (
ktx-actors) DeprecatedAction.parallelToandParallelAction.parallelToextension methods were removed. Usealonginstead. - [CHANGE] (
ktx-actors) Touch event listeners attached with extension methods now extendInputListenerrather thanClickListener. - [CHANGE] (
ktx-actors)onTouchEventparameters renamed fromdownListenerandupListenertoonDownandonUp. - [CHANGE] (
ktx-actors) Event listeners attached with extension methods now consume theActorasthis. Listeners that used to consume actors as regular parameters now should rely onthisinstead. - [FEATURE] (
ktx-actors)KtxApplicationAdapter,KtxGameandKtxScreennow explicitly implement theDisposableinterface, matching thedisposemethod fromApplicationListenerandScreenrespectively. This allows to leverage existingDisposableutilities. - [FEATURE] (
ktx-ashley) AddedEngine.configureEntityextension method that allows to add components to an existing entity. - [FEATURE] (
ktx-assets) AddedDisposableRegistryandDisposableContainerfor management of multipleDisposableinstances. - [FEATURE] (
ktx-graphics) Added support forColordestructuring syntax. - [CHANGE] (
ktx-scene2d) Deprecated top-level widget factory methods and tooltip utilities were removed.
- [UPDATE] Updated to Kotlin 1.3.72.
- [UPDATE] Updated to Dokka 0.10.1.
- [CHANGE] Javadocs are no longer generated with Dokka. Since KTX focuses solely on Kotlin support for libGDX, usability from Java is not a priority. The generated Javadocs are not very helpful, especially for Kotlin development. Instead, the Javadoc jar published to Maven Central now contains exported Kotlin-compatible Dokka documentation. Starting from this release, GitHub releases will no longer contain the Javadoc archives.
- [FEATURE] (
ktx-actors) AddedAction.repeatextension method that allows to repeat an action for the given amount of times. - [FEATURE] (
ktx-ashley) AddedEngine.getoperator to access a chosenEntitySystem. - [FEATURE] (
ktx-ashley) AddedEngine.getSystemextension method to access a chosenEntitySystem. ThrowsMissingEntitySystemExceptionin case the system is not added. - [FEATURE] (
ktx-ashley) AddedEntity.addComponentextension method to create aComponentfor an existingEntity. - [FEATURE] (
ktx-ashley) AddedEntity.plusAssign(+=) operator that allows to add anComponentto anEntity. - [FEATURE] (
ktx-ashley) Added contracts support toEngineEntity.with,Engine.create,Engine.add,Engine.entityaddEntity.addComponent. Now their lambda parameters are ensured to be executed exactly once:
// Before:
lateinit var value: Int
engine.add {
value = 42
}
// Now:
val value: Int
engine.add {
value = 42
}- [FEATURE] (
ktx-assets)Iterable.disposeandArray.disposeextension methods consuming an error handler are now inlined. - [FEATURE] (
ktx-box2d) Added contracts support to body, fixture and joint factory methods, as well asFixtureDef.filterThis ensures that the configuration lambdas are executed exactly once. - [CHANGE] (
ktx-collections)PooledListwas removed due to concurrent iteration safety issues. Use standard library lists instead. - [CHANGE] (
ktx-collections)-and+operators no longer mutate the collections. Instead, they create a new collection instance and add or removed the selected elements. To modify an existing collection, use new mutating+=and-=operators. - [FEATURE] (
ktx-freetype) Added contracts support toAssetManager.loadFreeTypeFont,freeTypeFontParametersandFreeTypeFontGenerator.generateFont. This ensures that the font configuration lambdas are executed exactly once. - [FEATURE] (
ktx-freetype-async) Added contracts support toAssetStorage.loadFreeTypeFont. - [FEATURE] (
ktx-graphics) Added contracts support toCamera.update,Batch.use,ShaderProgram.use,GLFrameBuffer.useandShapeRenderer.use. - [FEATURE] (
ktx-inject) Added contracts support toContext.register. - [CHANGE] (
ktx-log) Added contracts to logging methods. Logging methods now might need to be imported explicitly. - [FEATURE] (
ktx-preferences) Added contracts support toPreferences.flush. - [FEATURE] (
ktx-math) Added+=,+,-=and-operators supporting floats and ints toVector2andVector3. - [CHANGE] (
ktx-math)-,!,++and--operators no longer mutate vectors and matrices, returning new instances instead. - [FIX] (
ktx-math) Operators documentation regarding mutating of vectors and matrices was updated. - [FEATURE] (
ktx-scene2d)scene2dobject was added. It supports the entire Scene2D DSL and allows to create root-level widgets. - [FEATURE] (
ktx-scene2d)Stage.actorsextension method was added. It allows to define actors with Scene2D DSL and adds all top-level actors to theStage. - [CHANGE] (
ktx-scene2d) Root-levelactorfunction was deprecated. - [CHANGE] (
ktx-scene2d) Root-level widget factory functions were deprecated. Usescene2d.prefix orStage.actorsto create these widgets. Note that the actors can still be created via standard DSL. See the migration guide in README. This includes:stackhorizontalGroupverticalGroupcontainersplitPanescrollPanetablewindowdialogbuttonGrouptree
- [CHANGE] (
ktx-scene2d)listWidgetandselectBoxnow have a single generic type to improve usability. Their building blocks no longer consumeCellandNodeinstances. - [CHANGE] (
ktx-scene2d) InternalKWidget.appendActorandKGroup.addmethods were removed. - [FEATURE] (
ktx-scene2d) Added contracts support to widget factory methods andStage.actors. This ensures that widget configuration lambdas are executed exactly once. - [FEATURE] (
ktx-style) Added contracts support to style factory methods and top-levelskinfunctions. - [CHANGE] (
ktx-vis) Overhaul of the module.ktx-visnow includes and extends thektx-scene2dmodule. The majority of APIs are now shared.- All factory methods for VisUI widgets are now inlined, which can improve the performance of GUI building.
- Factory methods of some VisUI widgets were renamed to avoid clashes with Scene2D methods and better reflect the wrapped widget class names:
label:visLabelimage:visImagelist:visList,visListOfselectBox:visSelectBox,visSelectBoxOfslider:visSlidertextArea:visTextAreatextField:visTextFieldvalidatableTextField:visValidatableTextFieldtextButton:visTextButtonimageButton:visImageButtonimageTextButton:visImageTextButtonradioButton:visRadioButtontree:visTreetable:visTablescrollPane:visScrollPanesplitPane:visSplitPaneaddTooltip:visTooltipaddTextTooltip:visTextTooltip
- Parental actors including
collapsible,dragPane,horizontalCollapsible,visScrollPane,visSplitPaneandmultiSplitPanenow do not require passing widgets to their factory methods. Instead, widgets are either automatically created or can be defined as nested children with the same DSL. - Inlined functions with lambda parameters, such as widget factories with their building block lambdas, now use Kotlin contracts to ensure that they are executed exactly once.
DEFAULT_STYLEconstant is removed in favor ofdefaultStylefromktx-scene2d.styleNameparameters in factory methods were renamed tostylefor consistency withktx-scene2d.@VisDslDSL marker is replaced with@Scene2dDslmarker fromktx-scene2d.- The sources documentation was greatly expanded.
- [FEATURE] (
ktx-vis-style) Added contracts support to widget style factory methods.
Known issues:
- [BUG] (
ktx-box2d) Due to a Kotlin compiler bug, methods with vararg parameters do not support contracts. This includes somepolygon,chainandloopfactory methods. See this issue. They can still be used and work as expected, but the compiler does not ensure that their lambda parameters are executed exactly once.
- [UPDATE] Updated to Kotlin 1.3.71.
- [UPDATE] Updated to Kotlin Coroutines 1.3.5.
- [UPDATE] Updated to Gradle 5.6.4.
- [FEATURE] (
ktx-app) Added profiling utilities.profileinlined function allows to profile an operation with the libGDXPerformanceCounter.PerformanceCounter.profileinlined extension method eases usage ofPerformanceCounterAPI.PerformanceCounter.prettyPrintallows to print basic performance data after profiling.
- [CHANGE] (
ktx-app)LetterboxingViewportmoved fromktx-apptoktx-graphics. - [FEATURE] (
ktx-ashley) AddedEntity.contains(inoperator) that checks if anEntityhas aComponent. - [FEATURE] (
ktx-assets-async) Added a new KTX module: coroutines-based asset loading.AssetStorageis a non-blocking coroutines-based alternative to libGDXAssetManager.getoperator obtains an asset from the storage or throws aMissingAssetException.getOrNullobtains an asset from the storage or returnnullif the asset is unavailable.getAsyncobtains a reference to the asset from the storage asDeferred.loadsuspends a coroutine until an asset is loaded and returns its instance.loadAsyncschedules asynchronous loading of an asset.loadSyncblocks the thread until selected asset is loaded.unloadschedules asynchronous unloading of an asset.addallows to manually add a loaded asset toAssetManager.disposeunloads all assets from the storage.getLoaderandsetLoadermanageAssetLoaderinstances used to load assets.isLoadedchecks if loading of an asset was finished.containsoperator checks if the asset was scheduled for loading or added to the storage.progressallows to check asset loading progress.getReferenceCountreturns how many times the asset was loaded or referenced by other assets as a dependency.getDependenciesreturns a list of dependencies of the selected asset.getAssetDescriptorcreates anAssetDescriptorwith loading data for the selected asset.getIdentifiercreates anIdentifieruniquely pointing to an asset of selected type and file path.
Identifierdata class added as an utility to uniquely identify assets by their type and path.Identifier.toAssetDescriptorallows to convert anIdentifierto anAssetDescriptor.
AssetDescriptor.toIdentifierallows to convert anAssetDescriptortoIdentifierused to uniquely identifyAssetStorageassets.LoadingProgressis an internal class used by theAssetStorageto track loading progress.
- [FEATURE] (
ktx-async) AddedRenderingScopefactory function for custom scopes using rendering thread dispatcher. - [FEATURE] (
ktx-async)newAsyncContextandnewSingleThreadAsyncContextnow supportthreadNameparameter that allows to set thread name pattern ofAsyncExecutorthreads. - [FIX] (
ktx-async)isOnRenderingThreadnow behaves consistently regardless of launching coroutine context. - [FEATURE] (
ktx-freetype-async) This KTX module is now restored and updated to the newAssetStorageAPI. There are no public API changes since the last released version. - [FEATURE] (
ktx-graphics) AddedLetterboxingViewportfromktx-app. - [FEATURE] (
ktx-graphics) AddedtakeScreenshotutility function that allows to save a screenshot of the application. - [FEATURE] (
ktx-graphics) AddedBitmapFont.centerextension method that allows to center text on an object. - [FEATURE] (
ktx-graphics) AddedCamerautilities.centerextension method allows to center the camera's position to screen center or the center of the chosen rectangle.moveToextension method allows to move the camera immediately at the chosen target position with optional offset.lerpToextension method allows to move the camera smoothly to the chosen target position with optional offset.updateinlined extension method allows to change camera state with automaticCamera.updatecall.
- [FEATURE] (
ktx-math) Addedlerpandinterpolateextension functions forFloatranges. - [FEATURE] (
ktx-preferences) Added a new KTX module: Preferences API extensions.- Added
setoperators forString,Int,Float,Double,Long,Boolean,Pair<String, Any>andAny - Added
getoperator which automatically determines preference type and retrieves them with the correct method. getandsetwill automatically attempt to (de)serialize non-basic preferences to and from JSON.set(String, Double)is deprecated, since the libGDXPreferencesdo not support doubles.- Added
flushinlined extension method that executes a lambda and automatically callsPreferences.flush.
- Added
- [CHANGE] (
ktx-scene2d) Improved typing support forTree.Nodewidgets. Since libGDX 1.9.10,Tree.Nodeis a generic class, but KTXKNoderemained non-generic until now. Type of stored actors must now be specified forKNodevariables, but thanks to that actors fromKNodeinstances are now correctly typed and easier to handle. This required minor internal changes -KWidget.storeActoris now generic. - [FEATURE] (
ktx-vis) Addedimage(VisImage) factory methods consumingTexture,TextureRegionandNinePatch.
- [FEATURE] (
ktx-actors) AddedonTouchDown,onTouchUpandonTouchEventextension methods that allow to attachClickListenerinstances to actors. - [CHANGE] (
ktx-collections)Array.removeAllandretainAllnow return a boolean if any elements were removed. - [CHANGE] (
ktx-collections)Array.transferis now less strict about typing. - [FEATURE] (
ktx-math) Added Kotlin ranges extensions that simplify creating ranges and rolling random numbers:Int.amid,Float.amid;+,-,*and/for ranges;ClosedRange<Float>.random,IntRange.random;ClosedRange<Float>.randomGaussian;ClosedRange<Float>.randomTriangular.
- [FEATURE] (
ktx-tiled) Added a new KTX module: Tiled API extensions.- Added
contains(in) andset([]) operators support toMapProperties. - Added extension methods that simplify properties extraction from
MapLayer,MapObject,TiledMap,TiledMapTileandTiledMapTileSet:propertypropertyOrNullcontainsProperty
- Added
shapeextension field toMapObject. - Added extension fields that ease extraction of basic properties from
TiledMapandMapObject.
- Added
- [UPDATE] Updated to Kotlin 1.3.61.
- [UPDATE] Updated to Kotlin Coroutines 1.3.3.
- [FEATURE] (
ktx-assets) AddedAssetGroupabstract class that allows to manage groups of assets. - [FEATURE] (
ktx-collections) AddedremoveAll,retainAllandtransferextensions to libGDXArrayusing lambda predicates to modify the array in-place. - [CHANGE] (
ktx-collections)PooledListnow implementsMutableIterable. - [FEATURE] (
ktx-graphics) AddedBatch.beginextension methods that automatically set projection matrix from aCameraorMatrix4. - [FEATURE] (
ktx-style) AddedSkinextension methods with reified resource types:optional,add,remove,hasandgetAll. - [FEATURE] (
ktx-style) The overloaded+=operator can now be used to add"default"resources toSkin. - [FEATURE] (
ktx-json) AddedJsonSerializerandReadOnlyJsonSerializeradapters to facilitate writing custom serializers. - [FEATURE] (
ktx-json) AddedreadOnlySerializer()factory functions to simplify creation ofReadOnlyJsonSerializer.
- [UPDATE] Updated to Kotlin 1.3.50.
- [UPDATE] Updated to Kotlin Coroutines 1.3.0.
- [UPDATE] Updated to Gradle 5.6.1.
- [CHANGE] (
ktx-actors)Action.parallelTochanged toAction.along. - [CHANGE] (
ktx-actors)Action.along(formerlyAction.parallelTo) andAction.thenno longer unwrap the second action. - [CHANGE] (
ktx-actors)ParallelAction.along(formerlyParallelAction.parallelTo) andSequenceAction.thensimply add the second action to the group without unwrapping. - [FEATURE] (
ktx-actors) Added/operator toAction, which performs the non-mutating version ofalong, wrapping the caller and argument in a newParallelAction. - [CHANGE] (
ktx-actors)ParallelAction.plus()andSequenceAction.plus()no longer unwrap their components. - [FIX] (
ktx-actors)along,then,+and/Actionextension methods now properly differentiate betweenSequenceActionandParallelAction, taking their inheritance into account. - [CHANGE] (
ktx-box2d) AddeddisposeOfShapeparameters tofixtureextension methods ofBodyandBodyDefinition. Setting these values totruewill cause the fixture shapes to be immediately disposed of afterFixtureconstruction. - [FIX] (
ktx-box2d) Removed memory leak caused by undisposed shapes. - [FEATURE] (
ktx-graphics)Batch.useextension methods now acceptMatrix4andCamerato update the batch's projection matrix before rendering.
- [UPDATE] Updated libGDX to 1.9.10.
- [UPDATE] Updated to Kotlin 1.3.41.
- [UPDATE] Updated to Kotlin Coroutines 1.3.0-RC2.
- [UPDATE] Updated VisUI to 1.4.4.
- [UPDATE] Updated to Gradle 5.5.1.
- [CHANGE] (
ktx-app)clearScreennow also clears depth buffer to support 3D applications. - [FEATURE] (
ktx-json) Added a new KTX module with the goal of improving libGDXJsonAPI:ktx-json. The following extension methods were added to avoid passing Java class instances:fromJsonaddClassTaggetTagsetElementTypesetSerializerreadValue
- [FEATURE] (
ktx-graphics) AddedGLFrameBuffer.useto allow safe omission of thebegin()andend()calls.
- [UPDATE] Updated to Kotlin 1.3.31.
- [UPDATE] Updated to Kotlin Coroutines 1.2.1.
- [FEATURE] (
ktx-assets) AddedTextAssetLoaderthat can be registered in anAssetManagerto load text files asynchronously. - [FEATURE] (
ktx-style) AddedSkin.getextension method that allows to pass enum instances as style names. - [CHANGE] (
ktx-style)Skin.getextension method are no longer infix. - [CHANGE] (
ktx-style)Skin.getnow has accepts default parameter equal to the default style name.
- [UPDATE] Updated libGDX to 1.9.9.
- [UPDATE] Updated to Kotlin 1.3.20.
- [UPDATE] Updated to Kotlin Coroutines 1.1.1.
- [UPDATE] Updated VisUI to 1.4.2.
- [UPDATE] Updated to Gradle 5.0.
- [CHANGE] (
ktx-actors) ReplacedStageandGroupextension operator methodsplusandminuswithplusAssignandminusAssignto avoid mutating the objects with addition and subtraction operators.
// Adding an actor to a Stage/Group - before:
stage + actor
group + actor
// Now:
stage += actor
group += actor- [CHANGE] (
ktx-actors) ReplacedStageandActorextension operator methodsplusandminuswithplusAssignandminusAssignto avoid mutating the objects with addition and subtraction operators.
// Adding an action to a Stage/Actor - before:
stage + action
actor + action
// Now:
stage += action
actor += action- [CHANGE] (
ktx-actors)SequenceAction.thenwas removed. Using the method on a sequence no longer mutates it for consistency withAction.then.thennow unwraps actors from passedSequenceActions. - [CHANGE] (
ktx-actors)ParallelAction.parallelTowas removed. Using the method on aParallelActionno longer mutates it for consistency withAction.parallelTo.parallelTonow unwraps actors from passedParallelActions. - [CHANGE] (
ktx-async) Overhaul of thektx-asyncmodule.KtxAsyncis now the main coroutines scope that should be used instead of theGlobalScope.Dispatchers.KTXcan be used to access a coroutines dispatcher that executes tasks on the main rendering thread.AsyncExecutorDispatchercan be used to wrap libGDXAsyncExecutorto execute tasks asynchronously.newSingleThreadAsyncContextallows to create anAsyncExecutorDispatcherwith a single thread.newAsyncContextallows to create anAsyncExecutorDispatcherwith the given max amount of threads.onRenderingThreadsuspends the coroutine to execute a task on the main rendering thread and return its result.isOnRenderingThreadallows to check whether the coroutine is executed on the main rendering thread.skipFrameattempts to suspend the coroutine for at least one rendering frame.httpRequestallows to perform an asynchronous HTTP request.scheduleandintervalfunctions simplify libGDXTimerAPI usage.AssetStorageand associated asset loading utilities were temporarily removed. They will be added to a separate module.- Asynchronous tests were significantly simplified.
- Assume that other utilities were either removed or integrated with the listed utilities.
- [CHANGE] (
ktx-freetype-async) The module is temporarily disabled due to the removal ofAssetStorage. - [FEATURE] (
ktx-actors) Added+operator to create sequence of actions (an alternative syntax tothen). - [FEATURE] (
ktx-actors) Added+=operators toSequenceActionandParallelActionto ease adding new actions to these action groups. - [FEATURE] (
ktx-actors) Addedstagefactory method that uses named and default parameters to easeStagecreation. - [FEATURE] (
ktx-graphics) AddedShapeRenderer.useto allow safe omission of thebegin()andend()calls. - [FEATURE] (
ktx-math) AddedImmutableVector2, an immutable equivalent toVector2.
- [UPDATE] Updated to Kotlin 1.2.70.
- [UPDATE] Updated to Kotlin Coroutines 0.26.1.
- [UPDATE] Updated to Gradle 4.10.2.
- [FIX] (
ktx-ashley) Component classes without a default no-arg constructors could not have been initiated by the Ashley engine. This is still the case, but now an exception with a meaningful message is thrown.
- [UPDATE] Updated to Kotlin 1.2.51.
- [UPDATE] Updated to Kotlin Coroutines 0.24.0.
- [UPDATE] Updated to Dokka 0.9.17.
- [UPDATE] Updated to Gradle 4.9.
- [CHANGE] (
ktx-async)KtxAsync.asynchronousis now inlined. The action lambda is cross-inlined to avoid excessive object creation.
- [UPDATE] Updated to Kotlin 1.2.41.
- [UPDATE] Updated to Gradle 4.7.
- [FEATURE] (
ktx-graphics) Added new graphics module with the followingShapeRendererextension methods:arcboxcircleconeellipserectrectLinerotatescaletranslatetriangle
- [CHANGE] (
ktx-app,ktx-graphics) Utility functions moved fromktx-appto the newktx-graphics:colorColor.copyBatch.useShaderProgram.use
- [MISC] Removed migration guides from very old versions. If you are in a process of migrating an existing
application to the latest KTX and facing any errors, see
READMEfiles in1.9.8-b2tag.
- [UPDATE] Updated to Kotlin 1.2.30.
- [UPDATE] Updated to Kotlin Coroutines 0.22.5.
- [UPDATE] Updated to Dokka 0.9.16.
- [UPDATE] Updated to Gradle 4.6.
- [FEATURE] (
ktx-math)dotandxinfix functions added toVector2andVector3allow to calculate dot products and cross products of two vectors respectively. - [FEATURE] (
ktx-box2d) Initiation blocks ofBodyinWorld.bodyextension method is now optional thanks to default lambda parameters in inlined functions. - [FEATURE] (
ktx-box2d)World.queryextension method allowing to execute AABB query with idiomatic Kotlin. - [CHANGE] (
ktx-math) Binary operators ofVector2,Vector3,Matrix3andMatrix4(+,-,*,/) no longer modify the first vector or matrix. Instead, they create new instances of vectors or matrices that store the operation result. Use the assign operators (+=,-=,*=,/=) instead to avoid creating new instances. - [CHANGE] (
ktx-math) New mutating assign operators (+=,-=,*=,/=) were added toVector2,Vector3,Matrix3andMatrix4. - [CHANGE] (
ktx-math) Parameters of matrix vector multiplication operators are switched.vector * matrixdoes not exist anymore and now is available asmatrix * vector. - [CHANGE] (
ktx-math) Operators ofMatrix3to left-multiply aVector3were removed.
- [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 tocreate,entityandwith, simplifying the implementation and making configuration blocks optional. - [CHANGE] (
ktx-inject) Parameters ofbindSingletonconsuming multiple classes have been swapped to be more compatible with thebindfunctions. - [CHANGE] (
ktx-inject)bindandbindSingletonmethods consuming multiple classes now takeKClassas parameters instead ofClass, so now you can useYourType::classinstead of more verboseYourType::class.java. - [FEATURE] (
ktx-style) Initiation blocks ofSkinand 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.
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-inject) Add higher-order function parameters forbindSingletonto allow the use of lambda expressions. - [FEATURE] (
ktx-freetype) Implementedktx-freetypemodule.AssetManager.registerFreeTypeFontLoadersallows to register all loaders necessary to handle FreeType font assets.AssetManager.loadFreeTypeFontprovides Kotlin DSL for loading of FreeType fonts.freeTypeFontParametersfunction provides Kotlin DSL for building FreeType font loading parameters.FreeTypeFontGenerator.generateFontextension function allows to generateBitmapFontwith Kotlin DSL.
- [FEATURE] (
ktx-freetype-async) Implementedktx-freetype-asyncmodule.AssetStorage.registerFreeTypeFontLoadersallows to register all loaders necessary to handle FreeType font assets.AssetStorage.loadFreeTypeFontprovides Kotlin DSL for asynchronous loading of FreeType fonts.
- [FIX] (
ktx-box2d) As libGDX 1.9.8 fixes itsChainShapeimplementation,ChainShapeutilities are supported once again.
- [UPDATE] Updated libGDX to 1.9.7.
- [UPDATE] Updated to Kotlin 1.1.51.
- [UPDATE] Updated to Kotlin Coroutines 0.19.3.
- [UPDATE] Updated to Gradle 4.3.
- [BUG] (
ktx-box2d)ChainShapedoes not work correctly in libGDX 1.9.7, and hence is not supported in KTX. This might break existing applications.
- [UPDATE] Updated to Kotlin 1.1.3-2.
- [UPDATE] Updated to Kotlin Coroutines 0.17.
- [UPDATE] Updated to Gradle 4.0.2.
- [CHANGE] (
ktx-app)KotlinApplicationwas removed. UseKtxApplicationAdapterorKtxGameinstead. - [CHANGE] (
ktx-app)KtxGameno longer supports fixed rendering time steps. - [FEATURE] (
ktx-app) Clearing screen on rendering is now optional when usingKtxGame. ChangeclearScreenparameter tofalseto turn off screen clearing. - [FEATURE] (
ktx-box2d)World.rayCastextension methods that allow creating ray-cast callbacks with the Kotlin lambda syntax.KtxRayCastCallbackalias added to ease implementation of this utility. - [FEATURE] (
ktx-box2d) AddedRayCastobject with constants that can be returned by the customRayCastCallbackimplementations.
- [UPDATE] Updated to Gradle 4.0.
- [UPDATE] Updated to Ashley 1.7.3.
- [CHANGE] (
ktx-ashley) Extensions updated to supportEnginebase class additionally to thePooledEngine.Engine.addandEngine.entityextension methods to replacePooledEngineequivalents.- Changed
PooledEntitytoEngineEntity, wrappingEntityand providing access toEngineAPI.
- [CHANGE] (
ktx-async)TextAssetLoadernow extendsAsynchronousAssetLoaderinstead ofSynchronousAssetLoader. - [FIX] (
ktx-async)AssetStoragenow correctly handlesSynchronousAssetLoaderinstances on the main rendering thread.
- [UPDATE] Updated to Kotlin 1.1.2-5.
- [UPDATE] Updated to Kotlin Coroutines 0.16.
- [FEATURE] (
ktx-actors)onChange,onClick,onKey,onKeyDown,onKeyUp,onScrollFocusandonKeyboardFocusfactory methods forEventListenerinstances were added. Contrary to existing factory methods, these use minimal set of parameters to make listeners creation as concise as possible. - [CHANGE] (
ktx-actors) ExistingonChange,onClick,onKey,onKeyDown,onKeyUp,onScrollFocusandonKeyboardFocusfactory methods where renamed toonChangeEvent,onClickEvent,onKeyEvent,onKeyDownEvent,onKeyUpEvent,onScrollFocusEventandonKeyboardFocusEventrespectively. Their excessive amount of parameters, useful only on rare occasions, led to unnecessary boilerplate during listeners creation. Seektx-actorsfile documentation for migration guide. - [FEATURE] (
ktx-ashley) new KTX module with Ashley entity component system utilities:ktx-ashley.PooledEngine.addandPooledEngine.entityextension methods.PooledEntitywrappingEntityand providing access toPooledEngineAPI.mapperForfactory method that allows to createComponentMapperinstances.- Accessors for
Entityobjects usingComponentMappers:get,has,hasNot,remove. - DSL methods for constructing
Familybuilders withKClassinstances:oneOf,allOf,exclude.
- [FEATURE] (
ktx-app) AddedKtxGame: KTX equivalent of libGDXGame. - [FEATURE] (
ktx-app) AddedKtxScreen: adapter of the libGDXScreeninterface making all methods optional to implement. - [FEATURE] (
ktx-app) AddedemptyScreenutility method returning a no-op implementation ofScreen. - [FEATURE] (
ktx-collections) Addedmap,filterandflattenextension methods that return libGDX collections. - [FEATURE] (
ktx-collections)PooledListnow properly implementshashCodeandequals. - [FEATURE] (
ktx-inject)Contextnow implementsDisposableand allows to dispose of all registered singletons and providers. - [FEATURE] (
ktx-inject) AddedContext.removeandremoveProvidermethods. Now providers for particular types can be removed without clearing the whole context. - [FEATURE] (
ktx-inject)getProvider,setProviderandclearmethods ofContextare now open and can be overridden.
- [UPDATE] Updated to Kotlin 1.1.2-3.
- [UPDATE] Updated to Kotlin Coroutines 0.15.
- [CHANGE] (
ktx-assets) StaticAssetManagerinstance container -Assets- was removed. All top level functions depending on the globalAssetManagerwere removed. - [FEATURE] (
ktx-assets) AddedFileType.getResolverextension method creatingFileHandleResolverinstances. - [FEATURE] (
ktx-assets) AddedFileHandleResolver.withPrefixextension method decorating resolvers withPrefixFileHandleResolver. - [FEATURE] (
ktx-assets) AddedFileHandleResolver.forResolutionsextension method decorating resolvers withResolutionFileResolver. - [FEATURE] (
ktx-assets) Addedresolutionfunction constructingResolutionFileResolver.Resolutioninstances. - [FEATURE] (
ktx-async) AddedAssetStorage: a lightweight coroutines-based alternative toAssetManager. - [FEATURE] (
ktx-box2d) Implemented a new KTX module with Box2D physics engine utilities:ktx-box2d.worldfactory method constructingWorldinstances.World.bodyextension method providing type-safe builder DSL forBodyinstances.FixtureDefbuilder methods supporting all shapes (CircleShape,PolygonShape,ChainShape,EdgeShape).FixtureDef.filderextension methods simplifyingFilterproperties setup.BodyDefinitionis aBodyDefextension providingBodybuilding DSL. Used internally byWorld.body.FixtureDefinitionis aFixtureDefextension providingFixturebuilding DSL. Used internally byBodyDefinition.fixture,circle,box,polygon,chain,loopandedgeextensionFixturebuilding methods added toBody.earthGravityproperty allowing to setWorldgravity roughly matching Earth's gravity.onCreatecallbacks inBodyDefinitionandFixtureDefinitiongiving access to builtBodyandFixtureinstances in building blocks.Bodyextension methods that ease creation ofJointinstances between 2 bodies:jointWith,gearJointWith,ropeJointWith,weldJointWith,motorJointWith,mouseJointWith,wheelJointWith,pulleyJointWith,distanceJointWith,frictionJointWith,revoluteJointWith,prismaticJointWith.
- [CHANGE] (
ktx-i18n) StaticI18NBundleinstance container -I18n- was removed. - [CHANGE] (
ktx-i18n) Top levelnlsfunctions were removed. - [FEATURE] (
ktx-i18n)nlsproperty and method added toBundleLinefor extra readability. - [CHANGE] (
ktx-inject) StaticContextinstance container was removed. All top level functions depending on the globalContextwere removed. - [FEATURE] (
ktx-inject)Context.registerbuilder method added to ease context initiation process.
- [UPDATE] Updated to Kotlin 1.1.1.
- [UPDATE] Updated to VisUI 1.3.0.
- [FEATURE] (
ktx-actors) Added inlinedtxtextension properties toLabelandTextButtonwidgets. - [FEATURE] (
ktx-actors) AddedKtxInputListener: anInputListenerextension with parameter types improvements. - [FEATURE] (
ktx-actors)alphaextension properties ofActorandStageare now inlined. - [FEATURE] (
ktx-app) AddedKtxApplicationAdapterinterface which makes implementing all ofApplicationListenermethods optional. - [FEATURE] (
ktx-app) AddedKtxInputAdapterinterface which makes implementing all ofInputProcessormethods optional. - [FEATURE] (
ktx-app) Addeduseinlined methods toBatchandShaderProgram, allowing to omitbegin()andend()calls. - [FEATURE] (
ktx-app) Addedcolorfactory method to allow constructing libGDXColorinstances with named parameters. - [FEATURE] (
ktx-app) AddedColor.copyextension method that allows to copyColorinstances with optional overriding of chosen values. - [CHANGE] (
ktx-app)KotlinApplication#timeSinceLastRendernow has a protected default getter. - [CHANGE] (
ktx-assets) StaticAssetManagerinstance container was deprecated. Static access toAssetManagerwill be removed in the next release. - [FEATURE] (
ktx-assets) Addedload,loadAsset,loadOnDemand,getAsset,unloadandunloadSafetyextension methods toAssetManagerto provide an alternative to equivalent utility functions using static manager instance. - [FEATURE] (
ktx-assets) AddedgetLoaderandsetLoaderextension methods toAssetManagerforAssetLoaderhandling. - [FEATURE] (
ktx-async) Implemented a new KTX module with multi-threaded operations utilities:ktx-async.- Implemented coroutines context using libGDX threading model:
KtxAsync. It resumes suspending operations on the main rendering thread withGdx.app.postRunnableutility. It has to be initiated on the main thread withenableKtxCoroutines. - Added utility
ktxAsyncfunction which launches non-blocking coroutine usingKtxAsynccontext. - Added
skipFramemethod that suspends the coroutine and resumes it on the next frame usingGdx.app.postRunnable. - Added
delaymethod that offers non-blocking coroutine suspensions for the given period of time. - Added
httpRequestmethod that performs asynchronous suspending HTTP request using libGDXNetAPI. - Added
asynchronousmethod, which allows to perform suspending operations on a separate thread. scheduleandintervalutility methods added to ease the use ofcom.badlogic.gdx.utils.TimerAPI.- Added
HttpRequestResult: a thread-safeHttpResponsewrapper that addresses libgdx#4700.
- Implemented coroutines context using libGDX threading model:
- [FEATURE] (
ktx-collections) AddedsortDescending,sortByandsortByDescendingutility methods to libGDXArray. - [FEATURE] (
ktx-collections) Added type aliases to libGDX collections to avoid name collisions with standard library:GdxArray:com.badlogic.gdx.utils.ArrayGdxIntArray:com.badlogic.gdx.utils.IntArrayGdxFloatArray:com.badlogic.gdx.utils.FloatArrayGdxBooleanArray:com.badlogic.gdx.utils.BooleanArrayGdxCharArray:com.badlogic.gdx.utils.CharArrayGdxLongArray:com.badlogic.gdx.utils.LongArrayGdxShortArray:com.badlogic.gdx.utils.ShortArrayGdxSet:com.badlogic.gdx.utils.ObjectSetGdxMap:com.badlogic.gdx.utils.ObjectMapGdxList:ktx.collections.PooledList
- [FEATURE] (
ktx-collections)lastIndexextension properties of libGDX arrays are now inlined. - [FEATURE] (
ktx-collections) Addedcomponent1()andcomponent2()operator extension methods toEntryclasses of libGDX maps to support destructing syntax and simplify iteration. - [CHANGE] (
ktx-i18n) StaticI18NBundleinstance container was deprecated. Static access toI18NBundlewill be removed in the next release. - [CHANGE] (
ktx-inject) StaticContextinstance container was deprecated. Static access toContextwill be removed in the next release. - [FEATURE] (
ktx-scene2d,ktx-vis)inCellextension property added toTablechildren. Now you can easily accessCellinstance outside of the actors' building blocks. - [FEATURE] (
ktx-scene2d,ktx-vis)inNodeextension property added toTreechildren. Now you can easily accessNodeinstance outside of the actors' building blocks. - [FEATURE] (
ktx-scene2d,ktx-vis) fluentcellextension method added toTablechildren, allowing to configureCellproperties outside of actors' building blocks. - [FEATURE] (
ktx-scene2d,ktx-vis) fluentnodeextension method added toTreechildren, allowing to configureNodeproperties outside of actors' building blocks. - [FEATURE] (
ktx-scene2d,ktx-vis) Resolved DSL scoping issues with Kotlin 1.1@DslMarkerAPI. - [CHANGE] (
ktx-scene2d,ktx-vis) Due to@DslMarkerintroduction, implicit access to parental widgets is no longer possible in children building blocks. Seektx-scene2dorktx-visdocumentation for more info on the migration. - [CHANGE] (
ktx-scene2d)KNode.invokeextension method was moved directly toKNodeAPI and no longer has to be imported. - [FEATURE] (
ktx-style)Skininstance is now available under lambda parameter ofskinmethod init blocks. - [FEATURE] (
ktx-style,ktx-style-vis) Resolved DSL scoping issues with Kotlin 1.1@DslMarkerAPI. - [CHANGE] (
ktx-style,ktx-style-vis) Due to@DslMarkerintroduction, implicit access toSkininstance is no longer possible. Seektx-styledocumentation for more info on the migration. - [FEATURE] (
ktx-vis) Added support forHorizontalCollapsibleWidget:horizontalCollapsiblebuilder methods added to all parental actors. - [FEATURE] (
ktx-vis) Added support forVisTreebuilding using type-safe API. - [CHANGE] (
ktx-vis) Cells and nodes are now available as lambda parameters. Seektx-visdocumentation for migration guide.
- [UPDATE] Updated to libGDX 1.9.6.
- [UPDATE] Updated to Kotlin 1.1.0.
- [FEATURE] (
ktx-collections) Added null-safesize()method to libGDXIntArray,FloatArrayandBooleanArraycollections. - [FEATURE] (
ktx-collections) Added null-safe extension propertylastIndexto libGDXArrayListequivalents:Array,IntArray,FloatArrayandBooleanArray.
- [UPDATE] Updated to libGDX 1.9.5.
- [FEATURE] (
ktx-actors) AddedActor.onKeyUpandActor.onKeyDownextension methods that attachEventListenerimplementations listening toInputEventinstances. - [FEATURE] (
ktx-app) Implementedktx-appmodule.KotlinApplicationis anApplicationAdapterequivalent with fixed rendering time step.clearScreenutility function allows to easily clear the application screen.LetterboxingViewportis aViewportimplementation that combinesScreenViewportandFitViewportbehaviors.
- [FEATURE] (
ktx-vis) AddedListViewStylesupport toListViewfactory methods. - [FEATURE] (
ktx-vis) Added top leveltab()method. - [FEATURE] (
ktx-vis-style) AddedListViewStylefactory method:listView. - [FIX] (
ktx-scene2d) Added missingTextButtonfactory methods.
- [UPDATE] Updated to libGDX 1.9.4.
- [FEATURE] (
ktx-actors) Implementedktx-actorsmodule.isShown,centerPosition,setKeyBoardFocusandsetScrollFocusextension methods forActor.containsoperator extension method ofGroupandStagesupportingactor in groupsyntax.+and-operator for adding actors toGroupandStage.alphaextension field forActorandStage.- Lambda consuming
onChange,onClick,onKey,onScrollFocusandonKeyboardFocusextension methods forActor, allowing to quickly define event listeners. +and-operator extension methods can be used to addActioninstances to aStage.Action.theninfix extension method can be used to chain actions into sequences.Action.repeatForeverwraps an action in aRepeatActionwithout a repetitions limit.
- [FEATURE] (
ktx-assets) Implementedktx-assetsmodule.Assets.managerglobalAssetManagerinstance.loadfunction can be used to load assets asynchronously via the globalAssetManagerinstance.loadOnDemandcan be used to load assets immediately in a blocking manner.unloadcan unload the assets.assetfunction can be used to access loaded assets from the globalAssetManagerinstance.isLoadedallows to check if an asset has been loaded by the globalAssetManager.
disposeSafelyand lambda consumingdisposewere added toDisposable.IterableandArrayinstances storingDisposableelements can now be disposed.Exception.ignoreextension method was added for explicit no-op handling of exceptions.Pool.invokeoperator extension method was added as an alternative toPool.obtain.Pool.invoke(T)operator extension method was added as an alternative toPool.free(T).- Lambda consuming
poolfactory function was added. toClasspathFile,toInternalFile,toLocalFile,toExternalFileandtoAbsoluteFileconverter methods added toFileHandle.filefactory function was added.
- [FEATURE] (
ktx-collections) Implementedktx-collectionsmodule.Arrayfactory functiongdxArrayOfand converter methodtoGdxArray.Arrayextensions including:isEmpty,isNotEmpty,size,+,-,getLast,removeLast,get,addAll,removeAll,iterate.ObjectSetfactory functiongdxSetOfand converter methodtoGdxSet.ObjectSetextensions including:isEmpty,isNotEmpty,size,+,-,addAll,removeAll,iterate.ObjectMapfactory functiongdxMapOfandIdentityMapfactorygdxIdentityMapOf.- Maps extensions including:
isEmpty,isNotEmpty,size,contains(in),set([]),iterate,toGdxSet. - Lambda consuming
Iterable.toGdxMapallows to convert any collection to aObjectMap. PooledListcollection as an alternative toPooledLinkedList. IncludesgdxListOfandtoGdxListfactory methods.
- [FEATURE] (
ktx-i18n) Implementedktx-i18nmodule.I18n.defaultBundleglobalI18NBundleinstance loaded byI18n.load.addListener,removeListenerandclearListenersofI18nallow to handle the lifecycle of the globalI18NBundle.nlsfunctions allow to access globalI18NBundle.I18NBundle.getoperator function improves access to the bundle lines.BundleLineis an interface designed to be implemented by enums that match bundle line names stored in an i18n properties file.
- [FEATURE] (
ktx-inject) Implementedktx-injectmodule.Contextis the core of the dependency injection framework, storing the registered singletons and providers.- Global
Contextinstance is available viaContextContainer.defaultContext. injectandproviderfunctions allow to extract instances and providers of selected type from the globalContext.registerallows to add singletons and providers to the globalContext.
- [FEATURE] (
ktx-log) Implementedktx-logmodule.debug,infoanderrorfunctions allow to log data with the libGDX logging API.loggerfactory function provides instances of the KTXLoggerthat wraps libGDX logging API.
- [FEATURE] (
ktx-math) Implementedktx-mathmodule.vec2,vec3,mat3andmat4factory methods forVector2,Vector3,Matrix3andMatrix4respectively.+,-,*,/,-,++,--,<,>,<=,>=operators support forVector2andVector3.+,-,*,!,-operators support forMatrix3andMatrix4.Vector2,Vector3,Matrix3andMatrix4are now decomposable into 2, 3, 9 and 16 components respectively.
- [FEATURE] (
ktx-scene2d) Implementedktx-scene2dmodule.- Added DSL for constructing complex
Scene2Dwidgets.- Factory methods for parental actors:
buttonTable,container,dialog,horizontalGroup,scrollPane,splitPane,stack,table,tree,verticalGroupandwindow. - Factory methods for secondary parental actors:
button,checkBox,imageButtonandimageTextButton. - Factory methods for child actors:
image,label,list,progressBar,selectBox,slider,textArea,textFieldandtouchpad.
- Factory methods for parental actors:
- Added DSL for constructing complex
- [FEATURE] (
ktx-style) Implementedktx-stylemodule.skinfactory methods producingSkininstances.getoperator infix function for quick access ofSkinresources.setoperator function for quick modification ofSkinresources.- Factory methods for styles of
Scene2Dwidgets:color,button,checkBox,imageButton,imageTextButton,label,list,progressBar,selectBox,slider,splitPane,textButton,textField,textTooltip,touchpad,tree,window.
- [FEATURE] (
ktx-vis) Implementedktx-vismodule.- Added DSL for constructing complex
VisUIwidgets.
- Added DSL for constructing complex
- [FEATURE] (
ktx-vis-style) Implementedktx-vis-stylemodule.- Factory methods for styles of
VisUIwidgets.
- Factory methods for styles of