overlayStatus

Type Event
Revision Release 2024.3703
Keywords steam, steamworks, overlay, overlayStatus
See also steamworks.addEventListener()
steamworks.*

Overview

This event occurs when the Steam overlay has been shown or hidden. An overlay can be shown by calling the plugin’s “show” APIs or when the user has pressed Shift+Tab (the default Steam key binding to show its overlay). If the user is in the middle of gameplay, it’s best to pause the game while the overlay is shown.

You can receive these events by adding a listener to the plugin via the steamworks.addEventListener() function.

Properties

event.name

event.phase

Example

local steamworks = require( "plugin.steamworks" )

-- Called when the Steam overlay has been shown/hidden
local function onOverlayStatusChanged( event )
    if ( event.phase == "shown" ) then
        -- Steam overlay is being shown
        -- You might want to pause gameplay here
    else
        -- Steam overlay is no longer being shown
    end
end

-- Set up a listener to be invoked when the Steam overlay has been shown/hidden
steamworks.addEventListener( "overlayStatus", onAchievementUpdated )