end
class Scene_Battle
include Scene_BattleName
end
class Sprite_Battler
include Scene_BattleName
end
上面的图片显示太过繁琐如何改成下面那样,直接简化显示
class Window_BabyFace < Window_Base
def initialize
super(180-32, 20-32, 150+64, 220+64)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@bitmap_index = 0
@rect = Rect.new(0, 0, 0, 0)
end
def refresh(actor)
self.contents.clear
return if actor.nil? or BattlerName_Actor[actor.name].nil?
if @id != actor.id or @face != actor.face
@id = actor.id
@face = actor.face
@bitmap_index = 0
str = BattlerName_Actor[actor.name][actor.face]
@index = [*str.split("-")[0].to_i..str.split("-")[1].to_i]
end
bitmap = Bitmap.new("Graphics/Battlers/#{actor.name}/敌/#{actor.face}/" +
sprintf("%d",@index[@bitmap_index]))
self.contents.blt(-55, -45, bitmap, @rect.set(0, 0, bitmap.width, bitmap.height))
@bitmap_index += 1
if @bitmap_index >= @index.size
@bitmap_index = 0
if rand(100) < 10
ar = BattlerName_Actor[actor.name].keys
actor.face = ar[rand(ar.size)]
end
end
end
end