|
- ####################################################
- # Game_Character 中在定义实例变量中添加
- attr_accessor :switch # 开关
- attr_accessor :gender # 性别
- attr_accessor :acce1 # acce1 ID
- attr_accessor :acce2 # acce2 ID
- attr_accessor :body # body ID
- attr_accessor :hair # hair ID
- attr_accessor :hairop # hairop ID
- attr_accessor :mante # manta ID
- attr_accessor :option # option ID
- ####################################################
复制代码- # Game_Character 中在定义实例变量中添加
- ###############################
- # 初始化中添加
- @switch = false
- @gender = "ym" # ym 为男性
- @acce1 = ""
- @acce2 = ""
- @body = ""
- @hair = ""
- @hairop = ""
- @mante = ""
- @option = ""
- ###############################
复制代码
Game_event (事件也要换装。。。所以要改)
Game_Event的初始化里添加- #############################
- temp = @event.name.split('@')
- @switch = eval(temp[1])
- @gender = temp[2] # ym 为男性
- @acce1 = temp[3]
- @acce2 = temp[4]
- @body = temp[5]
- @hair = temp[6]
- @hairop = temp[7]
- @mante = temp[8]
- @option = temp[9]
- temp.clear
- temp = nil
- #############################
复制代码
Sprite_Character 是图片。。。不能错过
初始化里加这些。。。。一定要在update的前一句加,不要改变地方
- ########################################################
- @c = Bitmap.new(96,128)
- if character.switch
- path = "character/image/" + character.gender + "/"
- if character.option != ""
- p = path + "option/back_" + character.gender + "/" + character.option + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.acce1 != ""
- p = path + "acce1/back_" + character.gender + "/" + character.acce1 + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.hairop != ""
- p = path + "hairop/back_" + character.gender + "/" + character.hairop + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.hair != ""
- p = path + "hair/back_" + character.gender + "/" + character.hair + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.mante != ""
- p = path + "mante/back_" + character.gender + "/" + character.mante + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.acce2 != ""
- p = path + "acce2/back_" + character.gender + "/" + character.acce2 + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.body != ""
- p = path + "body/" + character.body + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- else
- p = path + "body.png"
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- else
- p = path + "body.png"
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- if character.hair != ""
- p = path + "hair/front_" + character.gender + "/" + character.hair + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- else
- p = path + "hair.png"
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- else
- p = path + "hair.png"
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- if character.acce2 != ""
- p = path + "acce2/middle_" + character.gender + "/" + character.acce2 + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.mante != ""
- p = path + "mante/front_" + character.gender + "/" + character.mante + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.acce1 != ""
- p = path + "acce1/front_" + character.gender + "/" + character.acce1 + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.hair != ""
- p = path + "hair/top_" + character.gender + "/" + character.hair + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.acce2 != ""
- p = path + "acce2/front_" + character.gender + "/" + character.acce2 + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.hairop != ""
- p = path + "hairop/front_" + character.gender + "/" + character.hairop + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.acce1 != ""
- p = path + "acce1/top_" + character.gender + "/" + character.acce1 + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- if character.option != ""
- p = path + "option/front_" + character.gender + "/" + character.option + ".png"
- if File.exist?(p)
- temp = Bitmap.new(p)
- @c.blt(0,0,temp,Rect.new(0,0,96,128))
- temp.dispose
- end
- end
- end
- #########################################################################
复制代码
找到这个地方
#--------------------------------------------------------------------------
# ● 更新传送源的位图
#--------------------------------------------------------------------------
def update_bitmap
将下边的东西搞掉。。。。
self.bitmap = Cache.character(@character_name)
sign = @character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
@cw = bitmap.width / 3
@ch = bitmap.height / 4
else
@cw = bitmap.width / 12
@ch = bitmap.height / 8
end
替换成
- #############################################
- if @character.switch
- self.bitmap = @c
- @cw = bitmap.width / 3
- @ch = bitmap.height / 4
- #############################################
- else
- self.bitmap = Cache.character(@character_name)
- sign = @character_name[/^[\!\$]./]
- if sign != nil and sign.include?('$')
- @cw = bitmap.width / 3
- @ch = bitmap.height / 4
- else
- @cw = bitmap.width / 12
- @ch = bitmap.height / 8
- end
- end
复制代码
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
中添加一个释放的东西
一定要在super前面加
完毕。。。
范例的说明:
ym ym1 两个压缩包解开之后放入工程那个包里
character/image/ym文件夹中 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|