Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Setting Panoramas

PanoramaVersion: 0.1
By: Linkz0r

Introduction

VX disabled changing panoramas via events. This script allows you to do them but via Call Script :)


Screenshots

Can't...really do that O_O

Script

Just paste these above main.
Code:
# Simple script to change parallax parameters for a map 

# Author: Linkz0r 

# No credits needed, use with no restrictions! 

 

#set_parallax("CloudySky")

#set_parallax_scroll(x, y) Set to zero to deactivate movement set to negativce to

#scroll backwards

#to remove scrolling altogether call

# remove_parallax_scroll

# to remove parallax call

# remove_parallax

#to set parallax to a position call set_parallax_position(x, y) 

 

 

class Game_Map 

   

  def setup_new_parallax(data = get_parallax_data) 

    @parallax_name   = data[:name]  if data[:name] 

    @parallax_loop_x = data[:loopx] if data[:loopx] 

    @parallax_loop_y = data[:loopy] if data[:loopy] 

    @parallax_sx     = data[:sx]    if data[:sx] 

    @parallax_sy     = data[:sy]    if data[:sy] 

    @parallax_x   = data[:x]     if data[:x] 

    @parallax_y   = data[:y]     if data[:y] 

  end 

   

  def get_parallax_data 

    return { 

      :name  => @parallax_name, 

      :loopx => @parallax_loop_x, 

      :loopy => @parallax_loop_y, 

      :sx   => @parallax_sx, 

      :sy   => @parallax_sy, 

      :x     => @parallax_x, 

      :y     => @parallax_y } 

  end 

   

end

 

class Game_Interpreter 

   

  def set_parallax(name="") 

    $game_map.setup_new_parallax({:name => name}) 

  end 

   

  def set_parallax_position(x=0, y=0) 

    $game_map.setup_new_parallax({:x => :sx, :y => y}) 

  end 

   

  def set_parallax_scroll(x=0, y=0) 

    $game_map.setup_new_parallax({:loopx => true, :loopy => true, :sx => x, :sy => y}) 

  end 

   

  def remove_parallax 

    set_parallax("") 

  end 

   

  def remove_parallax_scroll 

    $game_map.setup_new_parallax({:loopx => false, :loopy => false}) 

  end 

   

end

 

Instructions

To set panorama:
#set_parallax("CloudySky")
#set_parallax_scroll(x, y) Set to 0 to deactivate movement set to negative to scroll backwards

To remove scrolling altogether call remove_parallax_scroll
to remove parallax call remove_parallax
to set parallax to a position call set_parallax_position(x, y)

Compatibility

No compatibility issues so far o_o

Credits and Thanks

I asked Linkz0r to make me one so thank you dude :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top