♥ Making Windows Frame Invisible? (Windows OS)


#1

Good day Everyone :raising_hand_woman:

Is it possible to not start game with windows default window frame? I know in Visual Studio you can disable default window’s controls and a frame it goes with leaving only content drawn on the screen.

May be there are some options available at export or ways around it? Or I’m strictly stuck with windows frame in windowsOS? Is there anything that can be tweaked in launch files in JavaScript?

Thank you :two_hearts:


#2

Yes, it sure is possible, but I wonder why do you want one? I don’t really see the point. Of course, it isn’t a reason to not implement that, but I find this weird to want to have a frameless window.


#3

For small games/apps that usually have fixed window size for desktop mainly, I would create my own window frame and some interface elements themed for the game. If I make game that only need 800x800 resolution say that default window control frame just looks ugly :yum:

For windows I have been using Blend/Visual studio to create visual interfaces for small games, disabling default window frame.

So any direction where I can get this knowledge? :smirk:


#4

When doing a manual export to PC/Mac, you get access to the code of the exported game. You should have a .Js file and a directory with the almost the same files as a local HTML export.
In the Js file (main.js), you should have this somewhere:

  mainWindow = new BrowserWindow({
    width: 800 /*GDJS_WINDOW_WIDTH*/,
    height: 600 /*GDJS_WINDOW_HEIGHT*/,
    useContentSize: true,
    title: "GDJS_GAME_NAME",
    backgroundColor: '#000000',
    webPreferences: {
      nodeIntegration: true,
    }
  });

You only need to pass a simple parameter to disable the frame:

  mainWindow = new BrowserWindow({
    frame: false,
    width: 800 /*GDJS_WINDOW_WIDTH*/,
    height: 600 /*GDJS_WINDOW_HEIGHT*/,
    useContentSize: true,
    title: "GDJS_GAME_NAME",
    backgroundColor: '#000000',
    webPreferences: {
      nodeIntegration: true,
    }
  });

I think I’ll try to add this to the engine in the future, i saw that being requested a lot.


#5

Think to how the user can quit the app if there is no frame :wink:

It’s great for making overlays. An beautiful app with this own design too, look Spotify, Discord, Steam, these app have their own frame, it’s better as the frame by default :smiley:


#6

Hello :raising_hand_woman:

Yes, thank you, that will do magic, found the file in manual export, have not tried it yet but from my other project I know it will work.

:cherry_blossom: Now I just wanted to add that I had a few projects where it has been mostly universal game design for web,smartphone and desktop with its own in game interface controls, and for desktop we had to disable window frame since it would duplicate the controls we created within game interface. That’s to answer “Why” with a more real example necessity rather than only for creativity and nice appeal.

:cherry_blossom: Another example is that, when I was learning programming and interface design, teacher would disable windows frame (for windowsOS) and we had to ourselves create interface elements and make them interactable, so another reason could be “for the learning sake” since most people will design their own buttons any way :tipping_hand_woman:

:warning: Also with removing window frame we some times had to make background layer transparent as well, which I have not noticed has such option for background layer (understandable tho). If you will consider implementing this as an option, then you might want to consider possibility for background layer to have opacity.

All in all, thank you for help :two_hearts:


#7

You are absolutely correct :cherry_blossom: It adds not only style but some degree of professionalism and appeal to the running game in general.