App.set_icon
App.set_icon(path) -> void
Sets the application's icon — the Dock tile, the Cmd-Tab switcher, the About box — from an image the game ships.
A **bundled** app already has one: ludic bundle builds AppIcon.icns from the manifest's app icon and macOS reads it from the bundle, so calling this there is harmless and changes nothing you can see. A **plain binary** is the case this exists for. ludic build produces an executable with no bundle around it, so macOS has nowhere to find an icon and draws the generic one — which is what a developer looks at every time they run the game.
The path is resolved the same way every other asset is, through the pack first and the filesystem second, so the same call works in a packed build and in a project directory. An image that cannot be found or decoded leaves the current icon alone rather than clearing it.
Headless builds have no AppKit, so this compiles to nothing there.
Parameters
pathan image the game ships (PNG, JPEG or TIFF); 1024x1024 is the size macOS wantsExample
program Titled {
entry {
App.set_icon("assets/app/icon.png")
}
}