editor.ui.image() editor script function (by vlaaad)/command/build respond on build completion (by vlaaad)High DPI is off (by AGulev)gui.pick_node() function when Safe Area is used (by AGulev)go.property() might prevent the project from compiling (by AGulev)NEW: (#11784) ‘Property options refactor’ by Jhonnyg
Refactored the dmGameObject::PropertyOptions struct from dmSDK into an API that can be used to encapsulate multiple options from an options table in the lua script API (e.g go.get / go.set):
typedef struct PropertyOptions* HPropertyOptions;
uint32_t GetPropertyOptionsCount(HPropertyOptions options);
PropertyResult GetPropertyOptionsIndex(HPropertyOptions options, uint32_t options_index, int32_t* result);
PropertyResult GetPropertyOptionsKey(HPropertyOptions options, uint32_t options_index, dmhash_t* result);
Since this is an SDK change, certain adjustments are required in custom components:
// Old code:
dmGameSystem::SetMaterialConstant(material, params.m_PropertyId, params.m_Value, params.m_Options.m_Index, set_constant_cb, component);
// New code:
int32_t value_index = 0;
dmGameObject::GetPropertyOptionsIndex(params.m_Options, 0, &value_index);
dmGameSystem::SetMaterialConstant(material, params.m_PropertyId, params.m_Value, value_index, set_constant_cb, component);
NEW: (#9746) ‘Add support for setting and getting custom attribute data for model components’ by Jhonnyg
go.get, go.set and go.animate can now be used to query or set custom vertex data for models. This will only be supported for the first mesh in the component, if the model file contains multiple meshes there is currently no way of indexing or referencing those. This will be added at a later time!
Note: that this can be an expensive operation depending on how large the mesh is and if you are setting an instanced attribute or not. To learn more about instancing read here, and to learn more about custom vertex formats read here.
This example uses go.animate on the separate cubes to animate a custom vertex stream called “custom_color”:
for i = 1, 16 do
local rnd_color = vmath.vector4(math.random(), math.random(), math.random(), 1)
local rnd_time = math.random(2, 7)
go.animate("/go" .. i .. "#model", "custom_color", go.PLAYBACK_LOOP_PINGPONG, rnd_color, go.EASING_INQUAD, rnd_time)
end
Test project: issue-9746-model-set-custom-attributes.zip
NEW: (#11616) ‘Added 3D Third Person Playground as sample in the Editor’ by paweljarosz Added an official 3D Third Person Playground Defold sample game from https://github.com/defold/sample-third-person-playground to the Samples in the Defold Editor.
NEW: (#10516) ‘Remove redunant uniform keyword’ by Jhonnyg
NEW: (#3417) ‘Get and set properties from ParticleFX emitters’ by Jhonnyg
The first iteration of getting and setting properties for particlefx emitters via go.get / go.set is now available:
go.property("my_material", resource.material())
function init(self)
local cone_material = go.get("#particlefx", "material", { keys = })
-- change the material for the next time the particlefx is played
go.set("#particlefx", "material", self.my_material, { keys = })
end
Important note: The changes invoked via go.set will NOT affect the currently playing particlefx, they will only have an effect when playing the fx next time. For example, if you want to change material in an input handler, you need to first stop the particlefx and then play it again:
function on_input(self, action_id, action)
if action_id == hash("space") and action.released then
particlefx.stop("#particlefx")
go.set("#particlefx", "material", self.my_material, {keys = })
particlefx.play("#particlefx")
end
end
The properties we currently support for emitters are:
As this is the first iteration of this feature, very few properties are available. In the future, we hope to support more properties and even curved properties!
NEW: (#3575) ‘Added JobSystem C api to dmsdk’ by JCash This allows developers to either use the precreated job system (named “jobs” in the context cache), or create their own when needed.
For non threaded targets (e.g. html5), the default job system is also updated on the main thread, as that where our synchronisation with Lua happens.
NEW: (#9547) ‘Support more than 8 vertex streams’ by Jhonnyg Vertex shaders can now use more than 8 inputs, which was the previous limit. Now there is no limitation from the engine to how many input streams you can use, but please keep in mind that there are still GPU / driver limitations.
NEW: (#11530) ‘Added GLTF models to built-in assets.’ by paweljarosz
Added GLTF (embedded with buffers) .gltf files as replacement for equivalent built-in Collada .dae files.
NEW: (#11825) ‘Moved texture transcoding to a thread during the resource preload step’ by britzl Texture transcoding is now done on a thread during the resource preload step.
FIX: (#11567) ‘Fix WebGPU crash when mipmaps are enabled’ by britzl This fixes a crash when mipmaps are enabled when using WebGPU on Chrome.
FIX: (#11751) ‘Uniform buffer as first class object’ by Jhonnyg The engine can now create, bind and manipulating uniform buffer objects in runtime. These can then be used for immutable data storage inside the engine for storing things like PBR materials and light component data. There is no user facing code involved here yet, but it is a requirement for the upcoming light component refactor.
FIX: (#11764) ‘Handle proxy unload and load during the same frame’ by britzl This fixes an issue when unloading and loading the same collection in a single frame.
FIX: (#9560,#11779,#9568) ‘Fix issues where DF fonts appear blurry in some cases.’ by AGulev DF smoothing for distance-field fonts is now computed in screen space rather than world space. The renderer derives a pixels-per-local-unit scale from the current view-projection matrix and viewport, ensuring stable edge thickness under camera zoom and perspective.
FIX: (#8998) ‘Fix blurry distance field font in HTML5 when High DPI is off’ by AGulev
Distance-field font smoothing is now clamped at runtime to prevent text from becoming overly soft or gray when it becomes too small in pixel size. This typically happens when High DPI is turned off, the camera is heavily zoomed out, or the font scale is reduced too much.
FIX: (#11848) ‘Improve the empty resource message in bob’ by britzl This change improves the exception message when a required resource field is empty.
From this forum discussion: https://forum.defold.com/t/cant-make-a-build/82323/3?u=britzl
FIX: (#11844) ‘Avoid unnecessary resize calls when the size hasn’t changed.’ by AGulev
This fixes a problem where the HTML5 resize_window_callback function is executed every time a resize event occurs, even when the window size has not actually changed. The callback is now only executed when the window size changes compared to the previous stored values, not on every resize event.
FIX: (#11870) ‘Fix the gui.pick_node() function when Safe Area is used’ by AGulev
This fixes an issue with touch events being offset when using gui.pick_node() in combination with the new built-in safe area mode.
FIX: (#11885) ‘Added dmsdk C api for Window creation’ by JCash
NEW: (#11597,#10761) ‘Asset Browser: Group by resources for “New…” menu’ by JosephFerano The “New…” right-click context menu in the Asset Browser was getting a bit tall, so now it is formatted as a grid with sub-categories that groups items together for more compact organization. Supports arbitrary group names and uncategorized resources.
NEW: (#11717) ‘Added support for WebP and AVIF image formats for the HTML5 splash screen’ by britzl It is now possible to select WebP and AVIF image files for the HTML5 Splash Image game.project field.
NEW: (#10220) ‘Add editor.ui.image() editor script function’ by vlaaad
Now, editor scripts can show images, supporting both project files and external URLs, e.g.:
editor.ui.show_dialog(editor.ui.dialog({
title = "Images",
content = editor.ui.horizontal({
padding = editor.ui.PADDING.LARGE,
children = {
editor.ui.image({image = "/builtins/assets/images/logo/logo_256.png", width = 64, height = 64}),
editor.ui.image({image = "https://defold.com/images/assets/monarch-hero.jpg"})
}
})
}))
NEW: (#11733) ‘Make /command/build respond on build completion’ by vlaaad
We made the HTTP command that triggers the editor build block until the build completes, and made it respond with the build status + compilation issues. This should make it much more useful for AI agents and third-party IDE integrations.
curl -X POST "http://127.0.0.1:$(cat .internal/editor.port)/command/build" --silent | jq
{
"success": true,
"issues": []
}
curl -X POST "http://127.0.0.1:$(cat .internal/editor.port)/command/build" --silent | jq
{
"success": false,
"issues": [
{
"severity": "error",
"message": "go.property declaration should be a top-level statement",
"resource": "/main/logo.script",
"range": {
"start": {
"line": 3,
"character": 4
},
"end": {
"line": 3,
"character": 35
}
}
}
]
}
# Docs
https://defold.com/llms.txt
# Build
- Read editor port from `.internal/editor.port`
- Build game: `curl -X POST http://127.0.0.1:<PORT>/command/build`
# Console
- After launch, check logs at `http://127.0.0.1:<PORT>/console`.
NEW: (#11000) ‘Backspace key (⌫) now performs a Delete action on macOS’ by vlaaad Pressing Backspace (⌫) now performs a Delete action on macOS.
NEW: (#5453) ‘Localize error messages in the editor’ by vlaaad Error messages are now localized in the editor.
FIX: (#11773) ‘Fixed an issue where errors in go.property() might prevent the project from compiling’ by AGulev
Throw a proper error when math is used in go.property()
FIX: (#11711) ‘Improved scrolling behavior in Assets Browser and Outline Pane’ by JosephFerano
FIX: (#11787) ‘Significantly improve load time and memory consumption of large projects’ by vlaaad On some large projects:
This was achieved by delaying the computation of data that is used for applying changes in the editor until it is actually needed, rather than computing it eagerly when loading the project.
The downside is that in some cases, the first time a change to a particular element is made, it will take longer than before (worst case: 6s->35s). It is noticeable only in some rare cases in large projects when changing resources that are widely used throughout the project (e.g., when changing a GUI button layout when the button is referenced in hundreds/thousands of places). Subsequent changes to the same element will be faster than before.
Overall, the tradeoff is worth it, because previously, every user had to always pay this cost when opening the project, while now, the cost is only paid when actually making certain changes to edge case elements, and even then, the wait is significantly reduced (30s instead of 2m).
FIX: (#11799) ‘Improve project load time on big projects by 9%’ by vlaaad Now the editor opens big projects a bit faster. As measured on an example big project, the load time reduced from 2m01s to 1m50s.
FIX: (#11293) ‘Custom game.project fields now show the correct UI after editor restart’ by vlaaad
Previously, custom values defined in game.project via the game.properties or ext.properties would always be shown as strings upon restarting the editor. Now they are displayed with their correct types (e.g., checkboxes for booleans, list views for lists).
FIX: (#9976,#11618,#11713,#11381) ‘Fix issues around editor symlink handling’ by matgis
FIX: (#11759,#11268,#6300) ‘Make code editor resilient against defective resource nodes’ by matgis Fixed an exception in the editor when a resource open in a code editor view became defective while the view had input focus.
FIX: (#11851) ‘Make DF fonts sharp in the editor’ by AGulev Improve DF font rendering in the Editor
FIX: (#11875) ‘Include engine log files among defignored patterns in the editor’ by matgis
The editor will now ignore log files written by the engine runtime when scanning the project for changes. Previously, changes to these log files would cause the editor to reload external changes into the graph and clear the undo queue unless the log file patterns were explicitly listed in a .defignore file or configured to be written outside the project directory.
Partially addresses #11408.
FIX: (#11786) ‘Limit max dialog height to the height of the screen’ by vlaaad Dialog height is now limited to the height of the screen to prevent dialog content from overflowing outside of the visible area.