Fullscreen Toggle Menu Option

[size=medium]Full Screen Menu Option[/size]
An RPG Maker VX script written by Dark Gaia


Introduction:
Every RPG Maker VX user knows that to toggle full screen mode you just hit Alt and Enter at the same time. But what happens when you give your game to people who aren't very familiar with RPG Maker (such as your friends and family) and they don't know this? As someone who presents their games to people outside of the RPG Maker community, I for one know that people will eventually send emails asking "how the hell do I put the game in full screen?"
This simple, plug and play script remedies that by adding a simple "Full Screen" option to your title screen menu, which will put the game into full screen upon selection.

Screenshot
Not needed. It's an extra menu option.

Instructions
Simply paste the script under Materials and above Main. Place it under any custom title systems you have installed.

Credit me if this is used. Free for use in commercial projects!

Compatibility
This script needs the original title menu window on screen to work. Thus, this script won't work with:

● MogHunter's Animated Title script
● DeadlyDan's Title Images script

It cannot work with the above two because they remove the menu window from the title screen, which this script needs.
It should work fine with most other title screen addons however, provided they use the menu window and not a custom image.

Script
  1.  
  2. #==============================================================================
  3. # Full Screen Toggle Option
  4. # Scripted by Dark Gaia
  5. # For RPG Maker VX *only*
  6. #------------------------------------------------------------------------------
  7. # Adds an option called "Full Screen" to the Title Screen which makes the game
  8. # switch to full screen when selected. Good for players who do not know about
  9. # the Alt + Enter toggle (such as your non RM using friends)
  10. #------------------------------------------------------------------------------
  11. # Insert above Main.
  12. # Incompatible with other scripts that alter the Title Screen.
  13. #==============================================================================
  14.  
  15. class Scene_Title < Scene_Base
  16. #--------------------------------------------------------------------------
  17. # * Main Processing
  18. #--------------------------------------------------------------------------
  19. def main
  20. if $BTEST # If battle test
  21. battle_test # Start battle test
  22. else # If normal play
  23. super # Usual main processing
  24. end
  25. end
  26. #--------------------------------------------------------------------------
  27. # * Start processing
  28. #--------------------------------------------------------------------------
  29. def start
  30. super
  31. load_database # Load database
  32. create_game_objects # Create game objects
  33. check_continue # Determine if continue is enabled
  34. create_title_graphic # Create title graphic
  35. create_command_window # Create command window
  36. play_title_music # Play title screen music
  37. end
  38. #--------------------------------------------------------------------------
  39. # * Execute Transition
  40. #--------------------------------------------------------------------------
  41. def perform_transition
  42. Graphics.transition(20)
  43. end
  44. #--------------------------------------------------------------------------
  45. # * Post-Start Processing
  46. #--------------------------------------------------------------------------
  47. def post_start
  48. super
  49. open_command_window
  50. end
  51. #--------------------------------------------------------------------------
  52. # * Pre-termination Processing
  53. #--------------------------------------------------------------------------
  54. def pre_terminate
  55. super
  56. close_command_window
  57. end
  58. #--------------------------------------------------------------------------
  59. # * Termination Processing
  60. #--------------------------------------------------------------------------
  61. def terminate
  62. super
  63. dispose_command_window
  64. snapshot_for_background
  65. dispose_title_graphic
  66. end
  67. #--------------------------------------------------------------------------
  68. # * Frame Update
  69. #--------------------------------------------------------------------------
  70. def update
  71. super
  72. @command_window.update
  73. if Input.trigger?(Input::C)
  74. case @command_window.index
  75. when 0 #New game
  76. command_new_game
  77. when 1 # Continue
  78. command_continue
  79. when 2 # Shutdown
  80. unless $keybd
  81. $keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v' #Recognizes keyboard
  82. $keybd.call 0xA4, 0, 0, 0
  83. $keybd.call 13, 0, 0, 0
  84. $keybd.call 13, 0, 2, 0
  85. $keybd.call 0xA4, 0, 2, 0
  86. end
  87. when 3
  88. command_shutdown
  89. end
  90. end
  91. end
  92. #--------------------------------------------------------------------------
  93. # * Load Database
  94. #--------------------------------------------------------------------------
  95. def load_database
  96. $data_actors = load_data("Data/Actors.rvdata")
  97. $data_classes = load_data("Data/Classes.rvdata")
  98. $data_skills = load_data("Data/Skills.rvdata")
  99. $data_items = load_data("Data/Items.rvdata")
  100. $data_weapons = load_data("Data/Weapons.rvdata")
  101. $data_armors = load_data("Data/Armors.rvdata")
  102. $data_enemies = load_data("Data/Enemies.rvdata")
  103. $data_troops = load_data("Data/Troops.rvdata")
  104. $data_states = load_data("Data/States.rvdata")
  105. $data_animations = load_data("Data/Animations.rvdata")
  106. $data_common_events = load_data("Data/CommonEvents.rvdata")
  107. $data_system = load_data("Data/System.rvdata")
  108. $data_areas = load_data("Data/Areas.rvdata")
  109. end
  110. #--------------------------------------------------------------------------
  111. # * Load Battle Test Database
  112. #--------------------------------------------------------------------------
  113. def load_bt_database
  114. $data_actors = load_data("Data/BT_Actors.rvdata")
  115. $data_classes = load_data("Data/BT_Classes.rvdata")
  116. $data_skills = load_data("Data/BT_Skills.rvdata")
  117. $data_items = load_data("Data/BT_Items.rvdata")
  118. $data_weapons = load_data("Data/BT_Weapons.rvdata")
  119. $data_armors = load_data("Data/BT_Armors.rvdata")
  120. $data_enemies = load_data("Data/BT_Enemies.rvdata")
  121. $data_troops = load_data("Data/BT_Troops.rvdata")
  122. $data_states = load_data("Data/BT_States.rvdata")
  123. $data_animations = load_data("Data/BT_Animations.rvdata")
  124. $data_common_events = load_data("Data/BT_CommonEvents.rvdata")
  125. $data_system = load_data("Data/BT_System.rvdata")
  126. end
  127. #--------------------------------------------------------------------------
  128. # * Create Game Objects
  129. #--------------------------------------------------------------------------
  130. def create_game_objects
  131. $game_temp = Game_Temp.new
  132. $game_message = Game_Message.new
  133. $game_system = Game_System.new
  134. $game_switches = Game_Switches.new
  135. $game_variables = Game_Variables.new
  136. $game_self_switches = Game_SelfSwitches.new
  137. $game_actors = Game_Actors.new
  138. $game_party = Game_Party.new
  139. $game_troop = Game_Troop.new
  140. $game_map = Game_Map.new
  141. $game_player = Game_Player.new
  142. end
  143. #--------------------------------------------------------------------------
  144. # * Determine if Continue is Enabled
  145. #--------------------------------------------------------------------------
  146. def check_continue
  147. @continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
  148. end
  149. #--------------------------------------------------------------------------
  150. # * Create Title Graphic
  151. #--------------------------------------------------------------------------
  152. def create_title_graphic
  153. @sprite = Sprite.new
  154. @sprite.bitmap = Cache.system("Title")
  155. end
  156. #--------------------------------------------------------------------------
  157. # * Dispose of Title Graphic
  158. #--------------------------------------------------------------------------
  159. def dispose_title_graphic
  160. @sprite.bitmap.dispose
  161. @sprite.dispose
  162. end
  163. #--------------------------------------------------------------------------
  164. # * Create Command Window
  165. #--------------------------------------------------------------------------
  166. def create_command_window
  167. s1 = Vocab::new_game
  168. s2 = Vocab::continue
  169. s3 = "Full Screen"
  170. s4 = Vocab::shutdown
  171. @command_window = Window_Command.new(172, [s1, s2, s3, s4])
  172. @command_window.x = (544 - @command_window.width) / 2
  173. @command_window.y = 240
  174. if @continue_enabled # If continue is enabled
  175. @command_window.index = 1 # Move cursor over command
  176. else # If disabled
  177. @command_window.draw_item(1, false) # Make command semi-transparent
  178. end
  179. @command_window.openness = 0
  180. @command_window.open
  181. end
  182. #--------------------------------------------------------------------------
  183. # * Dispose of Command Window
  184. #--------------------------------------------------------------------------
  185. def dispose_command_window
  186. @command_window.dispose
  187. end
  188. #--------------------------------------------------------------------------
  189. # * Open Command Window
  190. #--------------------------------------------------------------------------
  191. def open_command_window
  192. @command_window.open
  193. begin
  194. @command_window.update
  195. Graphics.update
  196. end until @command_window.openness == 255
  197. end
  198. #--------------------------------------------------------------------------
  199. # * Close Command Window
  200. #--------------------------------------------------------------------------
  201. def close_command_window
  202. @command_window.close
  203. begin
  204. @command_window.update
  205. Graphics.update
  206. end until @command_window.openness == 0
  207. end
  208. #--------------------------------------------------------------------------
  209. # * Play Title Screen Music
  210. #--------------------------------------------------------------------------
  211. def play_title_music
  212. $data_system.title_bgm.play
  213. RPG::BGS.stop
  214. RPG::ME.stop
  215. end
  216. #--------------------------------------------------------------------------
  217. # * Check Player Start Location Existence
  218. #--------------------------------------------------------------------------
  219. def confirm_player_location
  220. if $data_system.start_map_id == 0
  221. print "Player start location not set."
  222. exit
  223. end
  224. end
  225. #--------------------------------------------------------------------------
  226. # * Command: New Game
  227. #--------------------------------------------------------------------------
  228. def command_new_game
  229. confirm_player_location
  230. Sound.play_decision
  231. $game_party.setup_starting_members # Initial party
  232. $game_map.setup($data_system.start_map_id) # Initial map position
  233. $game_player.moveto($data_system.start_x, $data_system.start_y)
  234. $game_player.refresh
  235. $scene = Scene_Map.new
  236. RPG::BGM.fade(1500)
  237. close_command_window
  238. Graphics.fadeout(60)
  239. Graphics.wait(40)
  240. Graphics.frame_count = 0
  241. RPG::BGM.stop
  242. $game_map.autoplay
  243. end
  244. #--------------------------------------------------------------------------
  245. # * Command: Continue
  246. #--------------------------------------------------------------------------
  247. def command_continue
  248. if @continue_enabled
  249. Sound.play_decision
  250. $scene = Scene_File.new(false, true, false)
  251. else
  252. Sound.play_buzzer
  253. end
  254. end
  255. #--------------------------------------------------------------------------
  256. # * Command: Shutdown
  257. #--------------------------------------------------------------------------
  258. def command_shutdown
  259. Sound.play_decision
  260. RPG::BGM.fade(800)
  261. RPG::BGS.fade(800)
  262. RPG::ME.fade(800)
  263. $scene = nil
  264. end
  265. #--------------------------------------------------------------------------
  266. # * Battle Test
  267. #--------------------------------------------------------------------------
  268. def battle_test
  269. load_bt_database # Load battle test database
  270. create_game_objects # Create game objects
  271. Graphics.frame_count = 0 # Initialize play time
  272. $game_party.setup_battle_test_members
  273. $game_troop.setup($data_system.test_troop_id)
  274. $game_troop.can_escape = true
  275. $game_system.battle_bgm.play
  276. snapshot_for_background
  277. $scene = Scene_Battle.new
  278. end
  279. end
  280.  
