RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Scene_Menu Customization

0 Members and 2 Guests are viewing this topic.

***
Rep:
Level 75
Editing scripts to suit my needs I've learned some simple yet useful things, and this is the result of what I've learned so far, a simple configurable Scene_Menu modification.



Description

The scope of this script is to edit simple values in the Scene_Menu, such as windows coordinates and opacity. It also provides the option to have a picture as background.


Screenshots




Instructions

Paste this script ? Materials but above ? Main in your Script Editor.


Compatibility

Does not work with other Menu Scripts.


Script


Code: [Select]
#==============================================================================
# Scene_Menu Customization
#------------------------------------------------------------------------------
# The scope of this script is to edit simple values in the Scene_Menu, such as
# windows coordinates and opacity. It also provides the option to have a picture
# as background.
#
#==============================================================================
# Instructions
#------------------------------------------------------------------------------
# Paste this script ? Materials but above ? Main in your Script Editor.
#
#==============================================================================
# Compatibility
#------------------------------------------------------------------------------
# Does not work with other Menu Scripts.
#
#==============================================================================



#==============================================================================
# Configuration start here.
#==============================================================================

module SM_S
 
  # Background picture, place inside "Graphics\System" folder.
  # Omit file extension (.jpg/.png), leave "" for no picture. Case sensitive.
  MenuBack = "Gameover"
 
  # Opacity of the background picture. Insert a value  between 0 and 255.
  # 0 = invisible, 255 = full opacity. 255 is default value.
  MenuBackOpacity = 255
 
  # X coordinate of the command window. 0 is default value.
  CommandsX = 0
 
  # Y coordinate of the command window. 0 is default value.
  CommandsY = 0
 
  # Opacity of the command window. Insert a value  between 0 and 255.
  # 0 = invisible, 255 = full opacity. 255 is default value.
  CommandsOpacity = 255
 
  # X coordinate of the status window.
  # 160 is default value.
  StatusX = 160
 
  # Opacity of the status window. Insert a value  between 0 and 255.
  # 0 = invisible, 255 = full opacity. 255 is default value.
  StatusOpacity = 255
 
  # X coordinate of the gold window. 0 is default value.
  GoldX = 0
 
  # Y coordinate of the gold window. 360 is default value.
  GoldY = 360
 
  # Opacity of the gold window. Insert a value  between 0 and 255.
  # 0 = invisible, 255 = full opacity. 255 is default value.
  GoldOpacity = 255
 
end

#==============================================================================
# Configuration ends here.
#==============================================================================



#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @command_window.x = SM_S::CommandsX
    @command_window.y = SM_S::CommandsY
    @command_window.opacity = SM_S::CommandsOpacity
    @gold_window = Window_Gold.new(SM_S::GoldX, SM_S::GoldY)
    @gold_window.opacity = SM_S::GoldOpacity
    @status_window = Window_MenuStatus.new(SM_S::StatusX, 0)
    @status_window.opacity = SM_S::StatusOpacity
  end
  #--------------------------------------------------------------------------
  # * Create Menu Background
  #--------------------------------------------------------------------------
  def create_menu_background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = Cache.system(SM_S::MenuBack)
    @menuback_sprite.opacity = SM_S::MenuBackOpacity
    update_menu_background
  end
end
« Last Edit: November 25, 2010, 12:12:38 PM by heisenman »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Thanks for sharing. Remember though that there is no need to include methods that you do not modify, so long as you are not directly replacing the default script. Either way, simple edits like this are a good way to start learning how to script. I hope you keep at it.

***
Rep:
Level 75
Quote
there is no need to include methods that you do not modify
I did not know, thanks for telling me.
I'll be more careful next time.

EDIT: well, since it was a rather easy job, I updated the script.
« Last Edit: November 24, 2010, 09:02:47 PM by heisenman »

***
Rep:
Level 75
Changed @menuback to @menuback_sprite.
*hangs head in shame*