Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Screen Resolution Script, Enable 640 X 480 resolution for VX
neclords
post Apr 19 2008, 12:41 AM
Post #1


Love me! I wanna you to love me!
Group Icon

Group: Revolutionary
Posts: 196
Type: Event Designer
RM Skill: Beginner







TDS Resolution Change


Introduction

Well if you want to transition your project to VX or just want the old 640 x 480 this script will help you out.

Features

It just changes the default 544 x 416 screen resolution of VX to 640 x 480 the RPG Maker XP resolution.

Screenshots

Default RPG Maker VX Resolution with black border.



New 640 x 480 resolution without border.



Demo
N/A

Script


CODE
#======================================================================
========
# ** TDS Resolution Change[VX]
# Version: 1.8
#------------------------------------------------------------------------------
# This script changes the resolution from the default VX resolution
# of 544 x 416 to 640 x 480 RMXP Resolution
#==============================================================================

#--------------------------------------------------------------------------
# * Graphics - Rezise Screen
#--------------------------------------------------------------------------
Graphics.resize_screen(640, 480)

#==============================================================================
# ▼ Game Objects
#------------------------------------------------------------------------------
# All clases below the Game Objects tab
#==============================================================================

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Scroll Setup
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_setup_scroll setup_scroll
def setup_scroll
tds_vx_resolution_change_setup_scroll
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
@margin_x = (width - 20) * 256 / 2 # Screen non-display width /2
@margin_y = (height - 15) * 256 / 2 # Screen non-display height /2
end

#--------------------------------------------------------------------------
# * Calculate X coordinate for parallax display
# bitmap : Parallax bitmap
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_calc_parallax_x calc_parallax_x
def calc_parallax_x(bitmap)
tds_vx_resolution_change_calc_parallax_x(bitmap)
if bitmap == nil
return 0
elsif @parallax_loop_x
return @parallax_x / 16
elsif loop_horizontal?
return 0
else
w1 = bitmap.width - 640
w2 = @map.width * 32 - 640
if w1 <= 0 or w2 <= 0
return 0
else
return @parallax_x * w1 / w2 / 8
end
end
end

#--------------------------------------------------------------------------
# * Calculate Y coordinate for parallax display
# bitmap : Parallax bitmap
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_calc_parallax_y calc_parallax_y
def calc_parallax_y(bitmap)
tds_vx_resolution_change_calc_parallax_y(bitmap)
if bitmap == nil
return 0
elsif @parallax_loop_y
return @parallax_y / 16
elsif loop_vertical?
return 0
else
h1 = bitmap.height - 480
h2 = @map.height * 32 - 480
if h1 <= 0 or h2 <= 0
return 0
else
return @parallax_y * h1 / h2 / 8
end
end
end

#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
# *Note: Could not be aliased because it causes the scrolling to look
# Unnatural
#--------------------------------------------------------------------------
def scroll_down(distance)
if loop_vertical?
@display_y += distance
@display_y %= @map.height * 256
@parallax_y += distance
else
last_y = @display_y
@display_y = [@display_y + distance, (height - 15) * 256].min
@parallax_y += @display_y - last_y
end
end

#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
# *Note: Could not be aliased because it causes the scrolling to look
# Unnatural
#--------------------------------------------------------------------------
def scroll_right(distance)
if loop_horizontal?
@display_x += distance
@display_x %= @map.width * 256
@parallax_x += distance
else
last_x = @display_x
@display_x = [@display_x + distance, (width - 20) * 256].min
@parallax_x += @display_x - last_x
end
end
end


#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
CENTER_X = (640 / 2 - 16) * 8 # Screen center X coordinate * 8
CENTER_Y = (480 / 2 - 16) * 8 # Screen center X coordinate * 8
#--------------------------------------------------------------------------
# * Set Map Display Position to Center of Screen
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_center center
def center(x, y)
tds_vx_resolution_change_center(x, y)
display_x = x * 256 - CENTER_X # Calculate coordinates
unless $game_map.loop_horizontal? # No loop horizontally?
max_x = ($game_map.width - 20) * 256 # Calculate max value
display_x = [0, [display_x, max_x].min].max # Adjust coordinates
end
display_y = y * 256 - CENTER_Y # Calculate coordinates
unless $game_map.loop_vertical? # No loop vertically?
max_y = ($game_map.height - 15) * 256 # Calculate max value
display_y = [0, [display_y, max_y].min].max # Adjust coordinates
end
$game_map.set_display_pos(display_x, display_y) # Change map location
end
end


#==============================================================================
# ▼ Sprites
#------------------------------------------------------------------------------
# All clases below the Sprites tab
#==============================================================================

