I'm having troubles with the picture in my switch screen, they cutoff at a certain point and I was wondering how I could go about fixing it...
This is the screen, where the picture stops is obviously where it's cutoff:
http://i38.photobucket.com/albums/e139/ ... screen.png[/IMG]
And this is how big the picture should be:
http://i38.photobucket.com/albums/e139/verdeni/Theo.png[/IMG]
Note: That's just a test picture.
This is the script:
This is the screen, where the picture stops is obviously where it's cutoff:
http://i38.photobucket.com/albums/e139/ ... screen.png[/IMG]
And this is how big the picture should be:
http://i38.photobucket.com/albums/e139/verdeni/Theo.png[/IMG]
Note: That's just a test picture.
This is the script:
Code:
#==============================================================================
# Window_SwitchReserve class definition
#------------------------------------------------------------------------------
# A window that displays all characters available to pick in the party. Offers
# a cursor to select them.
#
# Read the instructions in Scene_Switch's header before using!
#
# Version 1.03, by exseiken. August 8th, 2005
#==============================================================================
class Window_SwitchReserve < Window_Selectable
#----------------------------------------------------------------------------
# Window constructor. Create the contents bitmap and fill it with all
# characters that are not into the party, but that are loaded in the data
# member of the Game_Actors global object.
#
# Parameters:
# max_size: maximum of characters that can fit into that window
#----------------------------------------------------------------------------
def initialize(max_size)
# initialize the window and its contents
super(0, 120, 640, 360)
# initialize the list for the first time
@actor_list = $game_actors.data.clone
# set the maximum amount of characters the list can contain
@item_max = [4].max
# remove currently active party members
for actor in $game_party.actors
@actor_list[actor.id] = nil
end
# remove all actors that are unavailable
for actor in @actor_list
if not actor.nil? and actor.unavailable == true
@actor_list[actor.id] = nil
end
end
# remove all holes in the list
@actor_list.compact!
# set 2 columns
@column_max = 4
# select the first item but put unactive initially
self.index = 0
self.active = false
# create the contents bitmap
bmp_height = ((@item_max & 0xFE) << 5) + ((@item_max & 0x01) << 6)
self.contents = Bitmap.new(self.width - 32, bmp_height)
#
# NOTE:
# -------------------------------------------------------------------------
# Now, this part is dependant on the translation of RPG Maker XP you're
# using. What is used here will work on Postiality Knights' edition. If you
# are using another version, set it accordingly. Note that some versions do
# not need this. In that case, you may delete it.
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
# -------------------------------------------------------------------------
#
# draw the window's contents
refresh
# draw the cursor rectangle
update_cursor_rect
end
#----------------------------------------------------------------------------
# Completely redraw the contents of the window.
#----------------------------------------------------------------------------
def refresh
# clear the contents of the bitmap
self.contents.clear
# display all actors
for i in 0...@actor_list.size
# get the concerned actor
actor = @actor_list[i]
# if the actor is non-nil, draw it
unless actor.nil?
# get the coordinates
x = (i / 1) * 150
y = (i % 1) == 1 ? self.height / @column_max : 0
# draw the actor's sprite
draw_actor_basta(actor, x - 50, y + 261)
end
end
end
#----------------------------------------------------------------------------
# Update the position rectangle of the cursor.
#----------------------------------------------------------------------------
def update_cursor_rect
# if the screen is not active or the cursor is invalid, don't display the
# cursor
if not self.active or self.index < 0
# set an empty cursor and exit
self.cursor_rect.empty
return
end
# get the row of the item
row = self.index / @column_max
# if the cursor went over the window, scroll up
if row < self.top_row
# set the top row as the current row
self.top_row = row
end
self.top_row = row if row < self.top_row
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
# set the width of the cursor
cursor_width = self.width / @column_max - 32
# get the upper-left coordinates of the window
x = self.index % @column_max * (cursor_width + 32)
y = self.index / @column_max * 110 - self.oy
# set the cursor rectangle
self.cursor_rect.set(x, y, 120, 320)
end
#----------------------------------------------------------------------------
# Takes a character, put it into the list at the selection position, and
# returns the character that was presently there. (If it was empty, it
# returns nil instead.)
#
# Parameters:
# actor_to_switch: character to put at the selected position
#----------------------------------------------------------------------------
def swap_characters(actor_to_switch)
# store the old actor (needed for swapping)
old_actor = @actor_list[self.index]
# put the new actor at the selected position
@actor_list[self.index] = actor_to_switch
# redraw the window
refresh
# return the old actor
return old_actor
end
#----------------------------------------------------------------------------
# Update the help window. (Here, the help window is really the actor status
# window.)
#----------------------------------------------------------------------------
def update_help
# draw the selected actor's name, level, status condition and stats
@help_window.actor = @actor_list[self.index]
end
#----------------------------------------------------------------------------
# Return the index of the top row, that is, the first row that is displayed
# on the window.
#----------------------------------------------------------------------------
def top_row
# divide the coordinate of the top of the bitmap by the cursor's height,
# 64, returning the index of the top row
return self.oy / 64
end
#----------------------------------------------------------------------------
# Validate, and set the top row too a new value. The validation makes sure
# that the new row is not off-limits.
#
# Parameters
# row: index of the row to be set as the new top row
#----------------------------------------------------------------------------
def top_row=(row)
# forces the new row to be positive
if row < 0
row = 0
end
# forces the new row to be less or equal to the maximum
if row > row_max - 1
row = row_max - 1
end
# return the top of the window by multiplying it by the height of the
# cursor (64)
self.oy = row * 64
end
#---------------------------------------------------------------------------
# Return the maximum amount of rows that can fit in the window without
# scrolling.
#---------------------------------------------------------------------------
def page_row_max
return (self.height - 32) / 64
end
end