| 赞 | 10 |
| VIP | |
| 好人卡 | |
| 积分 | 40 |
| 经验 | |
| 最后登录 | 2025-9-8 |
| 在线时间 | 604 小时 |
- 梦石
- 0
- 星屑
- 4017
- 在线时间
- 604 小时
- 注册时间
- 2017-4-21
- 回帖
- 177
|
楼主 |
发表于 2019-3-6 16:37:05
|
显示全部楼层
貌似可以一行出现不同个数,因为实际上还是一列……
- #$scene = Scene_xgqBhuoZhuoTuJian.new打开脚本
-
-
- class Scene_xgqBhuoZhuoTuJian
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- screen = Spriteset_Map.new
- # 生成窗口
- @tujian_window = Window_BhuoZhuoTuJian.new
- @tujian_window.z=1000
- # 生成目标窗口 (设置为不可见・不活动)
- @target_window = Window_Target.new
- @target_window.visible = false
- @target_window.active = false
- @target_window.z=1896
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- screen.dispose
- @tujian_window.dispose
- @target_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @tujian_window.update
- @target_window.update
- # 图鉴窗口被激活的情况下: 调用 update_tujian
- if @tujian_window.active
- update_tujian
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (特技窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def update_tujian
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到地图
- $scene = Scene_Map.new
- return
- end
- end
- end
-
-
-
- class Window_BhuoZhuoTuJian < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640, 480)
- @column_max = 1
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- @data = [
- [ 1, 2, 3, 0, 0],#第一行出现的物品ID,如有有0就不出现
- [ 4, 5, 6, 0, 0],
- [ 7, 8, 9, 0, 0],
- [ 58, 59, 0, 0, 0],
- [ 115, 0, 0, 0, 0],
- [ 236, 237, 106, 107, 0],
- [ 789, 790, 791, 792, 0]
-
- ]
- # 如果项目数不是 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)
- draw_itemer(i)
- draw_itemsan(i)
- draw_itemsi(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- skill = @data[index]
- x = 4
- y = index * 32
- bitmap = RPG::Cache.icon($data_items[@data[index][0]].icon_name)
- self.contents.blt(x, y + 4, bitmap, bitmap.rect)
- self.contents.draw_text(x + 28, y, 204, 32, $data_items[@data[index][0]].name, 0)
- end
- def draw_itemer(index)
- if @data[index][1] != 0
- skill = @data[index]
- x = 152
- y = index * 32
- bitmap = RPG::Cache.icon($data_items[@data[index][1]].icon_name)
- self.contents.blt(x, y + 4, bitmap, bitmap.rect)
- self.contents.draw_text(x + 28, y, 204, 32, $data_items[@data[index][1]].name, 0)
- end
- end
- def draw_itemsan(index)
- if @data[index][2] != 0
- skill = @data[index]
- x = 304
- y = index * 32
- bitmap = RPG::Cache.icon($data_items[@data[index][2]].icon_name)
- self.contents.blt(x, y + 4, bitmap, bitmap.rect)
- self.contents.draw_text(x + 28, y, 204, 32, $data_items[@data[index][2]].name, 0)
- end
- end
- def draw_itemsi(index)
- if @data[index][3] != 0
- skill = @data[index]
- x = 462
- y = index * 32
- bitmap = RPG::Cache.icon($data_items[@data[index][3]].icon_name)
- self.contents.blt(x, y + 4, bitmap, bitmap.rect)
- self.contents.draw_text(x + 28, y, 204, 32, $data_items[@data[index][3]].name, 0)
- end
- end
- end
复制代码 |
|