赞 | 0 |
VIP | 186 |
好人卡 | 0 |
积分 | 1 |
经验 | 5829 |
最后登录 | 2012-12-21 |
在线时间 | 83 小时 |
Lv1.梦旅人 龙皇
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 83 小时
- 注册时间
- 2007-8-8
- 帖子
- 2956
|
- #==============================================================================
- # ■ Window_Skill
- #------------------------------------------------------------------------------
- # 技能畫面、戰鬥畫面、顯示可以使用的技能的瀏覽視窗。
- #==============================================================================
- class Window_Skill < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化物件
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 128, 640, 352)
- @actor = actor
- @column_max = 1
- refresh
- self.index = 0
- # 戰鬥中的情況下將視窗移到中央並將視窗半透明化
- if $game_temp.in_battle
- self.y = 64
- self.height = 256
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- # ● 獲取技能
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- if skill != nil
- @data.push(skill)
- end
- end
- # 如果項目數值不是 0 就產生點陣圖、重新描繪全部項目
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描繪項目
- # index : 項目編號
- #--------------------------------------------------------------------------
- def draw_item(index)
- skill = @data[index]
- if @actor.skill_can_use?(skill.id)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- x = 4
- y = index * 32
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(skill.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
- self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
- self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 更新說明文字
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.skill == nil ? "" : self.skill.description)
- end
- end
复制代码
换句话说,就是在Window_Skill脚本中
大约在66行的地方改成
x = 4
y = index * 32 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|