Full-Screen Toggle
#1
This is a script used to toggle full-screen or windowed mode once. After you save the game it will not appear again. You can change this
in the configuration, but I think it is a good idea, because it gets annoying clicking the option over and over again.
Instructions are in the script, and if you have any questions just post them here.

No screen-shots or demos are required.

Code:
=begin
================================================================================
Author: Mr Wiggles
Modifications: Helladen
Verison: 1.6
Last Update: 7/9/10

1.3 -> 1.4: Converted it from Rpg Maker XP to VX.

1.4 -> 1.5: Added where you can skip the toggle option if you have a save and
you can change the command prompt's opacity. This value will effect the
entire command prompt. I also added an option to change the input key.

1.5 -> 1.6: Added a option for the Scene.

How To Use:
You replace your main with this. Easy install, and if you want to configure the
script you just need to edit the settings below.
================================================================================
=end
#-------------------------------------------------------------------------------
# Configuration
#-------------------------------------------------------------------------------
SKIP_TOGGLE = true # This will skip the toggle if you have a save slot.
COMMAND_OPACITY = 160 # Change this value to the opacity you want.
INPUT_KEY = Input::C # This is the key used to confirm the command prompt.
SCENE = Scene_Title.new # The scene that is after or before Scene_FullPromp.
#----------------DO-NOT-EDIT-BELOW-THIS-----------------------------------------
# Start Scene_FullPromp
#-------------------------------------------------------------------------------
class Scene_FullPromp
#-------------------------------------------------------------------------------
def main
    @title = Scene_Title.new
    @title.load_database
    s1 = "Full-Screen"
    s2 = "Windowed"
    @command_window = Window_Command.new(192, [s1, s2])  
    @command_window.opacity = COMMAND_OPACITY
    @command_window.x = 272 - @command_window.width / 2
    @command_window.y = 208 - @command_window.height / 2
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
end
#-------------------------------------------------------------------------------
#  Update
#-------------------------------------------------------------------------------
def update
    @command_window.update
    # If the input key is pressed.
    if Input.trigger?(INPUT_KEY)
      case @command_window.index
      when 0  # Yes/1st option
      unless $keybd
      $keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v' #Recognizes keyboard
      $keybd.call 0xA4, 0, 0, 0
      $keybd.call 13, 0, 0, 0
      $keybd.call 13, 0, 2, 0
      $keybd.call 0xA4, 0, 2, 0
      end
       $scene = Scene_Title.new
      when 1  # No/2nd option
       $scene = Scene_Title.new
      end
    end
  end
end
#-------------------------------------------------------------------------------
# Main
#-------------------------------------------------------------------------------
begin
  Graphics.freeze
    if SKIP_TOGGLE and (Dir.glob('Save*.rvdata').size > 0)
    $scene = SCENE
    else
    $scene = Scene_FullPromp.new
    end
  while $scene != nil
    $scene.main
  end
  Graphics.transition(20)
rescue Errno::ENOENT
  filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")
end
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Toggle Message Window XP kyonides 0 171 11-11-2024, 01:28 AM
Last Post: kyonides
   Sarah's Configuration Screen DerVVulfman 7 10,631 06-09-2024, 02:15 AM
Last Post: DerVVulfman
   Sharina's Screen-Saves DerVVulfman 5 2,479 08-22-2023, 05:05 PM
Last Post: DerVVulfman
Smile  Soul's Better Status Screen SoulZetaformGames 7 11,226 11-11-2021, 09:20 AM
Last Post: kyonides
   Screen Tint Debugger MechanicalPen 0 4,882 11-04-2014, 06:47 PM
Last Post: MechanicalPen
   States : Toggle Kain Nobel 0 5,032 10-09-2012, 05:22 PM
Last Post: Kain Nobel
   Full Animated Side View Battle System Cybersam 6 25,167 03-18-2011, 04:31 AM
Last Post: Ashbane
   Main Character Select Screen Raziel 4 11,865 05-27-2010, 04:48 PM
Last Post: sakhawat21
   Screen Shake Extended DerVVulfman 0 6,095 12-31-2009, 05:16 AM
Last Post: DerVVulfman
   XRXS's Full-View Battleback & Movable Camera XRXS 0 5,822 06-10-2009, 03:30 AM
Last Post: XRXS



Users browsing this thread: 1 Guest(s)