#==============================================================================
# ** Sprite_Base
#------------------------------------------------------------------------------
# A sprite class with animation display processing added.
#==============================================================================
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# * Start Animation
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_start_animation start_animation
def start_animation(animation, mirror = false)
tds_vx_resolution_change_start_animation(animation, mirror = false)
dispose_animation
@animation = animation
return if @animation == nil
@animation_mirror = mirror
@animation_duration = @animation.frame_max * 4 + 1
load_animation_bitmap
@animation_sprites = []
if @animation.position != 3 or not @@animations.include?(animation)
if @use_sprite
for i in 0..15
sprite = ::Sprite.new(viewport)
sprite.visible = false
@animation_sprites.push(sprite)
end
unless @@animations.include?(animation)
@@animations.push(animation)
end
end
end
if @animation.position == 3
if viewport == nil
@animation_ox = 640 / 2
@animation_oy = 480 / 2
else
@animation_ox = viewport.rect.width / 2
@animation_oy = viewport.rect.height / 2
end
else
@animation_ox = x - ox + width / 2
@animation_oy = y - oy + height / 2
if @animation.position == 0
@animation_oy -= height / 2
elsif @animation.position == 2
@animation_oy += height / 2
end
end
end
end

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================

class Spriteset_Map
#--------------------------------------------------------------------------
# * Create Viewport
#--------------------------------------------------------------------------
alias tds_vx_resolution_change_create_viewports create_viewports
def create_viewports
tds_vx_resolution_change_create_viewports
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 50
@viewport3.z = 100
end
end


Instructions
Just put it above main in the area for new scripts and it does all its functions alone.

Compatibility

It's recommended that you use the minimum map size of Width x 20 Height x 15 so the script wont try to loop on the remaining map.

Well... The script is not complete... Mostly because I've been busy and cant find the time to go class by class and making it compatible.

If any other scripter wishes to make the other VX scripts compatible with the new screen resolution it will greatly appreciated.


Credits and Thanks
TDS


__________________________

~Time To sWallow tHe Pain and VaniSH OuR HuRt~
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- neclords   Screen Resolution Script   Apr 19 2008, 12:41 AM
- - Cryoma   Dandy, I'm assuming I can change it around for...   May 29 2008, 06:51 PM
- - platipus   it changed the window size for me but not the game...   May 30 2008, 12:38 PM
|- - captainregal   QUOTE (platipus @ May 30 2008, 04:38 PM) ...   Apr 21 2009, 06:48 PM
- - TalesOf_Fantasy   Great! Now i can make my game in full screen w...   Apr 21 2009, 10:14 PM
- - 1a42   I had to put the Line breaks myself and I have a p...   Apr 30 2009, 04:39 PM
- - ShinAlcatraz   I have a problem, the window message are in the mi...   Jul 6 2009, 08:08 AM
- - onidsouza   lol, i found topic number 666: showtopic=666   Jul 6 2009, 11:24 AM
- - pertdts   This thing rocks. Well it has some thingies that ...   Jul 6 2009, 03:22 PM
- - ShinAlcatraz   QUOTE (pertdts @ Jul 6 2009, 04:22 PM) Fo...   Jul 7 2009, 04:25 AM
- - pertdts   For the normal message window I found two parts th...   Jul 7 2009, 04:50 AM
- - Seano299   Hey I have a problem, when ever I try to put this ...   Jul 31 2009, 03:06 AM
|- - SuperMega   QUOTE (Seano299 @ Jul 31 2009, 06:06 AM) ...   Jul 31 2009, 07:58 AM
|- - Cooky101   QUOTE (Seano299 @ Jul 31 2009, 04:06 AM) ...   Feb 19 2010, 01:10 AM
- - Valnar   i whould have 2 Question (acctuly 3 but this got a...   Aug 7 2009, 12:25 AM
- - Zudane   RE: Screen Resolution Script   Aug 17 2009, 02:13 AM
- - TheGOffice   Really late I know...I was just wondering if this ...   Dec 17 2011, 04:31 PM
|- - Lifespirit   QUOTE (TheGOffice @ Dec 17 2011, 09:31 PM...   Dec 27 2011, 06:30 PM
- - Fonstw   In a battle i still see the black border, but then...   Dec 30 2011, 02:56 AM
- - stripe103   That is because this script only changes the windo...   Dec 30 2011, 02:52 PM
- - CerdaMaster   I hope this is not grave digging, but how could I ...   Feb 4 2012, 06:20 PM
- - Ndoelicious   Can anyone help how to adjust the battle scene and...   Dec 2 2012, 02:17 AM
|- - Jens of Zanicuud   The main problem with Battle Scene / Window is tha...   Dec 2 2012, 02:58 AM
|- - Ndoelicious   QUOTE (Jens of Zanicuud @ Dec 2 2012, 03...   Dec 2 2012, 08:13 AM
|- - Jens of Zanicuud   Try replacing every 544 with 640, every 416 with 4...   Dec 2 2012, 09:34 AM
|- - gandy.ajah   QUOTE (Jens of Zanicuud @ Dec 3 2012, 12...   Dec 2 2012, 07:58 PM
- - gandy.ajah   can i solve my battle window its not 640 x 480 .. ...   Dec 2 2012, 07:50 AM
- - Ndoelicious   I tried, and fixed it like what you said. Now the ...   Dec 2 2012, 10:05 AM
- - Ndoelicious   This is not the thread you can use to ask. Go to t...   Dec 2 2012, 10:37 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 12:40 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker