Git Product home page Git Product logo

Comments (4)

dfabulich avatar dfabulich commented on June 3, 2024

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.

ceifa avatar ceifa commented on June 3, 2024

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.

dfabulich avatar dfabulich commented on June 3, 2024

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:

image

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.

splintermann avatar splintermann commented on June 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.