赞 | 4 |
VIP | 17 |
好人卡 | 62 |
积分 | 14 |
经验 | 52410 |
最后登录 | 2023-8-24 |
在线时间 | 962 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1384
- 在线时间
- 962 小时
- 注册时间
- 2012-4-30
- 帖子
- 1475
|
本帖最后由 铅笔描绘的思念 于 2012-7-23 13:41 编辑
httXP的行走图也是4x4的所以- #########################
- # XP 行走图显示法 v1.0 #
- # #
- # BY 诡异の猫 #
- #########################
- class Game_Character
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- alias old_ini initialize
- def initialize
- old_ini
- @original_pattern = 2
- end
- #--------------------------------------------------------------------------
- # ● 矫正姿势
- #--------------------------------------------------------------------------
- def straighten
- @pattern = 2 if @walk_anime or @step_anime
- @anime_count = 0
- end
- end
- class Sprite_Character < Sprite_Base
- #--------------------------------------------------------------------------
- # ● 更新传送源的位图
- #--------------------------------------------------------------------------
- def update_bitmap
- if @tile_id != @character.tile_id or
- @character_name != @character.character_name or
- @character_index != @character.character_index
- @tile_id = @character.tile_id
- @character_name = @character.character_name
- @character_index = @character.character_index
- 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)
- sign = @character_name[/^[\!\$]./]
- if sign != nil and sign.include?(')
- @cw = bitmap.width / 4
- @ch = bitmap.height / 4
- else
- @cw = bitmap.width / 16
- @ch = bitmap.height / 8
- end
- self.ox = @cw / 2
- self.oy = @ch
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新传送源矩形
- #--------------------------------------------------------------------------
- def update_src_rect
- if @tile_id == 0
- index = @character.character_index
- pattern = @character.pattern < 4 ? @character.pattern : 1
- sx = (index % 4 * 4 + pattern) * @cw
- sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
- self.src_rect.set(sx, sy, @cw, @ch)
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|