Expand to see the code.
That's cool ;o it's a wonder this hasn't been done before. Nice implementation.
@Gaia: Nice addition to the set, it's definately a very useful trigger function, and it's necessity is perfectly explained in your post. It needs some heavy aliasing though, since you replace the whole title script for no apparent reason. Just alias the few methods you actually modify, and you're widely increasing compatibility.
Actually, the way you have it right now, it won't work with any other title script, since if you put it directly above Main, it'll overwrite anything you have that's defined Scene_Title before.
If I may suggest something to max compatibility: Make the function a non-command-window one, aka a trigger check outside the @command_window checkup. Don't draw it as a new item in there either, but rather draw some text some place (some corner or edge of the screen) that states how you can switch into fullscreen by, for example, pressing the A/Shift key.

@Wyatt: This has been done before - for RMXP. ;)
It has long been searching for this script
REMOVED!

~Sorry missunderstood your problem!
@robin: It's not so much of a 'funny thing', considering what you posted is the actual execution of the fullscreen key presses. If you put that whereever in the code, it'll get executed. The point of this script, however, is to let the user switch back and forth between display modes in a guided, apparent way, not automatically switching to fullscreen and essentially leaving the player with the same starting position (pre-set display mode, have fun figuring the hotkey combination out if you want to change it) instead of making anything better.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=69390