This extension provides an interface to integrate a game with the Steamworks SDK.
To use Steam in your Defold project, add a version of the Steam extension to your game.project
dependencies from the list of available Releases. Find the version you want, copy the URL to ZIP archive of the release and add it to the project dependencies.
Select Project->Fetch Libraries
once you have added the version to game.project
to download the version and make it available in your project.
To be able to build and run from the editor you need to copy steam/lib/osx/*.dylib
to /usr/local/lib
.
local function on_steam_event(self, event, data)
if event == "GameOverlayActivated_t" then
print("Overlay is", data.m_bActive)
end
end
function init(self)
-- initialize the Steamworks SDK
local status, error = pcall(steam.init)
if not status then
print("Error: " .. error)
return
end
steam.set_listener(on_steam_event)
end
function update(self, dt)
steam.update()
end
Refer to the example project to see a complete example of how the intergation works.
The source code is available on GitHub
Did you spot an error or do you have a suggestion? Please let us know on GitHub!
GITHUB