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.

Main Menu EVO

Well i haven't posted many scripts here, only one I think, but i'm pretty proud of this one.
It has an awesome effect when going into and out of the menu. I'll be making Item/Equipment scenes etc when i have time :)

~ Notes ~

Completely Plug'n'Play, just put in a new script section above main.
Please give credit if used!

~ Screenshots ~

tehmenu.png


~ Script ~

Code:
#===============================================================================

# * Menu System EVO

# * By Crazyninjaguy

# * [url=http://www.planetdev.net]http://www.planetdev.net[/url]

#-------------------------------------------------------------------------------

# * Please give credits if you use this script!

#===============================================================================

 

class Scene_Menu < Scene_Base

  def start

    super

    create_menu_background

    create_windows

  end

  def update

    super

    @command_window.update

    @status_window.update

    @dummy.update

    @location.update

    @gold.update

    if @command_window.active

      update_command_selection

    elsif @status_window.active

      update_actor_selection

    end

  end

  def terminate

    super

    dispose_menu_background

    @command_window.dispose

    @status_window.dispose

    @dummy.dispose

    @location.dispose

    @gold.dispose

  end

  def pre_terminate

    super

    close_command_window

  end

  def create_windows

    @commands = [

    Vocab::item,

    Vocab::skill,

    Vocab::equip,

    Vocab::status,

    Vocab::save,

    Vocab::game_end]

    @dummy = Window_MenuDummy.new

    @dummy.openness = 0

    @dummy.open

    @command_window = Window_Command.new(138, @commands)

    @command_window.x = 24

    @command_window.opacity = 0

    @command_window.openness = 0

    @command_window.open

    @status_window = Window_MenuStatus.new(0, (416 - 240))

    @status_window.openness = 0

    @status_window.open

    @location = Window_Location.new

    @location.openness = 0

    @location.open

    @gold = Window_Gold.new((Graphics.width - 160), 56)

    @gold.openness = 0

    @gold.open

  end

  def close_command_window

    @dummy.close

    @status_window.close

    @command_window.close

    @location.close

    @gold.close

    begin

      @dummy.update

      @status_window.update

      @command_window.update

      @location.update

      @gold.update

      Graphics.update

    end until @dummy.openness == 0 && @status_window.openness == 0 && @command_window.openness == 0

  end

  def update_command_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      $scene = Scene_Map.new

    elsif Input.trigger?(Input::C)

      if $game_party.members.size == 0 and @command_window.index < 4

        Sound.play_buzzer

        return

      elsif $game_system.save_disabled and @command_window.index == 4

        Sound.play_buzzer

        return

      end

      Sound.play_decision

      case @command_window.index

      when 0      # Item

        $scene = Scene_Item.new

      when 1,2,3  # Skill, equipment, status

        start_actor_selection

      when 4      # Save

        $scene = Scene_File.new(true, false, false)

      when 5      # End Game

        $scene = Scene_End.new

      end

    end

  end

  def update_actor_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      end_actor_selection

    elsif Input.trigger?(Input::C)

      $game_party.last_actor_index = @status_window.index

      Sound.play_decision

      case @command_window.index

      when 1  # skill

        $scene = Scene_Skill.new(@status_window.index)

      when 2  # equipment

        $scene = Scene_Equip.new(@status_window.index)

      when 3  # status

        $scene = Scene_Status.new(@status_window.index)

      end

    end

  end

end

 

class Window_MenuStatus < Window_Selectable

  def initialize(x, y)

    super(x, y, 544, 240)

    refresh

    self.active = false

    self.index = -1

  end

  def refresh

    self.contents.clear

    @item_max = $game_party.members.size

    for actor in $game_party.members

      draw_actor_face(actor, (actor.index * 130) + 10, 2, 92)

      x = 128

      y = actor.index * 96 + WLH / 2

      draw_actor_graphic(actor, (actor.index * 130) + 24, 94)

      draw_actor_name(actor, actor.index * 130, 106)

      draw_actor_hp(actor, (actor.index * 130), 106 + (WLH * 2), 110)

      draw_actor_mp(actor, (actor.index * 130), 106 + (WLH * 3), 110)

      draw_actor_level(actor, (actor.index * 130), (106 + WLH))

    end

  end

  def item_rect(index)

    rect = Rect.new((@index * 120), 0, 120, (240 - 32))

    rect.width = 120

    rect.height = (240 - 32)

    rect.x = (@index * 120)

    rect.y = 0

    return rect

  end

  def update_cursor

    if @index < 0

      self.cursor_rect.empty

    elsif @index == 0

      self.cursor_rect.set(-5, 0, 120, (240 - 32))

    elsif @index == 1

      self.cursor_rect.set(125, 0, 120, (240 - 32))

    elsif @index == 2

      self.cursor_rect.set(255, 0, 120, (240 - 32))

    elsif @index == 3

      self.cursor_rect.set(385, 0, 120, (240 - 32))

    end

  end

  def update

    super

    if cursor_movable?

      last_index = @index

      if Input.repeat?(Input::RIGHT)

        if @index == 0

          @index = 1

        elsif @index == 1

          @index = 2

        elsif @index == 2

          @index = 3

        elsif @index == 3

          @index = 0

        end

      elsif Input.repeat?(Input::LEFT)

        if @index == 0

          @index = 3

        elsif @index == 1

          @index = 0

        elsif @index == 2

          @index = 1

        elsif @index == 3

          @index = 2

        end

      end

      if @index != last_index

        Sound.play_cursor

      end

    end

    update_cursor

    call_update_help

  end

end

 

class Window_MenuDummy < Window_Base

  def initialize

    super(0, 0, 160, 176)

    refresh

  end

  def refresh

    draw_icon(144, 0, 0)

    draw_icon(128, 0, 24)

    draw_icon(32, 0, 48)

    draw_icon(106, 0, 72)

    draw_icon(176, 0, 96)

    draw_icon(142, 0, 120)

  end

end

 

class Window_Location < Window_Base

  def initialize

    super(160, 0, (544 - 160), 56)

    refresh

  end

  def refresh

    @map = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name

    self.contents.draw_text(0, 0, width - 32, WLH, "Location:")

    self.contents.draw_text(0, 0, width - 32, WLH, @map, 2)

  end

end
 
Pretty decent custom menu. It's good that we have a lot of varying menus because it gets boring when everyone starts having the same fancy-pants menus. This will be handy for a lot of people starting new projects.
 

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