KTX 1.10.0-b4
Pre-release
Pre-release
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.