This is a modified snipset I've written some weeks ago.
It's not well tested but it should show you the needed informations.
Just setup the settings and call the windows ingame with "Script ..." command.
Everything is written in the script.
#Using#
=begin
You can create a window for monsterinfos if you just
use the "Script..." Eventcommand. Add this line to the script:
create_monsterinfo_window(x,y,width,height,monster_id,window_id)
for example:
create_monsterinfo_window(0,0,250,200,1,"window1")
would create a window which has the coordinats 0 and 0. The width would be 250
and the hight 200 and the id of this window would become "window1".
The Monster would be Slime. :)
If you wish to dispose a window just use this command:
dispose_monsterinfo_window(id)
While you created a window you should give the window an id.
Just add this id into the command.
=end
module Deity
module MI_Window
PICTURE_SETTINGS = [
60, # x-coord of the picture
10, # y--cord of the picture
130, # width of picture
130, # height of picture
true, # Make picture fit to given place?
true, # Use background and Edge?
Color.new(100,100,100,100), # Backroundcolor
Color.new(200,200,200,200) # Edgecolor
] #<= Do not delete!
# Color of the prefix (ATK,DEF)
ATRIBUTE_COLOR = Color.new(200,20,20,250)
# Setup the infos you wish to be shown:
# Followings infos are possible:
# [NAME,HP,MP,ATK,DEF,SPI,AGI,HIT,EVA,EXP,GOLD]
# Just choose your favorit order and place the prefix in the
# first place and the info of this prefix into the second.
# For example if you want to show the name of a monster,
#add just this line:
# ["Name:","NAME"],
PRE_AND_INFO = [
["Name:","NAME"],
["HP:","HP"],
["MP","MP"],
["Atk:","ATK"],
["Def:","DEF"],
["SPI:","SPI"],
["AGI:","AGI"],
["HIT:","HIT"],
["EVA:","EVA"],
["EXP:","EXP"],
["GOLD:","GOLD"],
] #<= Do not delete!
end
end
include Deity::MI_Window
class Window_MonsterInfo < Window_Base
def initialize(x,y,width,height,monster_id,id = "")
super(x,y,width,height)
@monster = $data_enemies[monster_id]
@id = id
@m_id = monster_id
draw_infos
end
def id
return @id
end
def m_id
return @m_id
end
def draw_infos
self.contents.clear
if PICTURE_SETTINGS[5] && PICTURE_SETTINGS[4]
self.contents.fill_rect(PICTURE_SETTINGS[0]-3,PICTURE_SETTINGS[1]-3,PICTURE_SETTINGS[2]+6,PICTURE_SETTINGS[3]+6,PICTURE_SETTINGS[7])
self.contents.fill_rect(PICTURE_SETTINGS[0],PICTURE_SETTINGS[1],PICTURE_SETTINGS[2],PICTURE_SETTINGS[3],PICTURE_SETTINGS[6])
end
enemy_pic = Cache.battler(@monster.battler_name, @monster.battler_hue)
if PICTURE_SETTINGS[4]
src_rect = Rect.new(0,0,enemy_pic.width,enemy_pic.height)
rect = Rect.new(PICTURE_SETTINGS[0],PICTURE_SETTINGS[1],PICTURE_SETTINGS[2],PICTURE_SETTINGS[3])
self.contents.stretch_blt(rect,enemy_pic,src_rect)
else
x = (self.width - enemy_pic.width)/2
y = (self.height - enemy_pic.height)/2
rect = Rect.new(0,0,enemy_pic.width,enemy_pic.height)
self.contents.blt(x,y,enemy_pic,rect)
end
for o in 0...PRE_AND_INFO.size-1
i = PRE_AND_INFO[o]
self.contents.font.color = ATRIBUTE_COLOR
self.contents.draw_text(0,20*o,60,20,i[0],0)
text = ""
case i[1]
when "NAME"
text = @monster.name
when "HP"
text = @monster.maxhp
when "MP"
text = @monster.maxmp
when "ATK"
text = @monster.atk
when "DEF"
text = @monster.def
when "SPI"
text = @monster.spi
when "AGI"
text = @monster.agi
when "HIT"
text = @monster.hit
when "EVA"
text = @monster.eva
when "GOLD"
text = @monster.gold
when "EXP"
text = @monster.exp
end
self.contents.font.color = Font.default_color
self.contents.draw_text(60,20*o,60,20,text,0)
end
end
end
class Game_System
attr_accessor :monsterwindow_infos
alias initialize_monsterinfo_window initialize unless $@
def initialize
initialize_monsterinfo_window
@monsterwindow_infos = []
end
end
class Scene_Map
alias initialize_monster_window initialize unless $@
def initialize
initialize_monster_window
for i in $game_system.monsterwindow_infos
$game_map.interpreter.create_monsterinfo_window(i[0],i[1],i[2],i[3],i[4],i[5],false)
end
end
alias terminate_monster_windows terminate unless $@
def terminate
terminate_monster_windows
for i in $game_map.interpreter.monsterinfo_windows
i.dispose
end
$game_map.interpreter.monsterinfo_windows = []
end
end
class Game_Interpreter
attr_accessor :monsterinfo_windows
alias initialize_mi_win initialize unless $@
def initialize(depth = 0, main = false)
initialize_mi_win(depth = 0, main = false)
@monsterinfo_windows = []
end
def create_monsterinfo_window(x,y,width,height,monster_id,window_id,switch = true)
@monsterinfo_windows.push(Window_MonsterInfo.new(x,y,width,height,monster_id,window_id))
$game_system.monsterwindow_infos.push([x,y,width,height,monster_id,window_id]) if switch
end
def dispose_monsterinfo_window(id)
for i in 0...@monsterinfo_windows.size
if @monsterinfo_windows[i].id == id
@monsterinfo_windows[i].dispose
@monsterinfo_windows.delete_at(i)
@monsterinfo_windows.compact
$game_system.monsterwindow_infos.delete_at(i)
$game_system.monsterwindow_infos.compact
break
end
end
end
end
Deity