Toggle fullscreen with code? (not a menu)

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Toggle fullscreen with code? (not a menu)

Postby time-killer-games » Mon Nov 20, 2017 4:22 am

I remember reading somewhere ages ago when toggling fullscreen at runtime was added, that you could also do it with code. Does anyone know the name of the function or object that I use to do that? This doesn't appear to be mentioned in the latest version's documentation.

At the very least I'd like to change that toggle fullscreen menu item's text, if the other is not possible.

Thanks!
Samuel
User avatar
time-killer-games
Expert Member
 
Posts: 400
Joined: Fri Dec 24, 2010 6:10 pm
Location: Virginia Beach, VA

Re: Toggle fullscreen with code? (not a menu)

Postby reneuend » Tue Nov 21, 2017 9:16 pm

From the documentation:

Action.ChangeDisplayResolution
Changes the screen size (display resolution) on the fly. The screen size is automatically restored when the player quits the game. The syntax is:
Action.ChangeDisplayResolution MODE_NUMBER
where MODE_NUMBER is the number that identifies the screen mode. The available modes are:
0 no changes
1 for 640 x 480
2 for 800 x 600
3 for 1024 x 768 (not recommended)
For example, to change the screen size to 640x480, use the following code:
Action.ChangeDisplayResolution 1
This function is particularly useful if you want to replace the Initial Screen (the start-up window) with a custom "Main Menu" frame that contains a "Start New Game" button, and that allows to change the display resolution when the player starts a new game. To implement this function, go to the properties of the "Start New Game" button, and type it in the VBScript text field. If your "Main Menu" frame also contains a "Load Game" button, you should type "Action.ChangeDisplayResolutionOnLoadGame" instead of "Action.ChangeDisplayResolution" (read below for details) in the properties of the "Load Game" button. Use these functions in conjunction with the "Bypass Initial Screen" option that is under the "Advanced" tab of the "Project Properties" window.


Action.ChangeDisplayResolutionOnLoadGame
Allows you to have the screen size (display resolution) be automatically changed the next time that the player loads a saved game. You will NOT see any changes until the player loads a saved game. The screen size is automatically restored when the player quits the game. The syntax is:
Action.ChangeDisplayResolutionOnLoadGame MODE_NUMBER
where MODE_NUMBER is the number that identifies the screen mode. The available modes are:
0 no changes
1 for 640 x 480
2 for 800 x 600
3 for 1024 x 768 (not recommended)
Use this function if you want to replace the Initial Screen (the start-up window) with a custom "Main Menu" frame that contains a "Load game" button, and that allows to change the display resolution when the player loads a saved game. To implement this function, go to the properties of the "Load game" button, and type it in the VBScript text field. Use this function in conjunction with the "Action.PopupLoadGame" command, and the "Bypass Initial Screen" option that is under the "Advanced" tab of the "Project Properties" window.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: Toggle fullscreen with code? (not a menu)

Postby time-killer-games » Wed Nov 22, 2017 10:09 pm

Well thanks for the response, but that wasn't what I was asking for. I need a way in code to toggle between fullscreen and windowed mode (like you currently can in the menu item new to v4.7.1) either that or I'd like to change the menu for that's label text.

Thanks!
User avatar
time-killer-games
Expert Member
 
Posts: 400
Joined: Fri Dec 24, 2010 6:10 pm
Location: Virginia Beach, VA

Re: Toggle fullscreen with code? (not a menu)

Postby Simon » Sun Dec 17, 2017 4:15 pm

It's related to this thread:
viewtopic.php?f=3&t=6688

You need first to install this AM 4.7.1 with unofficial build2:
http://www.adventuremaker.com/files/Pat ... build2.zip

Then use these codes:

Code: Select all
Action.GetFullScreenStatus

Returns "True" if you are in FullScreen and "False" if you are in "Windowed" mode.

Code: Select all
Action.InvertFullScreenStatus

Allows to toggle FullScreen and Windowed modes.
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Re: Toggle fullscreen with code? (not a menu)

Postby time-killer-games » Mon Dec 18, 2017 2:59 am

THANK YOU SIMON!!!!! This is awesome!!! :D
User avatar
time-killer-games
Expert Member
 
Posts: 400
Joined: Fri Dec 24, 2010 6:10 pm
Location: Virginia Beach, VA

Re: Toggle fullscreen with code? (not a menu)

Postby Simon » Mon Dec 18, 2017 2:46 pm

No problem, I had kept that on one of my hard drives and I knew it would be helpful someday (either for me or someone else)
It's GM who's awesome for making this update in the end ;)

By the way, with this patch you can also disable mouse right click without keyguard:

Code: Select all
Action.DisableRightClick

Allows to disable right click.

Code: Select all
Action.EnableRightClick

Allows to enable right click.

I used it in ASA, in my panoramic views, to prevent the player to open the inventory.
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Re: Toggle fullscreen with code? (not a menu)

Postby time-killer-games » Sat Dec 30, 2017 7:12 pm

Thanks again Simon!! (And Thank you so much GM-Support for this wonderful update!!!) :mrgreen: :mrgreen: :mrgreen:

Disabling right click is a very good feature and I very much look forward to using that in my game as well.

Cheers!!
User avatar
time-killer-games
Expert Member
 
Posts: 400
Joined: Fri Dec 24, 2010 6:10 pm
Location: Virginia Beach, VA

Re: Toggle fullscreen with code? (not a menu)

Postby Simon » Mon Jan 08, 2018 2:57 pm

Have fun :)
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron