Defold 1.2.165
First of all, I’d like to thank everyone that participated in the beta, it was extremely useful
to us and the rest of the users. Thank you!
This sprint we’ve added initial support for Sprite trimming, an often requested feature.
With it, you can minimize the polygon area of a sprite, leading to less overdraw of pixels.
We also fixed a potential issue with respect to ANRs (Android Not Responding) during shutdown of the sound engine. The end users might not have noticed the issue, but our developers have seen these issues in the Google console.
Another big step forward is our shift towards using Gradle for the dependency resolving for native extensions on Android phones. This will lead to easier maintenance and development going forward.
Engine
Engine
-
Issue-3153
- Added: Get the window size using window.get_size() -
Issue-4577
- Added: Add engine licenses to builtins.zip -
Issue-4350
- Added: Sprite trimming for atlases (Overdraw) -
Issue-4585
- Fixed: HTTP request crash on Windows when offline -
Issue-4566
- Fixed: Doing a msg.post() with nil as message generates an error -
Issue-3119
- Fixed: Possible ANR caused by playing sounds on exit - Don’t wait for sound buffers on shutdown -
Issue-4594
- Fixed: The project settings are now read before the library resolve is done in bob.jar -
Issue-4591
- Fixed: Added new launch images for iPad Pro and iPhone XR+XS Max
Sprite trimming (pt 1)
In this first part of the sprite trimming feature, we have added internal support for
sprites made up of more than 2 triangles.
This first step is done in order to reduce sprite overdraw.
The feature allows you to configure an (auto generated) convex hull for atlas images.
You can choose between 4-8 vertices in the hull.
Due to batching, this feature affects the collection the sprite is in: If you enable trimming for one sprite in the collection, all other sprites are using it as well.
To disable the feature, set all images to SPRITE_TRIM_MODE_OFF
(default).
Gui
This feature is implemented for Gui as well, but only for box nodes.
Also if the node has 9-slice enabled, the sprite trimming is disabled for that node.
Future
In the future, we will also use this info to pack the textures better into the atlas, greatly reducing the download sizes for the projects. We can then also support external 3rd party file formats.
Gradle dependency resolving
To ease the extension development for the Android platform, we’ve added support for Gradle dependency resolving.
To use this, add a file in your extension: <extension>/manifests/android/build.gradle
and add your dependencies in it. E.g.:
dependencies {
// https://developers.google.com/android/guides/setup
implementation 'com.google.android.gms:play-services-base:16.+'
// https://developer.android.com/topic/libraries/support-library/packages
implementation 'com.android.support:support-compat:26.+'
}
We’re currently using Gradle 6.
Examples:
Android resources
Since we don’t want to download all android resources from the build server to the client, we instead upload any client resources to the server.
Manifest merging
We now perform the manifest merging on the server due to the fact that each android dependency can contain a manifest stub.
Build result
In the build folder, after a successful cloud build, we now unpack the entire build.zip, making it easier for you to find the resulting files: executable, symbols, manifest files, resources files and the log file.