Hey, this is my first script I'm posting here. It's just a simple icon based custom menu system with a window that shows the menu item you're selecting. Also shown in the screenshot are some simple bars that I might post later.
Screenshot:

Demos:
Custom Menu System
HEREIcon Command Window used in Battle
HERE (Added Window_Menu_Icon and Window_Menu_Icon_Reader classes, then modified Scene_Battle class. All changes in the Scene_Battle class are commented.)
Icon Command Window used in Title Screen
HERE (Added Window_Menu_Icon and Window_Menu_Icon_Reader classes, then modified Scene_Title class. All changes in the Scene_Title class are commented.)
Instructions for code numero uno: create a new script above Window_Help and call it Window_Menu_Icon. Paste the following code into this script.
CODE
#--------------------------------------------------------------
# CLASS: Window_Menu_Icon
# JAKO DRAKO
# Please give credit
# Summary: A command window with icons. To be used with class Window_Menu_Icon_Reader.
#--------------------------------------------------------------
class Window_Menu_Icon < Window_Selectable
attr_reader :disabled_items
attr_reader :commands
def initialize(x, y, commands)
super(x, y, 32 * commands.size + 32, 64)
@item_max = commands.size
@commands = commands
@column_max = commands.size
self.contents = Bitmap.new(self.width - 32, self.height - 32)
@disabled_items = Array.new(commands.size, false)
self.index = 0
refresh
end
#-------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_icon(i)
end
end
#-------------------------------------------------------------
def draw_icon(index)
temp_string = @commands[index]
if temp_string.include? $data_system.words.item
bitmap = RPG::Cache.icon("034-Item03")
elsif temp_string.include? $data_system.words.skill
bitmap = RPG::Cache.icon("044-Skill01")
elsif temp_string.include? $data_system.words.attack or temp_string.include? $data_system.words.equip
bitmap = RPG::Cache.icon("001-Weapon01")
elsif temp_string.include? "Status" or temp_string.include? "New"
bitmap = RPG::Cache.icon("050-Skill07")
elsif temp_string.include? "Save"
bitmap = RPG::Cache.icon("047-Skill04")
elsif temp_string.include? "Quit" or temp_string.include? "End"
bitmap = RPG::Cache.icon("046-Skill03")
elsif temp_string.include? "Load" or temp_string.include? "Continue"
bitmap = RPG::Cache.icon("048-Skill05")
elsif temp_string.include? $data_system.words.guard
bitmap = RPG::Cache.icon("009-Shield01")
else
bitmap = RPG::Cache.icon("049-Skill06")
end
x = 32 * index + 2
self.contents.blt(x, 2, bitmap, Rect.new(0, 0, 24, 24))
end
#-------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
cursor_width = 28
x = 32 * @index
y = 0
self.cursor_rect.set(x, y, cursor_width, 28)
end
#-------------------------------------------------------------
def disable_item(index)
@disabled_items[index] = true
end
end
Instructions for code 2: create a new script below the previous one, name it Window_Menu_Icon_Reader, and paste the following code into it.
CODE
#--------------------------------------------------------------
# CLASS: Window_Menu_Icon_Reader
# Summary: Displays the command of the currently selected icon in a
# Window_Menu_Icon type object. The Window_Menu_Icon instance
# is supplied to the constructor method.
#--------------------------------------------------------------
class Window_Menu_Icon_Reader < Window_Base
def initialize(menu_window)
@icon_window = menu_window
@commands = @icon_window.commands
super(@icon_window.x + @icon_window.width, @icon_window.y, 92, 64)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
end
#--------------------------------------------------------------
def update
super
self.contents.clear
draw_text(@icon_window.index)
end
#--------------------------------------------------------------
def draw_text(index)
self.contents.clear
if @icon_window.disabled_items[index] == false
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 60, 32, @commands[index])
elsif @icon_window.disabled_items[index] == true
self.contents.font.color = disabled_color
self.contents.draw_text(0, 0, 60, 32, @commands[index])
end
end
end
Instructions for code #3: Create a new code after Window_Gold and name it Window_Gold2 or something. Copy and paste...
CODE
#==============================================================================
# ¦ Window_Gold
#------------------------------------------------------------------------------
# ????????????????
#==============================================================================
class Window_Gold2 < Window_Base
#--------------------------------------------------------------------------
# ????????
#--------------------------------------------------------------------------
def initialize()
super(0, 0, 162, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
# ?????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
(Yeah, I know it's almost exactly the same as Window_Gold, but if I said, "Copy the Window_Gold script and name the copy Window_Gold2. Then change the class definition line so that the class name is Window_Gold2. Now change the super method call under the constructor method so that the width local variable is 162." would you understand me?)
Another class that must be changed slightly: Window_Playtime. Paste this code into the Window_Playtime class.
CODE
#==============================================================================
# ¦ Window_PlayTime
#------------------------------------------------------------------------------
# ????????????????????????
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# ????????
#--------------------------------------------------------------------------
def initialize
super(0, 0, 162, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
# ?????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# ?????
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
Okay, last script (sort of): Replace the code in your Window_MenuStatus script with this code:
CODE
#--------------------------------------------------------------
# CLASS: Winodw_MenuStatus
# Summary: Edited Window_MenuStatus class to be used with
# the Window_Menu_Icon class.
#--------------------------------------------------------------
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 640, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
@column_max = 4
end
#--------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
text_x = 155 * i + 5
text_y = 150
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
pic_x = 155 * i + (150 - bitmap.width) / 2
pic_y = 5
self.contents.blt(pic_x, pic_y, bitmap, Rect.new(0, 0, 150, bitmap.height))
draw_actor_name(actor, text_x, text_y)
draw_actor_class(actor, text_x, text_y + 32)
draw_actor_level(actor, text_x - 1, text_y + 64)
draw_actor_state(actor, text_x, text_y + 192)
draw_actor_exp(actor, text_x - 1, text_y + 160)
draw_actor_hp(actor, text_x, text_y + 96)
draw_actor_sp(actor, text_x, text_y + 128)
end
end
#--------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(155 * @index, 0, 148, 384)
end
end
end
All right. Now to implement it. Open the Scene_Menu script. Replace all the code with this code:
CODE
#==============================================================================
# ¦ Scene_Menu
#------------------------------------------------------------------------------
# ?????????????????
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ????????
# menu_index : ????????????
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ????
#--------------------------------------------------------------------------
def main
# ???????????
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "Quit"
@command_window = Window_Menu_Icon.new(0, 0, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
@command_window_text = Window_Menu_Icon_Reader.new(@command_window)
# ?????? 0 ???
if $game_party.actors.size == 0
# ????????????????????
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# ???????
if $game_system.save_disabled
# ????????
@command_window.disable_item(4)
end
# ????????????
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 64
@gold_window = Window_Gold2.new
@gold_window.x = 316
@gold_window.y = 0
@time_window = Window_PlayTime.new
@time_window.x = 478
@time_window.y = 0
# ????????
Graphics.transition
# ?????
loop do
# ???????
Graphics.update
# ??????
Input.update
# ?????
update
# ???????????????
if $scene != self
break
end
end
# ????????
Graphics.freeze
# ???????
@command_window.dispose
@command_window_text.dispose
@status_window.dispose
@gold_window.dispose
@time_window.dispose
end
#--------------------------------------------------------------------------
# ?????
#--------------------------------------------------------------------------
def update
# ???????
@command_window.update
@command_window_text.update
@status_window.update
@gold_window.update
@time_window.update
# ?????????????????: update_command ??
if @command_window.active
update_command
return
end
# ??????????????????: update_status ??
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# ????? (??????????????????)
#--------------------------------------------------------------------------
def update_command
# B ?????????
if Input.trigger?(Input::B)
# ???? SE ??
$game_system.se_play($data_system.cancel_se)
# ?????????
$scene = Scene_Map.new
return
end
# C ?????????
if Input.trigger?(Input::C)
# ?????? 0 ?????????????????????
if $game_party.actors.size == 0 and @command_window.index < 4
# ?? SE ??
$game_system.se_play($data_system.buzzer_se)
return
end
# ??????????????????
case @command_window.index
when 0 # ???
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ??????????
$scene = Scene_Item.new
when 1 # ??
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ??????????????????
@command_window.active = false
@command_window_text.active = false
@status_window.active = true
@status_window.index = 0
when 2 # ?
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ??????????????????
@command_window.active = false
@command_window_text.active = false
@status_window.active = true
@status_window.index = 0
when 3 # ????
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ??????????????????
@command_window.active = false
@command_window_text.active = false
@status_window.active = true
@status_window.index = 0
when 4 # ??
# ???????
if $game_system.save_disabled
# ?? SE ??
$game_system.se_play($data_system.buzzer_se)
return
end
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ?????????
$scene = Scene_Save.new
when 5
# ? SE ??
$game_system.se_play($data_system.decision_se)
# "QUIT" CODE
$scene = Scene_End.new()
return
end
end
#--------------------------------------------------------------------------
# ????? (???????????????????)
#--------------------------------------------------------------------------
def update_status
# B ?????????
if Input.trigger?(Input::B)
# ???? SE ??
$game_system.se_play($data_system.cancel_se)
# ?????????????????
@command_window.active = true
@command_window_text.active = true
@status_window.active = false
@status_window.index = -1
return
end
# C ?????????
if Input.trigger?(Input::C)
# ??????????????????
case @command_window.index
when 1 # ??
# ??????????? 2 ????
if $game_party.actors[@status_window.index].restriction >= 2
# ?? SE ??
$game_system.se_play($data_system.buzzer_se)
return
end
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ?????????
$scene = Scene_Skill.new(@status_window.index)
when 2 # ?
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ????????
$scene = Scene_Equip.new(@status_window.index)
when 3 # ????
# ? SE ??
$game_system.se_play($data_system.decision_se)
# ???????????
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
end
Okay, you're done! Now when you call the menu in game, it will look something like the screenshot above.
If the experience text for the party members is a little off, replace the draw_actor_exp method in Window_Base with this:
CODE
def draw_actor_exp(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 40, 32, "Exp")
self.contents.font.color = normal_color
self.contents.draw_text(x , y, 84, 32, actor.exp_s, 2) #x + 24
self.contents.draw_text(x + 85, y, 12, 32, "/", 1) #x + 108
self.contents.draw_text(x + 97, y, 84, 32, actor.next_exp_s) #x + 120
end
Added by Night_RunnerThis script follows an archaic format, which allows custom font and custom fontsize. To run the code, you need to go into your script editor, along long the left scroll down to, and select, Main.
Just after
begin, insert the code:
CODE
$fontface = Font.default_name
$fontsize = Font.default_size
Which sets the font & font size to follow default format.
For advanced scripters: You can use the Window_Menu_Icon and Window_Menu_Icon_Reader classes for any instance of Window_Command used in the script. If you need help implementing this, just PM me.
Examples:
In title screen (For script changes look in the demo)

In battle (Again, look in the demo for all the script changes)
Edited by Night_Runner - Fix all the ?'s in the code, and to append my footnote above..