赞 | 0 |
VIP | 17 |
好人卡 | 0 |
积分 | 1 |
经验 | 1022914 |
最后登录 | 2017-2-4 |
在线时间 | 10 小时 |
Lv1.梦旅人 月下可怜人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 10 小时
- 注册时间
- 2005-11-23
- 帖子
- 4085

|
覆盖Window_MenuStatus类,仅是范例。
- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化目标
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 480, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor_img = Array.new
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- @actor_img.push Sprite.new
- bit = RPG::Cache.character(actor.character_name, actor.character_hue)
- cw = bit.width / 4
- ch = bit.height / 4
- src_rect = Rect.new(0, 0, cw, ch)
- @actor_img[i].bitmap = Bitmap.new(cw,ch)
- @actor_img[i].bitmap.blt(0, 0, bit, Rect.new(0,0,cw,ch))
- @actor_img[i].x = 122 + 64
- @actor_img[i].y = 48 + i * 116
- @actor_img[i].z = self.z + 1
- end
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- img_update
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 116
- actor = $game_party.actors[i]
- #draw_actor_graphic(actor, x - 40, y + 80)
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x, y + 32)
- draw_actor_state(actor, x + 90, y + 32)
- draw_actor_exp(actor, x, y + 64)
- draw_actor_hp(actor, x + 236, y + 32)
- draw_actor_sp(actor, x + 236, y + 64)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- img_update
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
- end
- end
-
- def img_update
- for i in 0...$game_party.actors.size
- if i == @index
- @actor_img[i].tone.gray = 0
- else
- @actor_img[i].tone.gray = 255
- end
- end
- end
-
- def dispose
- super
- @actor_img.each{|i| i.dispose}
- end
-
- end
复制代码 |
|