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.

Changing opacity of item menu?

I have disabled the custom menu, so when the player press ESC the item menu opens.

Is there a way for this item menu be transparent, with the actual map on the back? (like window messages)

sorry for my poor english.
 

OS

Sponsor

Go into Scene_Item and add two new lines under line 14. In these lines put @item_window.opacity = 100 and @help_window.opacity = 100. Change the 100's as necessary.

Add another line directly under the line that says 'def main' and put $spriteset = Spriteset_Map.new.

For simplicity's sake, I'll just post the code:

Code:
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_Item
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    $spriteset = Spriteset_Map.new
    # Make help window, item window
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @item_window.opacity = 100
    @help_window.opacity = 100
    # Associate help window
    @item_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false

Replace everything above the comment '#Execute Transition' with the code above.

If that doesn't work, I am terribly sorry for wasting your time. Peace.
 
@OS don't add unnecessary global variables it is a bad programming practice (it violates OOP) and it eats a bit of memory, that variable could have been declared as an instance variable and still do want you want it too (also I think RMXP bugs out if you have two instances of Spriteset_Map created or something) also you forgot to dispose the spriteset (no offense to you though)

something like this should work

Code:
class Scene_Item
  alias_method :trick_itemmod_item_main, :main
  def main
    @spriteset = Spriteset_Map.new
    trick_itemmod_item_main
    @spriteset.dispose
  end
end

class Window_Item
  alias_method :trick_itemmod_item_initialize, :initialize
  def initialize
    trick_itemmod_item_initialize
    self.back_opacity = 100
    self.opacity = 100
  end
end

class Window_Help
  alias_method :trick_itemmod_help_initialize, :initialize
  def initialize
    trick_itemmod_help_initialize
    if $scene.is_a?(Scene_Item)
      self.back_opacity = 100
      self.opacity = 100
    end
  end
end

if the number 100 doesn't suit you you are free to change it :p

but that should work let me know if it gives you any trouble
 
What about:
Code:
class Window_Base
  alias_method :raz_opacity_ini, :initialize
  def initialize(x, y, width, height)
    raz_opacity_ini(x, y, width, height)
    self.opacity, self.back_opacity = 200, 200 if $scene.is_a?(Scene_Item)
  end
end

class Scene_Item
  alias_method :raz_opacity_main, :main
  def main
    @spriteset = Spriteset_Map.new
    raz_opacity_main
    @spriteset.dispose
  end
end

I know it does the same thing, but whatever. :p
 

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