ktx v1.9.10-b5 Release Notes
-
- ⚡️ [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.profile
inlined function allows to profile an operation with the LibGDXPerformanceCounter
.PerformanceCounter.profile
inlined extension method eases usage ofPerformanceCounter
API.PerformanceCounter.prettyPrint
allows to print basic performance data after profiling.
- [CHANGE] (
ktx-app
)LetterboxingViewport
moved fromktx-app
toktx-graphics
. - [FEATURE] (
ktx-ashley
) AddedEntity.contains
(in
operator) that checks if anEntity
has aComponent
. - [FEATURE] (
ktx-assets-async
) Added a new KTX module: coroutines-based asset loading.AssetStorage
is a non-blocking coroutines-based alternative to LibGDXAssetManager
.get
operator obtains an asset from the storage or throws aMissingAssetException
.getOrNull
obtains an asset from the storage or returnnull
if the asset is unavailable.getAsync
obtains a reference to the asset from the storage asDeferred
.load
suspends a coroutine until an asset is loaded and returns its instance.loadAsync
schedules asynchronous loading of an asset.loadSync
blocks the thread until selected asset is loaded.unload
schedules asynchronous unloading of an asset.add
allows to manually add a loaded asset toAssetManager
.dispose
unloads all assets from the storage.getLoader
andsetLoader
manageAssetLoader
instances used to load assets.isLoaded
checks if loading of an asset was finished.contains
operator checks if the asset was scheduled for loading or added to the storage.progress
allows to check asset loading progress.getReferenceCount
returns how many times the asset was loaded or referenced by other assets as a dependency.getDependencies
returns a list of dependencies of the selected asset.getAssetDescriptor
creates anAssetDescriptor
with loading data for the selected asset.getIdentifier
creates anIdentifier
uniquely pointing to an asset of selected type and file path.
Identifier
data class added as an utility to uniquely identify assets by their type and path.Identifier.toAssetDescriptor
allows to convert anIdentifier
to anAssetDescriptor
.
AssetDescriptor.toIdentifier
allows to convert anAssetDescriptor
toIdentifier
used to uniquely identifyAssetStorage
assets.LoadingProgress
is an internal class used by theAssetStorage
to track loading progress.
- [FEATURE] (
ktx-async
) AddedRenderingScope
factory function for custom scopes using rendering thread dispatcher. - [FEATURE] (
ktx-async
)newAsyncContext
andnewSingleThreadAsyncContext
now supportthreadName
parameter that allows to set thread name pattern ofAsyncExecutor
threads. - [FIX] (
ktx-async
)isOnRenderingThread
now behaves consistently regardless of launching coroutine context. - [FEATURE] (
ktx-freetype-async
) This KTX module is now restored and updated to the newAssetStorage
API. 🚀 There are no public API changes since the last released version. - [FEATURE] (
ktx-graphics
) AddedLetterboxingViewport
fromktx-app
. - [FEATURE] (
ktx-graphics
) AddedtakeScreenshot
utility function that allows to save a screenshot of the application. - [FEATURE] (
ktx-graphics
) AddedBitmapFont.center
extension method that allows to center text on an object. - [FEATURE] (
ktx-graphics
) AddedCamera
utilities.center
extension method allows to center the camera's position to screen center or the center of the chosen rectangle.moveTo
extension method allows to move the camera immediately at the chosen target position with optional offset.lerpTo
extension method allows to move the camera smoothly to the chosen target position with optional offset.update
inlined extension method allows to change camera state with automaticCamera.update
call.
- [FEATURE] (
ktx-math
) Addedlerp
andinterpolate
extension functions forFloat
ranges. - [FEATURE] (
ktx-preferences
) Added a new KTX module: Preferences API extensions.- Added
set
operators forString
,Int
,Float
,Double
,Long
,Boolean
,Pair<String, Any>
andAny
- Added
get
operator which automatically determines preference type and retrieves them with the correct method. get
andset
will automatically attempt to (de)serialize non-basic preferences to and from JSON.set(String, Double)
is deprecated, since the LibGDXPreferences
do not support doubles.- Added
flush
inlined extension method that executes a lambda and automatically callsPreferences.flush
.
- Added
- [CHANGE] (
ktx-scene2d
) Improved typing support forTree.Node
widgets. Since LibGDX 1.9.10,Tree.Node
is a generic class, but KTXKNode
remained non-generic until now. Type of stored actors must now be specified forKNode
variables, but thanks to that actors fromKNode
instances are now correctly typed and easier to handle. This required minor internal changes -KWidget.storeActor
is now generic. - [FEATURE] (
ktx-vis
) Addedimage
(VisImage
) factory methods consumingTexture
,TextureRegion
andNinePatch
.