Easy Battle Back Stretching - Trickster - 03-01-2008
Easy Battle Back Stretching
Version: 2.0
Introduction
A Simple Plug and Play script that stretches all battlebacks to fit the whole screen (640 by 480 pixels). Also allows you to have 640 by 480 sized battlebacks
Screenshots
Ok Visualize the normal battlebacks only stretched to fit the whole screen. There's your screenshot.
Script
Code: #==============================================================================
# ?? Easy Battle Back Stretching
#------------------------------------------------------------------------------
# Trickster (tricksterguy@hotmail.com)
# Version 2.0
# Date 5/31/07
# Goto rmxp.org for updates/support/bug reports
#------------------------------------------------------------------------------
# This script allows you to use 640x480 battle back images for the battle
# scene. It also stretches the images if they aren't 640 by 480.
#==============================================================================
#--------------------------------------------------------------------------
# Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Easy Battle Back Stretching', 'Trickster', 2.0, '5/31/07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2])
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Easy Battle Back Stretching')
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias_method :trick_stretch_battle_init_viewport, :init_viewport
def init_viewport
# The Usual
trick_stretch_battle_init_viewport
# Setup Viewport Rectangle
@viewport1.rect.set(0, 0, 640, 480)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update_battleback
# If battleback file name is different from current one
if @battleback_name != $game_temp.battleback_name
# Set Battle Back
@battleback_name = $game_temp.battleback_name
# If Bitmap Defined
if @battleback_sprite.bitmap != nil
# Dispose Bitmap
@battleback_sprite.bitmap.dispose
end
# Create Bitmap
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
# Setup Source Rectangle
@battleback_sprite.src_rect.set(0, 0, 640, 480)
# If height is not 480 pixels
if @battleback_sprite.bitmap.height != 480
# Setup Zoom Y
@battleback_sprite.zoom_y = 480.0 / @battleback_sprite.bitmap.height
end
# If width is not 640 pixels
if @battleback_sprite.bitmap.width != 640
# Setup Zoom X
@battleback_sprite.zoom_x = 640.0 / @battleback_sprite.bitmap.width
end
end
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Instructions
Add in a new script above main
FAQ
Note: Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.
Compatibility
SDK 2.x compliant
Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.
|