The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => VXA Scripts Database => Topic started by: TDS on February 12, 2012, 11:47:46 PM

Title: Battleback Stretch
Post by: TDS on February 12, 2012, 11:47:46 PM
Battleback Stretch
Version: 1.0
Author: TDS
Date: February 12, 2012

Version History



Description


This script automatically stretches the battleback images when the screen size has changed.

Features


Screenshots

Normal
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fy4AXb.png&hash=ee31eb039d2532a5b840c3539aac00d98a30097e)

Stretched
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FyFZeE.png&hash=770ea77470315a648dda1d777bf2e893fce001da)

Smaller Screen Stretch
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F1fyxO.png&hash=4e8e608384bfaa51cb78dc7fac74501e5a3a07df)

Instructions

Just put the script in the materials area of the script editor and enjoy.

Script


Code: [Select]
#==============================================================================
# ** TDS Battleback Stretch
#    Ver: 1.0
#------------------------------------------------------------------------------
#  * Description:
#  This script automatically resizes the background images in battle into
#  the size of the screen.
#------------------------------------------------------------------------------
#  * Features:
#  Resizes battleback images into the size of the screen.
#------------------------------------------------------------------------------
#  * Instructions:
#  Just put it in your game and enjoy.
#------------------------------------------------------------------------------
#  * Notes:
#  None.
#------------------------------------------------------------------------------
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# If you really want to share my work please just post a link to the original
# site.
#
# * Not Knowing English or understanding these terms will not excuse you in any
#   way from the consequenses.
#==============================================================================


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

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Create Battleback 1 (Floor)
  #--------------------------------------------------------------------------
  def create_battleback1
    @back1_sprite = Sprite.new(@viewport1)
    @back1_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    # Get Background Bitmap
    background = battleback1_bitmap
    # Get Screen Size Rect
    screen = Rect.new(0, 0, Graphics.width, Graphics.height)
    # Stretch Battleback
    @back1_sprite.bitmap.stretch_blt(screen, background, background.rect)
    #battleback1_bitmap
    @back1_sprite.z = 0
    center_sprite(@back1_sprite)
  end
  #--------------------------------------------------------------------------
  # * Create Battleback 2 (Wall)
  #--------------------------------------------------------------------------
  def create_battleback2
    @back2_sprite = Sprite.new(@viewport1)
    @back2_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    # Get Background Bitmap
    background = battleback2_bitmap
    # Get Screen Size Rect
    screen = Rect.new(0, 0, Graphics.width, Graphics.height)
    # Stretch Battleback
    @back1_sprite.bitmap.stretch_blt(screen, background, background.rect)   
    @back2_sprite.z = 1
    center_sprite(@back2_sprite)
  end
end

Credit




Support


On this topic.

Known Compatibility Issues

None that I'm aware of so far.

Restrictions

Only for use in non-commercial games.
Title: Re: Battleback Stretch
Post by: yuyu! on February 13, 2012, 01:47:23 AM
Neato! Thanks for writing it, TDS! :) I like this script, a lot! ;8
Title: Re: Battleback Stretch
Post by: Priya on February 13, 2012, 01:43:12 PM
That's exactly what I want. 10x
Title: Re: Battleback Stretch
Post by: AlexArmstrong on February 14, 2012, 12:38:14 PM
Great! Very Useful!