Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 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
   Sharina's Screen-Saves DerVVulfman 5 1,011 08-22-2023, 05:05 PM
Last Post: DerVVulfman
Smile  Soul's Better Status Screen SoulZetaformGames 7 8,762 11-11-2021, 09:20 AM
Last Post: kyonides
   Screen Tint Debugger MechanicalPen 0 4,227 11-04-2014, 06:47 PM
Last Post: MechanicalPen
   Sarah's Configuration Screen DerVVulfman 3 8,248 08-10-2014, 03:38 PM
Last Post: firestalker
   Victor Engine - Toggle Target Victor Sant 0 4,634 01-25-2013, 07:37 AM
Last Post: Victor Sant
   States : Toggle Kain Nobel 0 4,466 10-09-2012, 05:22 PM
Last Post: Kain Nobel
   Victor Engine - State Toggle Victor Sant 0 3,675 06-22-2012, 05:37 AM
Last Post: Victor Sant
   Full Animated Side View Battle System Cybersam 6 23,106 03-18-2011, 04:31 AM
Last Post: Ashbane
   Main Character Select Screen Raziel 4 10,597 05-27-2010, 04:48 PM
Last Post: sakhawat21
   Screen Shake Extended DerVVulfman 0 5,409 12-31-2009, 05:16 AM
Last Post: DerVVulfman



Users browsing this thread: