Thanks: D I've taken a look at the script G_G, but I was confused and I gave up. XD
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#=============================================================================
# * SFonts
#=============================================================================
# Trickster
# Version 1.0
# 12.19.07
#=============================================================================
# Introduction
# - This script adds SFont support for rmxp. An sfont is a image file with
# characters already drawn onto it. The top row of pixels in this image shows
# where the characters are and where the breaks are.
# Setting up images
# - The top left hand pixel (0, 0) is the skip color and tells if a column
# of pixels is empty or contain data
# - Images should be placed in Graphics/SFonts
# - For more reference see the example image Arial_Text
# To Use
# - You can use this script in one of two ways
# - 1) Set <Bitmap>.sfont to an SFont object then call <Bitmap>.draw_text
# - 2) Call <SFont>.render(<String>) and then blt it to a Bitmap object
# Documentation
# - SFont.new(<String/Bitmap>, <Array>, <Integer/String>)
# - Where the first parameter is a filename (in Graphics/SFonts) or a Bitmap
# object containing the Font data
# - the second parameter is an Array of all of the characters in order in the
# file the default is specified in @@glyphs below you
# - the last parameter is either the width that should be used for the space
# character or the character whose width you want to use for the space
# character the default is " which is the width of the " character if "
# character is not in the glyph then the height of the bitmap will be used
# Credits
# - John Croisant for the original code for Rubygame which I used as a base for
# this script
# - Adam Bedore for the example sfont image more of his sfont work is given
# here - http://www.zlurp.com/irq/download.html
# Websites
# - Official SFont Page with sample fonts - http://www.linux-games.com/sfont
# - SFont generator utility - http://www.nostatic.org/sfont
# - SFont generator script for GIMP by Roger Feese
# http://www.nostatic.org/sfont/render-sfont22.scm
#=============================================================================
module RPG
module Cache
#--------------------------------------------------------------------------
# * SFont Load
#--------------------------------------------------------------------------
def self.sfont(file)
self.load_bitmap("Graphics/SFonts/", file)
end
end
end
class SFont
#--------------------------------------------------------------------------
# * Class Variables
#--------------------------------------------------------------------------
@@glyphs = [
"!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0",
"1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@",
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P",
"Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`",
"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p",
"q","r","s","t","u","v","w","x","y","z","{","|","}","~","∞",
]
#--------------------------------------------------------------------------
# * Get Glyphs
#--------------------------------------------------------------------------
def SFont.glyphs
return @@glyphs
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(file, glyphs = @@glyphs, space = '"')
if file.is_a?(String)
bitmap = RPG::Cache.sfont(file)
elsif file.is_a?(Bitmap)
bitmap = file
else
raise(ArgumentError, "File Must be a String or Bitmap")
end
@height = bitmap.height
@skip = bitmap.get_pixel(0, 0)
@glyphs = {}
x = 2
glyphs.each {|char| x = load_glyph(bitmap, char, x)}
unless glyphs.include?(' ')
if space.is_a?(Numeric)
space = space.to_i
elsif space.is_a?(String)
if glyphs.include?(space)
space = @glyphs[space].width
elsif !@glyphs['"'].nil?
space = @glyphs['"'].width
else
space = bitmap.height
end
else
raise(ArgumentError, "Space must be either a String or Numeric")
end
@glyphs[" "] = Bitmap.new(space, @height)
end
@glyphs.default = @glyphs[" "]
end
#--------------------------------------------------------------------------
# * Text Size
#--------------------------------------------------------------------------
def text_size(text)
width = 0
text.each_byte {|byte| width += @glyphs["%c" % byte].width}
return width
end
#--------------------------------------------------------------------------
# * Render
#--------------------------------------------------------------------------
def render(text)
width = text_size(text)
bitmap = Bitmap.new(width, @height)
x = 0
text.each_byte do |byte|
glyph = @glyphs["%c" % byte]
bitmap.blt(x, 0, glyph, glyph.rect)
x += glyph.width
end
return bitmap
end
#--------------------------------------------------------------------------
# * Private: Load glyph
#--------------------------------------------------------------------------
private
def load_glyph(bitmap, char, xi)
while bitmap.get_pixel(xi, 0) == @skip && xi < bitmap.width
xi += 1
end
return -1 if xi >= bitmap.width
xf = xi
while bitmap.get_pixel(xf, 0) != @skip && xf < bitmap.width
xf += 1
end
return -1 if xf >= bitmap.width
rect = Rect.new(xi, 0, xf - xi, bitmap.height)
@glyphs[char] = Bitmap.new(xf - xi, bitmap.height)
@glyphs[char].blt(0, 0, bitmap, rect)
return xf+1
end
end
class Rect
#--------------------------------------------------------------------------
# * Strict Conversion to Array
#--------------------------------------------------------------------------
def to_ary
return x, y, width, height
end
alias bounds to_ary
end
class Bitmap
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :sfont
#--------------------------------------------------------------------------
# * Draw Text
#--------------------------------------------------------------------------
alias_method :trick_sfont_bitmap_draw_text, :draw_text
def draw_text(*args)
if self.sfont == nil
trick_sfont_bitmap_draw_text(*args)
else
align = 0
case args.size
when 2
rect, text = args
x, y, width, height = rect
when 3
rect, text, align = args
x, y, width, height = rect
when 5
x, y, width, height, text = args
when 6
x, y, width, height, text, align = args
end
bitmap = sfont.render(text)
if align == 1
x += (width - bitmap.width) / 2
elsif align == 2
x += width - bitmap.width
end
y += (height - bitmap.height) / 2
blt(x, y, bitmap, bitmap.rect)
end
end
end
Quote from: gameus on April 13, 2013, 01:19:29 am
Updated to work with my new script, Skill Categories.
http://forum.chaos-project.com/index.php/topic,13055.new.html#new
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super("Which file would you like to save to?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# Play save SE
$game_system.se_play($data_system.save_se)
# Write save data
file = File.open(filename, "wb")
write_save_data(file)
file.close
# If called from event
if $game_temp.save_calling
# Clear save call flag
$game_temp.save_calling = false
# Switch to map screen
$scene = Scene_Map.new
return
end
# Switch to menu screen
$scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
def on_cancel
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If called from event
if $game_temp.save_calling
# Clear save call flag
$game_temp.save_calling = false
# Switch to map screen
$scene = Scene_Map.new
return
end
# Switch to menu screen
$scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
def write_save_data(file)
# Make character data for drawing save file
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
# Write character data for drawing save file
Marshal.dump(characters, file)
# Wrire frame count for measuring play time
Marshal.dump(Graphics.frame_count, file)
# Increase save count by 1
$game_system.save_count += 1
# Save magic number
# (A random value will be written each time saving with editor)
$game_system.magic_number = $data_system.magic_number
# Write each type of game object
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Remake temporary object
$game_temp = Game_Temp.new
# Timestamp selects new file
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Which file would you like to load?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# If file doesn't exist
unless FileTest.exist?(filename)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play load SE
$game_system.se_play($data_system.load_se)
# Read save data
file = File.open(filename, "rb")
read_save_data(file)
file.close
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
def on_cancel
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to title screen
$scene = Scene_Title.new
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
def read_save_data(file)
# Read character data for drawing save file
characters = Marshal.load(file)
# Read frame count for measuring play time
Graphics.frame_count = Marshal.load(file)
# Read each type of game object
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number
# Load map
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# Refresh party members
$game_party.refresh
end
end
#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class Window_BattleStatus < Window_Base
def initialize
super(-40, 310, 700, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
self.contents.font.size = 18
self.contents.font.bold = true
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
self.contents.font.size = 18
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
if $game_switches[5] == true
actor = $game_party.actors[i]
actor_x = i * 180 + 52
actor_y = i * 28
if i == 0
draw_face2(actor, 59 ,48)
draw_hp2(actor, 64 , 20, 120)
draw_sp2(actor, 91, 32, 120)
end
if i == 1
draw_face2(actor, 281 ,48)
draw_hp2(actor, 286 , 20, 120)
draw_sp2(actor, 313, 32, 120)
end
if i == 2
draw_face2(actor, 502 ,48)
draw_hp2(actor, 507 , 20, 120)
draw_sp2(actor, 534, 32, 120)
end
if i == 3
draw_face2(actor, 177 ,104)
draw_hp2(actor, 182 , 76, 120)
draw_sp2(actor, 209, 88, 120)
end
if i == 4
draw_face2(actor, 405 ,104)
draw_hp2(actor, 410 , 76, 120)
draw_sp2(actor, 437, 88, 120)
end
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 18
if i == 0
draw_actor_state(actor, 114, 40)
end
if i == 1
draw_actor_state(actor, 336, 40)
end
if i == 2
draw_actor_state(actor, 557, 40)
end
if i == 3
draw_actor_state(actor, 232, 96)
end
if i == 4
draw_actor_state(actor, 460, 96)
end
self.contents.font.size = 18
end
else
actor = $game_party.actors[i]
actor_x = i * 160 + 12
draw_lay(actor,actor_x - 5,110)
draw_face(actor,actor_x,100)
draw_name(actor, actor_x, 0)
draw_hp(actor, actor_x, 32, 120)
draw_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, actor_x + 80, 80)
self.contents.font.size = 18
end
end
end
end
def update
super
end
end
#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class Window_BattleStatus < Window_Base
def initialize
super(-20, 330, 680, 180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
self.contents.font.size = 18
self.contents.font.bold = true
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
self.contents.font.size = 18
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
if $game_switches[5] == true
actor = $game_party.actors[i]
actor_x = i * 160 + 12
actor_y = i * 32
draw_face2(actor,355 ,actor_y + 38)
draw_hp2(actor, 360 , actor_y + 5, 120)
draw_sp2(actor, 480, actor_y + 5, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, 410, actor_y + 15)
self.contents.font.size = 18
end
else
actor = $game_party.actors[i]
actor_x = i * 160 + 12
draw_lay(actor,actor_x - 5,110)
draw_face(actor,actor_x,100)
draw_name(actor, actor_x, 0)
draw_hp(actor, actor_x, 32, 120)
draw_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, actor_x + 70, 80)
self.contents.font.size = 18
end
end
end
end
def update
super
end
end
#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class Window_BattleStatus < Window_Base
def initialize
super(-40, 310, 700, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
self.contents.font.size = 18
self.contents.font.bold = true
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
self.contents.font.size = 18
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
if $game_switches[5] == true
actor = $game_party.actors[i]
actor_x = i * 180 + 52
actor_y = i * 28
draw_face2($game_party.actors[0],59 ,48) #imposta la grafica dei dettagli personaggi in battaglia
draw_face2($game_party.actors[1],281 ,48) #281
draw_face2($game_party.actors[2],502 ,48) #502
draw_face2($game_party.actors[3],177 ,104)
draw_face2($game_party.actors[4],405 ,104)
draw_hp2($game_party.actors[0], 64 , 20, 120)
draw_sp2($game_party.actors[0], 91, 32, 120)
draw_hp2($game_party.actors[1], 286 , 20, 120)
draw_sp2($game_party.actors[1], 313, 32, 120)
draw_hp2($game_party.actors[2], 507 , 20, 120)
draw_sp2($game_party.actors[2], 534, 32, 120)
draw_hp2($game_party.actors[3], 182 , 76, 120)
draw_sp2($game_party.actors[3], 209, 88, 120)
draw_hp2($game_party.actors[4], 410 , 76, 120)
draw_sp2($game_party.actors[4], 437, 88, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 18
#draw_actor_state(actor, 410, actor_y + 8)
draw_actor_state($game_party.actors[0], 114, 40)
draw_actor_state($game_party.actors[1], 336, 40)
draw_actor_state($game_party.actors[2], 557, 40)
draw_actor_state($game_party.actors[3], 232, 96)
draw_actor_state($game_party.actors[4], 460, 96)
self.contents.font.size = 18
end
else
actor = $game_party.actors[i]
actor_x = i * 160 + 12
draw_lay(actor,actor_x - 5,110)
draw_face(actor,actor_x,100)
draw_name(actor, actor_x, 0)
draw_hp(actor, actor_x, 32, 120)
draw_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, actor_x + 80, 80)
self.contents.font.size = 18
end
end
end
end
def update
super
end
end
#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class React < Window_Base
attr_reader :index
attr_reader :help_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@row_max = 1
@index = -1
end
def index=(index)
@index = index
refresh
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = 0
x = @index / @column_max * 48 - self.oy
y = 110 + @index % @column_max * (cursor_width + 100)
self.cursor_rect.set(x, y, cursor_width, 32)
t = @index / @column_max * 28 - self.oy
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::C) or Input.repeat?(Input::B)
refresh
end
if Input.repeat?(Input::RIGHT)
if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or
@index < @item_max - @row_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @row_max) % @item_max
refresh
end
end
if Input.repeat?(Input::LEFT)
if (@column_max == 1 and Input.trigger?(Input::LEFT)) or
@index >= @row_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @row_max + @item_max) % @item_max
refresh
end
end
if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
refresh
end
end
if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
refresh
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
refresh
self.top_row += self.page_row_max
end
end
if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
refresh
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
class Window_Base < Window
def draw_face(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face")
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_face2(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face2")
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_lay(actor,x,y)
layout = RPG::Cache.picture(actor.name + "_lay")
cw = layout.width
ch = layout.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, layout, src_rect)
end
def draw_hp(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("HP_BAR")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("HP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60, y - ch + 15, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(hp_x + 20, y - 8, 48, 32, actor.hp.to_s, 2)
end
def draw_hp2(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, back, src_rect)
meter = RPG::Cache.picture("HP_BAR")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, meter, src_rect)
text = RPG::Cache.picture("HP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 33, y - ch + 20, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(hp_x - 21, y - 4, 12, 32, "HP", 1)
self.contents.draw_text(hp_x - 33, y - 4, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = normal_color
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(hp_x + 15, y - 4, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 27, y - 4, 48, 32, actor.maxhp.to_s)
end
def draw_sp(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("SP_BAR")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("SP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60, y - ch + 15, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(sp_x + 20, y - 8, 48, 32, actor.sp.to_s, 2)
end
def draw_sp2(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, back, src_rect)
meter = RPG::Cache.picture("SP_BAR")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, meter, src_rect)
text = RPG::Cache.picture("SP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 33, y - ch + 20, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(sp_x - 48, y - 4, 12, 32, "EP", 1)
self.contents.draw_text(sp_x - 60, y - 4, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = normal_color
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(sp_x - 12, y - 4, 12, 32, "/", 1)
self.contents.draw_text(sp_x, y - 4, 48, 32, actor.maxsp.to_s)
end
def draw_name(actor, x, y)
self.contents.font.color = Color.new(238,46,218,255)
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(x , y, 100, 40, actor.name,15) #self.contents.draw_text(x , y, 70, 40, actor.name,1)
end
def draw_commando(x,y)
com = RPG::Cache.picture("commando")
cw = com.width
ch = com.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, com, src_rect)
end
def draw_level(actor, x, y)
self.contents.font.color = Color.new(238,46,218,255)
self.contents.draw_text(x + 32, y, 20, 20, actor.level.to_s, 1)
end
def draw_com(actor, x, y)
action = RPG::Cache.picture(actor.name + "_com")
cw = action.width
ch = action.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, action, src_rect)
end
end
def draw_select(x,y)
com = RPG::Cache.picture("select")
cw = com.width
ch = com.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, com, src_rect)
end