Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Resolution Ace
Rukiri
post Jan 22 2012, 03:14 AM
Post #1


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,725
Type: Scripter
RM Skill: Advanced




Usage: Resolution.resize(W,H)
Max size is 640,480.

Warning:
This does not automatically fix window issues, that's normal. This script only takes care of the main screen, everything else you'll have to script to fit.

Screenshots:


Script.
code

CODE
#==============================================================================
# ■ Game_Resolution
#------------------------------------------------------------------------------
# Change the game window to whatever you want!
# Keep the width and height a multiple of 32.
#==============================================================================

module Resolution
   $game_screen_width = 640
   $game_screen_height = 480
   $game_tiles_width = 20
   $game_tiles_height = 15
   #======================================
   # Resize the window
   #======================================
   def self.resize(w,h)
     Graphics.resize_screen(w,h)
     $game_screen_width = w
     $game_screen_height = h
     $game_tiles_width = w / 32
     $game_tiles_height = h / 32
   end
end
#==============================================================================
# ■ Sprite_Timer
#------------------------------------------------------------------------------
# Timer for display sprites. Monitor the $ game_timer, the state of the Sprite
# To change automatically.
#==============================================================================
class Sprite_Timer
   #--------------------------------------------------------------------------
   # ● Initialize
   #--------------------------------------------------------------------------
   def initialize(viewport)
     super(viewport)
     create_bitmap
     update
   end
   #--------------------------------------------------------------------------
   # ● Create bitmap
   #--------------------------------------------------------------------------
   def create_bitmap
     self.bitmap = Bitmap.new(96, 48)
     self.bitmap.font.size = 32
     self.bitmap.font.color.set(255, 255, 255)
   end
    #--------------------------------------------------------------------------
   # ● Update
   #--------------------------------------------------------------------------
   def update
     super
     update_bitmap
     update_position
     update_visibility
   end
   #--------------------------------------------------------------------------
   # ● Update position
   #--------------------------------------------------------------------------
   def update_position
     self.x = $game_screen_width - self.bitmap.width
     self.y = 0
     self.z = 200
   end
end
#==============================================================================
# ■ Game_Map
#------------------------------------------------------------------------------
# A class to handle the map. It has features such as scrolling and passable determining.
# Instance of this class is referenced by $ game_map.
#==============================================================================

class Game_Map
   def update(main = false)
     refresh if @need_refresh
     update_interpreter if main
     update_scroll
     update_events
     update_vehicles
     update_parallax
     @screen.update
   end
   #--------------------------------------------------------------------------
   # ● Setup Scroll
   #--------------------------------------------------------------------------
   def setup_scroll
     @scroll_direction = 2
     @scroll_rest = 0
     @scroll_speed = 4
   end
   #--------------------------------------------------------------------------
   # ● Set display position
   #--------------------------------------------------------------------------
   def set_display_pos(x, y)
     x = [0, [x, $game_screen_width - $game_tiles_width].min].max unless loop_horizontal?
     y = [0, [y, $game_screen_height - $game_tiles_height].min].max unless loop_vertical?
     @display_x = (x + $game_screen_width) % $game_screen_width
     @display_y = (y + $game_screen_height) % $game_screen_height
     @parallax_x = x
     @parallax_y = y
   end
   #--------------------------------------------------------------------------
   # ● Parallax X check
   #--------------------------------------------------------------------------
   def parallax_ox(bitmap)
     if @parallax_loop_x
       @parallax_x * 16
     else
       w1 = [bitmap.width - $game_screen_width, 0].max
       w2 = [$game_screen_width * 32 - $game_screen_width, 1].max
       @parallax_x * 16 * w1 / w2
     end
   end

   #--------------------------------------------------------------------------
   # ● Adjust X
   #--------------------------------------------------------------------------
   def adjust_x(x)
     if loop_horizontal? && x < @display_x - ($game_screen_width - $game_tiles_width) / 2
       x - @display_x + $game_screen_width
     else
       x - @display_x
     end
   end
   #--------------------------------------------------------------------------
   # ● Adjust Y
   #--------------------------------------------------------------------------
   def adjust_y(y)
     if loop_vertical? && y < @display_y - ($game_screen_height - $game_tiles_height) / 2
       y - @display_y + $game_screen_height
     else
       y - @display_y
     end
   end
   #--------------------------------------------------------------------------
   # ● ループ補正後の X 座標計算
   #--------------------------------------------------------------------------
   def round_x(x)
     loop_horizontal? ? (x + $game_screen_width) % $game_screen_width : x
   end
   #--------------------------------------------------------------------------
   # ● ループ補正後の Y 座標計算
   #--------------------------------------------------------------------------
   def round_y(y)
     loop_vertical? ? (y + $game_screen_height) % $game_screen_height : y
   end
   #--------------------------------------------------------------------------
   # ● 上にスクロール
   #--------------------------------------------------------------------------
   def scroll_up(distance)
     if loop_vertical?
       @display_y += @map.height - distance
       @display_y %= @map.height
       @parallax_y -= distance if @parallax_loop_y
     else
       last_y = @display_y
       @display_y = [@display_y - distance, 0].max
       @parallax_y += @display_y - last_y
     end
   end
end
class Game_Player < Game_Character
   #--------------------------------------------------------------------------
   # ● �"�面中央の X 座標
   #--------------------------------------------------------------------------
   def center_x
     if $game_screen_width == 640
       ($game_screen_width / 32 - 1) / 1.0
       else
     ($game_screen_width / 32 - 1) / 2.0
     end
   end
   #--------------------------------------------------------------------------
   # ● �"�面中央の Y 座標
   #--------------------------------------------------------------------------
   def center_y
     if $game_screen_height == 480
     ($game_screen_height / 32 - 1) / 1.0
   else
     ($game_screen_height / 32 - 1) / 2.0
     end
   end
   #--------------------------------------------------------------------------
   # ● �"�面中央に来るようにマップの表示位置�'設定
   #--------------------------------------------------------------------------
   def center(x, y)
     $game_map.set_display_pos(x - center_x, y - center_y)
   end
     #--------------------------------------------------------------------------
   # ● フレーム更新
   #--------------------------------------------------------------------------
   def update
     last_real_x = @real_x
     last_real_y = @real_y
     last_moving = moving?
     move_by_input
     super
     update_scroll(last_real_x, last_real_y)
     update_vehicle
     update_nonmoving(last_moving) unless moving?
     @followers.update
   end
end

class Window_Base
   #--------------------------------------------------------------------------
   # ● ステートおよび強化/弱�"のアイコン�'描�"�
   #--------------------------------------------------------------------------
   def draw_actor_icons(actor, x, y, width = 96)
     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
   end
end



__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 10:42 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker