赞 | 11 |
VIP | 302 |
好人卡 | 162 |
积分 | 62 |
经验 | 108302 |
最后登录 | 2024-11-21 |
在线时间 | 6593 小时 |
Lv4.逐梦者 醉啸 长风万里
- 梦石
- 0
- 星屑
- 6167
- 在线时间
- 6593 小时
- 注册时间
- 2007-12-16
- 帖子
- 4501
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
不多说了,上图
BUG:每次修改完后一定要改回来否则会一直这样- #========================================
- # 改变行走图色调
- # 原作BY: Nechigawara Sanzenin
- # 提供BY:企鹅达达
- # 翻译BY:仲秋启明
- #========================================
- #使用方法:
- #事件注释中输入:[rX][gX][bX][alX][hueX]
- #[rX] 红 ( -255 to 255 )
- #[gX] 绿 ( -255 to 255 )
- #[bX] 蓝 ( -255 to 255 )
- #[alX] Alpha通道 ( 0 to 255 )
- #[hueX] 色调 ( 0 to 360 )
- #配合RGB颜色设置
- #BUG:每次修改完后一定要改回来否则会一直这样
- #========================================
- module Cache
- def self.character(filename , hue=0)
- load_bitmap("Graphics/Characters/", filename , hue)
- end
- end
- class Game_Character
- attr_accessor :tone
- attr_accessor :hue
- #--------------------------------------------------------------------------
- # - 读取
- #--------------------------------------------------------------------------
- alias inc_initialize initialize
- def initialize
- inc_initialize
- @tone = [0,0,0,0]
- @hue = 0
- end
- end
- class Game_Event < Game_Character
- alias inc_update update
- def update
- for i in [email protected]
- next if @list[i].code != 108
- # 红
- if @list[i].parameters[0].include?("[r")
- text = @list[i].parameters[0].scan(/\[r([-,0-9]+)\]/)
- red = $1.to_i
- if red > 255
- red = 255
- elsif red < -255
- red = -255
- end
- @tone[0] = red
- end
- # 绿
- if @list[i].parameters[0].include?("[g")
- text = @list[i].parameters[0].scan(/\[g([-,0-9]+)\]/)
- green = $1.to_i
- if green > 255
- green = 255
- elsif green < -255
- green = -255
- end
- @tone[1] = green
- end
- # 蓝
- if @list[i].parameters[0].include?("[b")
- text = @list[i].parameters[0].scan(/\[b([-,0-9]+)\]/)
- blue = $1.to_i
- if blue > 255
- blue = 255
- elsif blue < -255
- blue = -255
- end
- @tone[2] = blue
- end
- # Alpha
- if @list[i].parameters[0].include?("[al")
- text = @list[i].parameters[0].scan(/\[al([0-9]+)\]/)
- alpha = $1.to_i
- if alpha > 255
- alpha = 255
- elsif alpha < 0
- alpha = 0
- end
- @tone[3] = alpha
- end
- # 色调
- if @list[i].parameters[0].include?("[hue")
- text = @list[i].parameters[0].scan(/\[hue([0-9]+)\]/)
- hue = $1.to_i
- if hue > 360
- hue = 360
- elsif hue < 0
- hue = 0
- end
- @hue = hue
- end
- end
- inc_update
- end
- end
- class Sprite_Character < Sprite_Base
- #--------------------------------------------------------------------------
- # - 刷新
- #--------------------------------------------------------------------------
- def update_bitmap
- @character.update
- self.tone.set(@character.tone[0],@character.tone[1],@character.tone[2],@character.tone[3])
- if @tile_id != @character.tile_id or
- @character_name != @character.character_name or
- @character_index != @character.character_index or
- @hue != @character.hue
- @tile_id = @character.tile_id
- @character_name = @character.character_name
- @character_index = @character.character_index
- @hue = @character.hue
- if @tile_id > 0
- sx = (@tile_id / 128 % 2 * 8 + @tile_id % 8) * 32;
- sy = @tile_id % 256 / 8 % 16 * 32;
- self.bitmap = tileset_bitmap(@tile_id)
- self.src_rect.set(sx, sy, 32, 32)
- self.ox = 16
- self.oy = 32
- else
- self.bitmap = Cache.character(@character_name,@character.hue)
- 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
- self.ox = @cw / 2
- self.oy = @ch
- end
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|