赞 | 1 |
VIP | 20 |
好人卡 | 8 |
积分 | 3 |
经验 | 6181 |
最后登录 | 2022-8-5 |
在线时间 | 271 小时 |
Lv2.观梦者 神隐的主犯
- 梦石
- 0
- 星屑
- 299
- 在线时间
- 271 小时
- 注册时间
- 2008-2-22
- 帖子
- 7691
|
- #==============================================================================
- # ■ Position
- #------------------------------------------------------------------------------
- # 定义战斗角色站位,队伍站位,技能范围坐标的模块。
- #==============================================================================
- module Position
- HEXAGON = [[50, 10],[5, 30],[95, 30]]
- end
- #==============================================================================
- # ■ Window_ActorCommand
- #------------------------------------------------------------------------------
- # 战斗画面、选择战斗与逃跑的窗口。
- #==============================================================================
- class Window_ActorCommand < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(128, 128, 544, 416)
- @actor = actor
- self.opacity = 0
- @column_max = 6
- @item_max = 6
- self.index = 0
- @index_index = self.index
- draw_icon(@index, @actor.pressed_key[@index], Position::HEXAGON[0][0], Position::HEXAGON[0][1], 255)
- draw_icon(@index - 1, @actor.pressed_key[@index-1], Position::HEXAGON[1][0], Position::HEXAGON[1][1], 100)
- draw_icon(@index + 1, @actor.pressed_key[(@index+1)%5], Position::HEXAGON[2][0], Position::HEXAGON[2][1], 100)
- refresh
- end
- #------------------------------
- # ● 刷新
- #------------------------------
- def refresh
- unless @index_index == @index
- self.contents.clear
- draw_icon(@index, @actor.pressed_key[@index], Position::HEXAGON[0][0], Position::HEXAGON[0][1], 255)
- draw_icon(@index - 1, @actor.pressed_key[@index-1], Position::HEXAGON[1][0], Position::HEXAGON[1][1], 100)
- draw_icon(@index + 1, @actor.pressed_key[(@index+1)%5], Position::HEXAGON[2][0], Position::HEXAGON[2][1], 100)
- @index_index = @index
- end
- update
- end
- #--------------------------------------------------------------------------
- # ● 描绘图标
- #--------------------------------------------------------------------------
- def draw_icon(index, number, x, y, op)
- index = 5 if index < 0
- index = 0 if index > 5
- bitmap = Bitmap.new("Graphics/Battle/#{Material::BATTLE_INSTRUCTION}")
- w = bitmap.width / 2
- h = bitmap.height / 6
- rect = Rect.new(number * w, index * h, w, h)
- self.contents.blt(x, y, bitmap, rect, op)
- bitmap.dispose
- end
- #--------------------------------------------------------------------------
- # ● 光标向下移动
- # wrap : 允许跳过
- #--------------------------------------------------------------------------
- def cursor_down(wrap = false)
- @index += 1
- @index = 0 if @index > 5
- end
- #--------------------------------------------------------------------------
- # ● 光标向上移动
- # wrap : 允许跳过
- #--------------------------------------------------------------------------
- def cursor_up(wrap = false)
- @index -= 1
- @index = 5 if @index < 0
- end
- #--------------------------------------------------------------------------
- # ● 光标向右移动
- # wrap : 允许跳过
- #--------------------------------------------------------------------------
- def cursor_right(wrap = false)
- @index += 1
- @index = 0 if @index > 5
- end
- #--------------------------------------------------------------------------
- # ● 光标向左移动
- # wrap : 允许跳过
- #--------------------------------------------------------------------------
- def cursor_left(wrap = false)
- @index -= 1
- @index = 5 if @index < 0
- end
- #--------------------------------------------------------------------------
- # ● 获取项目要描画的矩形
- # index : 项目编号
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new(0, 0, 0, 0)
- return rect
- end
-
- def setup(actor)
- @actor = actor
- end
- end
复制代码
这个是脚本,不能直接使用。(因为是为我自己的游戏而写的)自己改改吧。 |
|