Comments (4)
As I described in #97, I am able to use client.overlay.activateToWebPage
and activateToStore
to show overlays, but those features just foreground the Steam app in a separate window, not as an in-app overlay. (That behavior is perfectly fine by me; I think opening web pages and store pages works best in a separate window.)
But in #97 (comment) @saintflow47 said that if I'm seeing this issue, there might be a "bigger issue with my setup."
If there is an issue with my setup, we should get to the bottom of that here in this issue, and ideally file a PR to fix the checked-in Electron sample.
from steamworks.js.
I'm a little bit confused. The overlay it's working for you? Have you tried build the game and add as a non steam game?
from steamworks.js.
I think what's confusing you is the idea of "the overlay." There are multiple different behaviors for the overlay, depending on whether or not Steam can figure out how to inject itself into your game.
https://partner.steamgames.com/doc/features/overlay
The overlay supports games that use DirectX 7 - 12, OpenGL, Metal, and Vulkan. The overlay will not be active in software-rasterized games.
For "software-rasterized games," those cases where Steam can't figure out how to inject itself into the game's window, the overlay works differently. In that case, Steam (by design) shows no overlay hint, and the Shift-Tab keyboard shortcut doesn't do anything.
If you're developing a "software-rasterized game" where Steam can't inject the overlay, but you nonetheless call an overlay method (activateDialog
, activateToWebPage
, activateToStore
), Steam will just foreground the Steam app's window, and display the desired content in Steam's window, instead of in the game's window.
Here's an example of a "software-rasterized game" that uses an overlay method. I just updated my PR #98 to add a new script, test/overlay.js
, which has no electron in it; it runs completely headlessly.
test/overlay.js
is very short. Here's the whole thing:
const { init } = require('../index.js')
const client = init(480)
/*
This node script is "headless." It has no graphical context
into which Steam can inject an overlay.
Therefore, when you run this script while the Steam app is
running, Steam will foreground the Steam app, and display
example.com in the Steam app's window.
*/
client.overlay.activateToWebPage('https://www.example.com/');
When you run this test script, it "works." It opens example.com in the Steam app, like this:
Of course Steam doesn't show the "overlay hint" in the case of this headless test/overlay.js
. (Where would it even show it? In my terminal prompt?? There is no window to show the hint in.) And, of course, Shift-Tab doesn't do anything, either.
If this still feels a bit confusing, I recommend running test/overlay.js
from my PR #98 to see the effect with your own eyes.
But that's obviously not the normal/expected behavior when running a game in DirectX 7 - 12, OpenGL, Metal, and Vulkan, when Steam can figure out how to inject itself into your graphical context. In that case, you'd normally see the hint, and Shift-Tab shows an overlay right there in the game, not in a separate window.
What I'm saying is that when I follow the steps to reproduce that I documented in the bug, Steam treats the Electron app as a "software-rasterized game." There's no overlay hint, and Shift-Tab does nothing. When I click the "activate overlay" button, it displays the overlay in Steam's app, not as an "overlay" in the game's window.
As a result, since the overlay isn't showing "as an overlay," steamworks.electronEnableSteamOverlay()
does nothing, since Steam isn't injecting any graphics into the Electron window at all.
Have you tried build the game and add as a non steam game?
Yes, I did. I updated my "to reproduce" instructions above to explain how I tested it.
from steamworks.js.
@dfabulich I was stuck on this exact issue for a few days; thanks to the https://partner.steamgames.com/doc/features/overlay link I was able to realize what was causing my problems. The steamworks.init (and maybe the electronEnableSteamOverlay) functions have to be called before app.whenReady() and createWindow() get called in main or else it will be unable to hook into the program and it will just bring Steam to the foreground instead of giving a proper overlay.
from steamworks.js.
Related Issues (20)
- Mac version crashes when launched from Steam but runs successfully from local .app. HOT 4
- contextIsolation false or true? electronEnableSteamOverlay has to be called? HOT 4
- GLIBC 2.28? HOT 3
- Signing issues on M1 macs
- Networking API HOT 2
- On require of steamworks.js, receiving Uncaught Error: Module did not self-register. HOT 7
- Steam game runs forever
- steamworks shutdown HOT 3
- steam_api64.dll dependency missing for production build HOT 2
- error when trying to require the steamworks.js with nw.js HOT 8
- Leaderboard plz~
- SteamCloud cross-platform save - SetSyncPlatform
- App running on steam
- Detect when Steam Deck is Docked? HOT 2
- Cannot start electron app with or without asar HOT 2
- Zombie Session Ticket? HOT 1
- getAuthTicketForWebApi missing in package HOT 5
- client.apps.currentGameLanguage() always returns 'english'
- Is it possible to listen for the GameOverlayActivated_t event?
- Is the setRichPresence function not working? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from steamworks.js.