0 votes

Can't seem to find how to set the monitor to run via gdscript. This can be set in the editor settings in windows placement, but I don't know how to set this to happen from gdscript when running not from the editor. Thanks for any help.

in Engine by (18 points)
edited by

Do you mean running simultaneously?

AlMoeSharpton86, simply want to choose from gdscript the screen in which to dock the game. Emulate de "next monitor" preference of windows placement from the editor settings in gdscript for my game.

1 Answer

+2 votes

You want to use OS.set_current_screen(value) where value (an integer) is the screen you want to use.

https://docs.godotengine.org/en/3.1/classes/class_os.html?highlight=monitor#class-os-property-current-screen

[edit] you can also get the number of screens available:

https://docs.godotengine.org/en/3.1/classes/class_os.html?highlight=monitor#class-os-method-get-screen-count

by (121 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories