赞 | 0 |
VIP | 1 |
好人卡 | 0 |
积分 | 1 |
经验 | 900 |
最后登录 | 2013-8-7 |
在线时间 | 15 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 15 小时
- 注册时间
- 2011-3-3
- 帖子
- 19
|
- class Sprite_Character < Sprite_Base
- #--------------------------------------------------------------------------
- # ● 判定图形是否在视野内
- #--------------------------------------------------------------------------
- def in_view?
- add_x = (self.width-32)*4 + 256
- add_y = self.height*8
- begin_x = $game_map.display_x - add_x
- begin_y = $game_map.display_y - add_y
- end_x = $game_map.display_x + 4352 + add_x
- end_y = $game_map.display_y + 3328 + add_y
- limit_x = $game_map.width * 256 - 256 + add_x
- limit_y = $game_map.height * 256 - 256 + add_y
- char_x = @character.real_x
- char_y = @character.real_y
- if end_x <= limit_x
- return false if char_x < begin_x or char_x > end_x
- end
- if end_y <= limit_y
- return false if char_y < begin_y or char_y > end_y
- end
- if end_x > limit_x and end_y > limit_y
- return false if char_x < begin_x and char_x > end_x - limit_x
- return false if char_y < begin_y and char_y > end_y - limit_y
- end
- return true
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- if in_view?
- update_bitmap
- self.visible = (not @character.transparent)
- update_src_rect
- self.x = @character.screen_x
- self.y = @character.screen_y
- self.z = @character.screen_z
- self.opacity = @character.opacity
- self.blend_type = @character.blend_type
- self.bush_depth = @character.bush_depth
- end
- update_balloon
- if @character.animation_id != 0
- animation = $data_animations[@character.animation_id]
- start_animation(animation)
- @character.animation_id = 0
- end
- if @character.balloon_id != 0
- @balloon_id = @character.balloon_id
- start_balloon
- @character.balloon_id = 0
- end
- end
- end
复制代码 你是说这货?
p.s. 出处已忘,知道的可以提醒一声~ |
评分
-
查看全部评分
|