The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Scripts Database => Topic started by: Mr_Wiggles on December 04, 2009, 06:37:09 AM

Title: Promped for Full Screen
Post by: Mr_Wiggles on December 04, 2009, 06:37:09 AM
Full Screen Prompt
Version: 1.3
Author: Mr Wiggles (Creator)
Date: Dec. 6, 2009

Version History



Planned Future Versions


Description


This script Prompts the player if they would like to play in full screen with out them having to push Alt + Enter to do so.

Features


Screenshots

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi929.photobucket.com%2Falbums%2Fad135%2FMr_Wigglez%2FFullPrompt.png%3Ft%3D1259908970&hash=bb36c132b011ba477de1e8e3f3a169fb6574c5ba)

Instructions

Copy and paste ABOVE main and BELLOW everything else!

Script


Code: [Select]
=begin
==============================================================================
Writen by: Mr Wiggles
ver. 1.3
Date 12/3/09

This script is for those who want to make the option of haveing the player
decide if they would want to play in full screen with out having to press
Alt + Enter

Instructions:

This script is plug and play, just paste it ABOVE main, and BELLOW everything
else!
lable it Scene_FullPromt and thats it!

Hope you enjoy!  >.<

==============================================================================
=end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# Start Scene_FullPromp
#--------------------------------------------------------------------------
class Scene_FullPromp
#------------------------------------------------------------------------------  
# Begin by loading DataBase
#------------------------------------------------------------------------------
    $data_system = load_data("Data/System.rxdata")
    $game_system = Game_System.new
def main
    s1 = "Full Screen"
    s2 = "Windowed"
    @command_window = Window_Command.new(192, [s1, s2])    
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 200
    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 C button was pressed
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0  # Yes
       showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
       showm.call(18,0,0,0)
       showm.call(13,0,0,0)
       showm.call(13,0,2,0)
       showm.call(18,0,2,0)
       $scene = nil
      when 1  # No
       $scene = nil
      end
    end
  end
end
#---------------------------------------------------------------------------
# Re-Write Main - It's Temperary for plug and play
#---------------------------------------------------------------------------
begin
  Graphics.freeze
   $scene = Scene_FullPromp.new
  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


Credit



Thanks


Support


If you have any problems PM me or post your question it here.

Known Compatibility Issues

None that I know of "I tested with the game I'm making, witch is using ALOT of scripts, it worked fine!"

Demo


See attached

Author's Notes


Wrote this my self to further teach my self scripting for my game and i figured why not share it and get people's opinions and possibly some hints on how to improve.

Restrictions

Don't post this on any other sites.

Title: Re: Promped for Full Screen
Post by: modern algebra on December 04, 2009, 12:18:08 PM
A nice little script. Good job Wiggles!

I would suggest that in the future, you write it so that it doesn't require editing of the default scripts and can just be plug & play, but all in all - a good idea for a script.
Title: Re: Promped for Full Screen
Post by: Mr_Wiggles on December 06, 2009, 11:53:36 PM
working on DONE - 1.3
modern algebra's sugestion noted and added, thanx for the tip.  ;D