Siema. Znalazłem fajne ikony do gry, ale są za duże. W paczce z nimi była instrukcja jak je dopasować. Oto ona:
Spoiler:
Robimy to w 6 prostych krokach. Trzeba się trochę pobawić z Ruby :
1) Otwieramy Window_Item i znajdujemy 94 linijkę wklejamy zamiast niej to :
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48), opacity)
2) Otwieramy Window_Base i znajdujemy 317 linijkę i wklejamy zamiast niej to :
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48), opacity)
3) Otwieramy Window_EquipItem i znajdujemy 83 linijkę i wklejamy zamiast niej to : self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48), opacity)
4) Otwieramy Window_ShopStatus i znajdujemy 92 linijkę i zamiast niej wklejamy :
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48), opacity)
5) Otwieramy Window_ShopBuy i znajdujemy 85 linijkę. Zamiast niej wklejamy :
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48), opacity)
6) Otwieramy Window_ShopSell znajdujemy 84 linijkę i zamiast niej wklejamy :
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 48, 48), opacity)
I tyle :) Ikonki będą w 100% widoczne ale mogą na siebie czasami trochę nachodzić.
Tutaj przykład ikony.
Zrobiłem tak jak w instrukcji, ale u mnie to nie zadziałało. W dziale Ekwipunek ucina ikony i to brzydko wygląda.
Aby uprzedzić zbędne pytania.
1. Mam orginała.
2. Nie zmieniałem tych skryptów co są wymienione w instrukcji.
Proszę o szybką pomoc.
Dodatkowo tutaj proszę o powiększenie ikon.
Spoiler:
Kod:
#=============================================================================
#
# ** Asan'Tear Battle System
#
#-----------------------------------------------------------------------------
#
# By Ryex
# V 1.26
#
#-----------------------------------------------------------------------------
#
# Features
#
# * New lay out for the DBS
# * Easy to use battler animation for actors and enemies
# * Animated windows
# * New staus bar with Hp/Sp bars
#
#-----------------------------------------------------------------------------
#
# Instructions
#
# Place in a new script above main then fill out the Configuration.
#
# To use the Animated Battlers Feature simply place the pictures you want
# to use in the Battlers folder they should be named like so
#
# IDLE POSE #the standing there pose that is shown the vast majority of the time
# <Ballter name>.png #or JPG frame 0
# <Ballter name>1.png #or JPG frame 1
# <Ballter name>2.png #or JPG frame 2
# <Ballter name>3.png #or JPG frame 3
#
# and so on for how ever many frames you want for the idle state
# for the other states simply add a suffix befor the frame number like so
#
# ATTACK POSE
# <Ballter name>_atk.png #or JPG frame 0
# <Ballter name>_atk1.png #or JPG frame 1
# <Ballter name>_atk2.png #or JPG frame 2
# <Ballter name>_atk3.png #or JPG frame 3
# ECT.
#
# SKILL POSE
# <Ballter name>_skl.png #or JPG frame 0
# <Ballter name>_skl1.png #or JPG frame 1
# <Ballter name>_skl2.png #or JPG frame 2
# <Ballter name>_skl3.png #or JPG frame 3
# ECT.
#
# ITEM POSE
# <Ballter name>_itm.png #or JPG frame 0
# ECT.
#
# DEFEND POSE
# <Ballter name>_def.png #or JPG frame 0
# ECT.
#
#==============================================================================
# Global indicating that AnTBS is installed
$antbs = true
# To change the icons in the actor command window change the names below
BATTLE_MENU_ICONS[1] = "Attack" #Icon name for the Attack option on the battle menu
BATTLE_MENU_ICONS[2] = "Magic" #Icon name for the Skill option on the battle menu
BATTLE_MENU_ICONS[3] = "Defence"#Icon name for the Defend option on the battle menu
BATTLE_MENU_ICONS[4] = "Item" #Icon name for the Item option on the battle menu
# how many REAL frames that should be skipped before updating the battlers while
# in idle mode, note that using anything below 2 is not recommended and that
# using low values can increase lag dramatically
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
#==============================================================================
# New methods added to Bitmap
#==============================================================================
class Bitmap
def draw_bar_ryex(x, y, w, h, p, c)
gray = Color.new(100, 100, 100)
white = Color.new(255, 255, 255)
fill_rect(x, y, w, h, Color.new(0, 0, 0))
for i in 0...(h - 1)
gr = gray.red * i / (h - 1)
gg = gray.green * i / (h - 1)
gb = gray.blue * i / (h - 1)
fill_rect(x + 1, y + h - i - 1, w - 2, 1, Color.new(gr, gg, gb))
end
for i in 0...(h / 2)
r = c.red * i / (h / 2)
g = c.green * i / (h / 2)
b = c.blue * i / (h / 2)
fill_rect(x + 1, y + h - i - 1, p * (w - 2), 1, Color.new(r, g, b))
end
for i in 0...(h / 2 - 1)
r = c.red + (white.red - c.red) * i / (h / 2 - 1)
g = c.green + (white.green - c.green) * i / (h / 2 - 1)
b = c.blue + (white.blue - c.blue) * i / (h / 2 - 1)
fill_rect(x + 1, y + (h / 2 - 1) - i, p * (w - 2), 1, Color.new(r, g, b))
end
end
end
class Sprite
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias moving_sprite_init initialize
def initialize(viewport = nil)
moving_sprite_init(viewport)
@dest_x, @dest_y = self.x, self.y
@tot_x = @tot_y = 0
end
#--------------------------------------------------------------------------
# * moving? - checks if the window needs moving
#--------------------------------------------------------------------------
def moving?
return self.x != @dest_x || self.y != @dest_y
end
#--------------------------------------------------------------------------
# * Move - prepares variables and sets off the moving process
#--------------------------------------------------------------------------
def move(dest_x, dest_y)
@dest_x = dest_x
@dest_y = dest_y
@tot_x = (dest_x - self.x).abs
@tot_y = (dest_y - self.y).abs
end
#--------------------------------------------------------------------------
# Move Windows - the actual processing of movement
#--------------------------------------------------------------------------
def move_sprite
x = self.x
y = self.y
dist_x = [((@dest_x-x).abs/3.0).ceil, (@tot_x/3.0).ceil].min
dist_y = [((@dest_y-y).abs/3.0).ceil, (@tot_y/3.0).ceil].min
@dest_x > x ? self.x += dist_x : self.x -= dist_x
@dest_y > y ? self.y += dist_y : self.y -= dist_y
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias upd_sprite_move update
def update
move_sprite if moving?
upd_sprite_move
end
#--------------------------------------------------------------------------
# * Get Normal Text Color
#--------------------------------------------------------------------------
def normal_color
return Color.new(255, 255, 255, 255)
end
#--------------------------------------------------------------------------
# * Get Disabled Text Color
#--------------------------------------------------------------------------
def disabled_color
return Color.new(255, 255, 255, 128)
end
#--------------------------------------------------------------------------
# * Get System Text Color
#--------------------------------------------------------------------------
def system_color
return Color.new(192, 224, 255, 255)
end
#--------------------------------------------------------------------------
# * Get Crisis Text Color
#--------------------------------------------------------------------------
def crisis_color
return Color.new(255, 255, 64, 255)
end
#--------------------------------------------------------------------------
# * Get Knockout Text Color
#--------------------------------------------------------------------------
def knockout_color
return Color.new(255, 64, 0)
end
def draw_actor_graphic(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.bitmap.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#--------------------------------------------------------------------------
# * Draw Name
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
self.bitmap.font.color = normal_color
self.bitmap.draw_text(x, y, 120, 32, actor.name)
end
#--------------------------------------------------------------------------
# * Draw Class
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y)
self.bitmap.font.color = normal_color
self.bitmap.draw_text(x, y, 236, 32, actor.class_name)
end
#--------------------------------------------------------------------------
# * Draw Level
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
self.bitmap.font.color = system_color
self.bitmap.draw_text(x, y, 32, 32, "Lv")
self.bitmap.font.color = normal_color
self.bitmap.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
#--------------------------------------------------------------------------
# * Make State Text String for Drawing
# actor : actor
# width : draw spot width
# need_normal : Whether or not [normal] is needed (true / false)
#--------------------------------------------------------------------------
def make_battler_state_text(battler, width, need_normal)
# Get width of brackets
brackets_width = self.bitmap.text_size("[]").width
# Make text string for state names
text = ""
for i in battler.states
if $data_states[i].rating >= 1
if text == ""
text = $data_states[i].name
else
new_text = text + "/" + $data_states[i].name
text_width = self.bitmap.text_size(new_text).width
if text_width > width - brackets_width
break
end
text = new_text
end
end
end
# If text string for state names is empty, make it [normal]
if text == ""
if need_normal
text = "[Normal]"
end
else
# Attach brackets
text = "[" + text + "]"
end
# Return completed text string
return text
end
#--------------------------------------------------------------------------
# * Draw State
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
text = make_battler_state_text(actor, width, true)
self.bitmap.font.color = actor.hp == 0 ? knockout_color : normal_color
self.bitmap.draw_text(x, y, width, 32, text)
end
#--------------------------------------------------------------------------
# * Draw EXP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y)
self.bitmap.font.color = system_color
self.bitmap.draw_text(x, y, 24, 32, "E")
self.bitmap.font.color = normal_color
self.bitmap.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)
self.bitmap.draw_text(x + 108, y, 12, 32, "/", 1)
self.bitmap.draw_text(x + 120, y, 84, 32, actor.next_exp_s)
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw "HP" text string
self.bitmap.font.color = system_color
self.bitmap.draw_text(x, y, 32, 32, $data_system.words.hp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# Draw HP
self.bitmap.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.bitmap.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw MaxHP
if flag
self.bitmap.font.color = normal_color
self.bitmap.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.bitmap.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Draw "SP" text string
self.bitmap.font.color = system_color
self.bitmap.draw_text(x, y, 32, 32, $data_system.words.sp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# Draw SP
self.bitmap.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.bitmap.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# Draw MaxSP
if flag
self.bitmap.font.color = normal_color
self.bitmap.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.bitmap.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
#----------------------------------------------------------------------------
# * Draws a gradiant bar fo the actor's HP
#----------------------------------------------------------------------------
def draw_actor_hp_bar_ryex(x, y, m, actor)
h = 12
p = actor.hp.to_f / actor.maxhp
c = Color.new(255, 0, 0)
self.bitmap.draw_bar_ryex(x, y, m, h, p, c)
end
#----------------------------------------------------------------------------
# * Draws a gradiant bar fo the actor's SP
#----------------------------------------------------------------------------
def draw_actor_sp_bar_ryex(x, y, m, actor)
h = 12
p = actor.sp.to_f / actor.maxsp
c = Color.new(0, 0, 255)
self.bitmap.draw_bar_ryex(x, y, m, h, p, c)
end
#----------------------------------------------------------------------------
# * Draws a gradiant bar fo the actor's EXP
#----------------------------------------------------------------------------
def draw_actor_exp_bar_ryex(x, y, m, actor)
h = 12
p = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
c = Color.new(255, 255, 0)
self.bitmap.draw_bar_ryex(x, y, m, h, p, c)
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp_Ryex(actor, x, y, width = 144)
# Draw "HP" text string
self.bitmap.font.color = Color.new(0, 0, 0, 255)
self.bitmap.draw_text(x-1, y-1, 32, 32, $data_system.words.hp)
self.bitmap.draw_text(x+1, y-1, 32, 32, $data_system.words.hp)
self.bitmap.draw_text(x-1, y+1, 32, 32, $data_system.words.hp)
self.bitmap.draw_text(x+1, y+1, 32, 32, $data_system.words.hp)
self.bitmap.font.color = system_color
self.bitmap.draw_text(x, y, 32, 32, $data_system.words.hp)
hp_x = x + width - 108
# Draw HP
self.bitmap.font.color = Color.new(0, 0, 0, 255)
self.bitmap.draw_text(hp_x + 60 - 1, y - 1, 48, 32, actor.hp.to_s, 2)
self.bitmap.draw_text(hp_x + 60 + 1, y - 1, 48, 32, actor.hp.to_s, 2)
self.bitmap.draw_text(hp_x + 60 - 1, y + 1, 48, 32, actor.hp.to_s, 2)
self.bitmap.draw_text(hp_x + 60 + 1, y + 1, 48, 32, actor.hp.to_s, 2)
self.bitmap.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.bitmap.draw_text(hp_x + 60, y, 48, 32, actor.hp.to_s, 2)
end
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp_Ryex(actor, x, y, width = 144)
# Draw "SP" text string
self.bitmap.font.color = Color.new(0, 0, 0, 255)
self.bitmap.draw_text(x - 1, y - 1, 32, 32, $data_system.words.sp)
self.bitmap.draw_text(x + 1, y - 1, 32, 32, $data_system.words.sp)
self.bitmap.draw_text(x - 1, y + 1, 32, 32, $data_system.words.sp)
self.bitmap.draw_text(x + 1, y + 1, 32, 32, $data_system.words.sp)
self.bitmap.font.color = system_color
self.bitmap.draw_text(x, y, 32, 32, $data_system.words.sp)
sp_x = x + width - 108
# Draw SP
self.bitmap.font.color = Color.new(0, 0, 0, 255)
self.bitmap.draw_text(sp_x + 60 - 1, y - 1, 48, 32, actor.sp.to_s, 2)
self.bitmap.draw_text(sp_x + 60 + 1, y - 1, 48, 32, actor.sp.to_s, 2)
self.bitmap.draw_text(sp_x + 60 - 1, y + 1, 48, 32, actor.sp.to_s, 2)
self.bitmap.draw_text(sp_x + 60 + 1, y + 1, 48, 32, actor.sp.to_s, 2)
self.bitmap.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.bitmap.draw_text(sp_x + 60, y, 48, 32, actor.sp.to_s, 2)
end
#--------------------------------------------------------------------------
# * Get Up Text Color
#--------------------------------------------------------------------------
def up_color
return Color.new(0, 255, 0 )
end
#--------------------------------------------------------------------------
# * Get Down Text Color
#--------------------------------------------------------------------------
def down_color
return Color.new(255, 0, 0)
end
end
#==============================================================================
# Moving windows (Alpha 2)
# by Fantasist
#------------------------------------------------------------------------------
# This adds the 'move' function to windows. Syntax is
# @window.move(dest_x, dest_y)
# where
# @window :The window you want to move
# dest_x :Destination x coordinate
# dest_y :Destination y coordinate
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias moving_win_base_init initialize
def initialize(x, y, w, h)
moving_win_base_init(x, y, w, h)
@dest_x, @dest_y = x, y
@tot_x = @tot_y = 0
end
#--------------------------------------------------------------------------
# * moving? - checks if the window needs moving
#--------------------------------------------------------------------------
def moving?
return self.x != @dest_x || self.y != @dest_y
end
#--------------------------------------------------------------------------
# * Move - prepares variables and sets off the moving process
#--------------------------------------------------------------------------
def move(dest_x, dest_y)
@dest_x = dest_x
@dest_y = dest_y
@tot_x = (dest_x - self.x).abs
@tot_y = (dest_y - self.y).abs
end
#--------------------------------------------------------------------------
# Move Windows - the actual processing of movement
#--------------------------------------------------------------------------
def move_wins
x = self.x
y = self.y
dist_x = [((@dest_x-x).abs/3.0).ceil, (@tot_x/3.0).ceil].min
dist_y = [((@dest_y-y).abs/3.0).ceil, (@tot_y/3.0).ceil].min
@dest_x > x ? self.x += dist_x : self.x -= dist_x
@dest_y > y ? self.y += dist_y : self.y -= dist_y
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias upd_win_base_move update
def update
upd_win_base_move
move_wins if moving?
end
end
class Sprite_BattleStatus_Ryex_AnTeBS < RPG::Sprite
attr_accessor :actor
attr_accessor :level_up_flag
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y, actor_id, recreate_flag = false)
super(nil)
self.x = x
self.y = y
self.bitmap = Bitmap.new(150, 74)
@level_up_flag = false
@actor = $game_party.actors[actor_id]
@box_number = actor_id
refresh
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
super
end
#--------------------------------------------------------------------------
# * Set Level Up Flag
# actor_index : actor index
#--------------------------------------------------------------------------
def level_up
@level_up_flag = true
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear
draw_background
self.bitmap.font.name, self.bitmap.font.size = RyexCFG::BATTLE_NAMES_FONT, 22
self.bitmap.font.italic, self.bitmap.font.bold = true, true
draw_actor_name(@actor, 15, 0)
self.bitmap.font.italic, self.bitmap.font.bold = false, false
self.bitmap.font.name, self.bitmap.font.size = RyexCFG::BATTLE_HP_SP_FONT, 20
draw_actor_hp_bar_ryex(15, 24, 120, @actor)
draw_actor_hp_Ryex(@actor, 15, 14, 120)
draw_actor_sp_bar_ryex(15, 38, 120, @actor)
draw_actor_sp_Ryex(@actor, 15, 28, 120)
if @level_up_flag
self.bitmap.font.color = normal_color
self.bitmap.draw_text(15, 42, 120, 32, 'LEVEL UP!')
else
draw_actor_state(@actor, 15, 42)
end
self.bitmap.font.name, self.bitmap.font.size = 'Arial', 22
end
#--------------------------------------------------------------------------
# * Draw Background
#--------------------------------------------------------------------------
def draw_background
back_color = Color.new(75, 75, 75)
74.times do |i|
bcr = back_color.red * i / 74
bcg = back_color.green * i / 74
bcb = back_color.blue * i / 74
self.bitmap.fill_rect(0, 74 - i - 1, 150, 1, Color.new(bcr, bcg, bcb, 200))
end
case @box_number
when 0
if $game_party.actors.size == 1
self.bitmap.fill_rect(149, 0, 1, 74, Color.new(0, 0, 0, 200))
end
self.bitmap.fill_rect(0, 0, 1, 74, Color.new(0, 0, 0, 200))
when ($game_party.actors.size - 1)
self.bitmap.fill_rect(149, 0, 1, 74, Color.new(0, 0, 0, 200))
end
self.bitmap.fill_rect(0, 0, 150, 1, Color.new(0, 0, 0, 200))
self.bitmap.fill_rect(0, 73, 150, 1, Color.new(0, 0, 0, 200))
end
end
class Battle_Status_Bar_Ryex_AnTeBS
attr_accessor :actor_status_boxs, :level_up_flags
def initialize(x, y)
@actor_status_boxs = []
@level_up_flags = []
@party_size = $game_party.actors.size
(0...$game_party.actors.size).each do |i|
@actor_status_boxs.push(Sprite_BattleStatus_Ryex_AnTeBS.new(x + (i * 150), y, i))
end
@actor_status_boxs.each do |status_box|
status_box.z = 300
end
@actor_status_boxs.each_index do |i|
@level_up_flags[i] = @actor_status_boxs[i].level_up_flag
end
end
def level_up(actor_index)
@actor_status_boxs[actor_index].level_up
@level_up_flags[actor_index] = @actor_status_boxs[actor_index].level_up_flag
end
def dispose
@actor_status_boxs.each do |status_box|
status_box.dispose
end
end
def refresh(actor_index = nil)
if @party_size != $game_party.actors.size
@actor_status_boxs.each do |status_box|
status_box.dispose
end
@actor_status_boxs = []
@party_size = $game_party.actors.size
(0...$game_party.actors.size).each do |i|
@actor_status_boxs.push(Sprite_BattleStatus_Ryex_AnTeBS.new(0 + (i * 150), 0, i, true))
end
else
(0...$game_party.actors.size).each do |i|
actor = $game_party.actors[i]
@actor_status_boxs[i].actor = actor unless actor == nil
end
unless actor_index == nil
@actor_status_boxs[actor_index].refresh
else
@actor_status_boxs.each do |status_box|
status_box.refresh
end
end
end
end
def update
@actor_status_boxs.each_index do |i|
@actor_status_boxs[i].level_up_flag = @level_up_flags[i]
end
@actor_status_boxs.each do |status_box|
status_box.update
end
end
def move(x, y)
(0...$game_party.actors.size).each do |i|
@actor_status_boxs[i].move(x + (i * 150), y)
end
end
def x
return @actor_status_boxs[0].x
end
def y
return @actor_status_boxs[0].y
end
end
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
# This window displays items in possession on the item and battle screens.
#==============================================================================
class Window_Item_Battle_Ryex < Window_Item
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super
self.x, self.y, self.width, self.height, self.z = -305, 96, 304, 320, 300
@column_max = 1
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 224, y, 16, 32, ":", 1)
self.contents.draw_text(x + 240, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill_Battle_Ryex < Window_Skill
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super
self.x, self.y, self.width, self.height, self.z = -305, 96, 304, 320, 300
@actor = actor
@column_max = 1
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 200, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help_Battle_Ryex < Window_Help
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super
end
#--------------------------------------------------------------------------
# * Set Text
# text : text string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
super(text, align)
self.move(self.x, 416)
end
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
def set_actor(actor)
super(actor)
self.move(self.x, 416)
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# ** Window_HCommand_WI Modified from Blizzard's Window_HCommand By Ryex
#------------------------------------------------------------------------------
# This window deals with general command choices, but the display is
# horizontal.
#==============================================================================
class Window_HCommand_WI_Battle < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command text string array
#--------------------------------------------------------------------------
def initialize(width, commands)
super(0, 0, width, 64)
self.width, self.height = width, 64
@commands = commands
@item_max = commands.size
@column_max = commands.size
self.contents = Bitmap.new( @item_max * 152, self.height - 32)
refresh
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# color : text color
#--------------------------------------------------------------------------
def draw_item(i, color)
self.contents.font.color = color
w = 152
x = i * 152
rect = Rect.new(x, 0, w, 32)
#self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[i][1], 1)
self.contents.blt(x + 4, 4, RPG::Cache.icon(@commands[i][0]),
Rect.new(0, 0, 24, 24))
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = 152
# Calculate cursor coordinates
x = @index * 152 - self.ox
# Update cursor rectangle
self.cursor_rect.set(x, 0, cursor_width, 32)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If cursor is movable
if self.active and @item_max > 0 and @index >= 0
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# If column count is 2 or more, and cursor position is closer to front
# than (item count -1)
if @column_max >= 2 and @index < @item_max - 1
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# If column count is 2 or more, and cursor position is more back than 0
if @column_max >= 2 and @index > 0
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Update Help Window
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(@commands[self.index][1])
end
end
class Spriteset_Battle
def update
if @viewport0 == nil
@weather.dispose
@viewport0 = Viewport.new(0, 0, 640, 480)
@viewport0.z = @viewport1.z - 1
@weather = RPG::Weather.new(@viewport2)
end
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
@battleback_sprite.dispose
@battleback_sprite = Sprite.new(@viewport0)
@battleback_sprite.bitmap = Bitmap.new(640, 480)
@battleback_sprite.bitmap.stretch_blt(Rect.new(0, 0, 640, 480),
RPG::Cache.battleback(@battleback_name), Rect.new(0, 0, 640, 320))
end
# Update actor sprite contents (corresponds with actor switching)
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
# If battleback file name is different from current one
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 320)
end
# Update battler sprites
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
# Update weather graphic
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
# Update picture sprites
for sprite in @picture_sprites
sprite.update
end
# Update timer sprite
@timer_sprite.update
# Set screen color tone and shake position
@viewport2.tone = $game_screen.tone
@viewport2.ox = $game_screen.shake
@viewport0.ox = $game_screen.shake
@viewport1.ox = $game_screen.shake
# Set screen flash color
@viewport4.color = $game_screen.flash_color
# Update viewports
@viewport1.update
@viewport2.update
@viewport4.update
@viewport0.update
end
alias ryex_AnTBS_SpBattle_dispose_later dispose
def dispose
ryex_AnTBS_SpBattle_dispose_later
@viewport0.dispose
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Initialize each kind of temporary battle data
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# Initialize battle event interpreter
$game_system.battle_interpreter.setup(nil, 0)
# Prepare troop
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# Make actor command window
commands = [[RyexCFG::BATTLE_MENU_ICONS[1], $data_system.words.attack],
[RyexCFG::BATTLE_MENU_ICONS[2], $data_system.words.skill],
[RyexCFG::BATTLE_MENU_ICONS[3], $data_system.words.guard],
[RyexCFG::BATTLE_MENU_ICONS[4], $data_system.words.item]]
@actor_command_window = Window_HCommand_WI_Battle.new(640, commands)
@actor_command_window.y = 481
@actor_command_window.z = 300
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
# Make other windows
@party_command_window = Window_PartyCommand.new
@party_command_window.y, @party_command_window.z = 481, 300
@party_command_window.visible = true
@help_window = Window_Help_Battle_Ryex.new
@help_window.y, @help_window.back_opacity, @help_window.z = 481, 160, 400
@help_window.visible = true
@status_window = Battle_Status_Bar_Ryex_AnTeBS.new(20, -75)
@message_window = Window_Message.new
# Make sprite set
@spriteset = Spriteset_Battle.new
# Initialize wait count
@wait_count = 0
# Execute transition
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# Start pre-battle phase
start_phase1
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Refresh map
$game_map.refresh
# Prepare for transition
Graphics.freeze
# Dispose of windows
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# Dispose of sprite set
@spriteset.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
# If switching from battle test to any screen other than game over screen
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If battle event is running
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
# If not after battle phase
if @phase != 5
# Refresh status window
@status_window.refresh
end
end
end
# Update system (timer) and screen
$game_system.update
$game_screen.update
# If timer has reached 0
if $game_system.timer_working and $game_system.timer == 0
# Abort battle
$game_temp.battle_abort = true
end
# Update windows
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
# Update sprite set
@spriteset.update
# If transition is processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If message window is showing
if $game_temp.message_window_showing
return
end
# If effect is showing
if @spriteset.effect?
return
end
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Switch to title screen
$scene = Scene_Title.new
return
end
# If battle is aborted
if $game_temp.battle_abort
# Return to BGM used before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Battle ends
battle_end(1)
return
end
# If waiting
if @wait_count > 0
# Decrease wait count
@wait_count -= 1
return
end
# If battler forcing an action doesn't exist,
# and battle event is running
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# Branch according to phase
case @phase
when 1 # pre-battle phase
update_phase1
when 2 # party command phase
update_phase2
when 3 # actor command phase
update_phase3
when 4 # main phase
update_phase4
when 5 # after battle phase
update_phase5
end
end
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
def start_phase2
# Shift to phase 2
@phase = 2
# Set actor to non-selecting
@actor_index = -1
@active_battler = nil
# move windows into position
@status_window.move(@status_window.x, 0)
@party_command_window.move(@party_command_window.x, 416)
# Enable party command window
@party_command_window.active = true
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.move(@actor_command_window.x, 481)
#@info_window.move(@info_window.x, 481)
# Clear main phase flag
$game_temp.battle_main_phase = false
# Clear all party member actions
$game_party.clear_actions
# If impossible to input command
unless $game_party.inputable?
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor
#--------------------------------------------------------------------------
def phase3_next_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
@status_window.actor_status_boxs[@actor_index].blink_off
end
# If last actor
if @actor_index == $game_party.actors.size-1
# Start main phase
start_phase4
return
end
# Advance actor index
@actor_index += 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@status_window.actor_status_boxs[@actor_index].blink_on
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Go to Command Input of Previous Actor
#--------------------------------------------------------------------------
def phase3_prior_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
@status_window.actor_status_boxs[@actor_index].blink_off
end
&nb
Pzdr.
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Pon 24 Maj, 2010 14:29
Po prostu są za duże... nawet jeśli wprowadziłeś korekty, to w Window_Item nie powinny być większe niż 32, bo taki jest rozmiar Window_Selecatble.
Możesz ewentualnie pousuwać te +4 w każdej linijce podanej w instrukcji. Wtedy ikonka nieco się podniesie, ale i tak w niewielkim stopniu będzie ją ucinać.
Dobra. A czy mógłbym prosić o przerobienie tego skryptu? Można powiększyć te okno dolne z komendami. ten skrypt jest mi bardzo potrzebny.
Jeszcze jedno. Czy mógłby ktoś napisać skrypt na nowy ekwipunek czy coś, aby działały, bo nie chcę ich zmniejszać.
Pzdr.
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Istnieje coś takiego jak skalowanie obrazu w GIMP'ie poprostu wrzuć ikone do gimpa na pasku zadań daj obraz skaluj obraz i daj sobie 24x24 wymiary domyślne ikon i zapisz zmiany pomogłem daj pomógł
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Gimp - obraz - skaluj obraz - wpisujesz wymiary 32 na 32 i OK ;p i już masz ikony gotowe, zrobiłbym ci ale nie mam dostępu do kompa (tzn szlaban) teraz siadłem na 5 min póki mogę
________________________ Kolekcjonuję "Pomógł". Jeżeli ci pomogłem i chcesz wzbogacić moją kolekcję, kliknij "Pomógł".
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Sro 02 Cze, 2010 16:59
Czeliosss, czegoś tu nie rozumiem. Starasz się tworzyć właśnie skrypty, a nie potrafisz znaleźć fragmentu skryptu odpowiadającego za wielkość ikon?! Postępuj tak, jak w instrukcji z pierwszego posta.
Znajdź w klasie 'Multi-slot script : Windows' trzy razy:
Kod:
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
i zamień na:
Kod:
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 48, 48))
Sprawdzę czy działa jak zakończy się konkurs, teraz nad tym się męczę.
Cytat:
Starasz się tworzyć właśnie skrypty, a nie potrafisz znaleźć fragmentu skryptu odpowiadającego za wielkość ikon?!
Medium nie jestem i nie wiem z czym może się gryźć, ale na to można było wpaść na logikę.
Pzdr.
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum