Project1
标题: 人物阴影问题 [打印本页]
作者: 仙芋 时间: 2012-8-12 17:44
标题: 人物阴影问题
人物阴影问题
用了脚本, 人物阴影没问题
可是连NPC(事件)也有阴影
如何删除事件阴影?
以下是脚本:- class Sprite_Character < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_accessor :character # 角色
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # viewport : 查看端口
- # character : 角色 (Game_Character)
- #--------------------------------------------------------------------------
- def initialize(viewport,character = nil)
- super(viewport)
- @character = character
- @v = RPG::Sprite.new(viewport)
- update
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 元件 ID、文件名、色相与现在的情况存在差异的情况下
- id = $game_map.map_id
- name = $mapname[id].name
-
- if @tile_id != @character.tile_id or
- @character_name != @character.character_name or
- @character_hue != @character.character_hue
- # 记忆元件 ID 与文件名、色相
- @tile_id = @character.tile_id
- @character_name = @character.character_name
- @character_hue = @character.character_hue
- # 元件 ID 为有效值的情况下
- if @tile_id >= 384
- self.bitmap = RPG::Cache.tile($game_map.tileset_name,
- @tile_id, @character.character_hue)
- self.src_rect.set(0, 0, 32, 32)
- self.ox = 16
- self.oy = 32
- # 元件 ID 为无效值的情况下
- else
- self.bitmap = RPG::Cache.character(@character.character_name,
- @character.character_hue)
- @v.bitmap = RPG::Cache.character(@character.character_name,
- @character.character_hue)
- @v.flash(Color.new(0, 0, 0, 255), 1)
- @v.angle = 0
- @v.mirror = true
- #@v.opacity = 179
- @cw = self.bitmap.width / $c3_每一步的帧数
- if $c3_总共可用的方向数==4
- @ch = self.bitmap.height / 4
- else
- @ch = self.bitmap.height / 8
- end
- self.ox = @cw / 2
- self.oy = @ch
- @v.ox = @cw / 2
- @v.oy = @ch
- end
- end
- # 设置可视状态
- self.visible = (not @character.transparent)
- @v.visible = (not @character.transparent)
- # 图形是角色的情况下
- if @tile_id == 0
- # 设置传送目标的矩形
- sx = @character.pattern * @cw
- if $c3_总共可用的方向数==8
- case @character.direction
- when 2
- sy = 0 * @ch
- when 4
- sy = 1 * @ch
- when 6
- sy = 2 * @ch
- when 8
- sy = 3 * @ch
- when 1
- sy = 4 * @ch
- when 3
- sy = 5 * @ch
- when 7
- sy = 6 * @ch
- when 9
- sy = 7 * @ch
- end
- else
- sy = (@character.direction - 2) / 2 * @ch
- end
- self.src_rect.set(sx, sy, @cw, @ch)
- @v.src_rect.set(sx, sy, @cw, @ch)
- end
复制代码