- 注册时间
- 2004-7-24
- 最后登录
- 2007-12-8
⑤进阶
鹏伟派的掌门
- 积分
- 660
|
我想把开始的选单做成横的象那个(战斗/逃跑)的横版,但是不行,样子出来了,可是光标矩形没办法动,连进入也不行,特此求教 - #==============================================================================
- # ■ Window_Title
- #------------------------------------------------------------------------------
- # 标题画面的窗口。
- #==============================================================================
- class Window_Title < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(160, 350, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = 160
- @commands = ["开始游戏", "结束游戏"]
- @item_max = 2
- @column_max = 2
- draw_item(0, normal_color)
- draw_item(1, normal_color)
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目标号
- # color : 文字颜色
- #--------------------------------------------------------------------------
- def draw_item(index, color)
- self.contents.font.color = color
- rect = Rect.new(index * 160 + 4, 0, 128 - 10, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- self.contents.draw_text(rect, @commands[index], 1)
- end
- #--------------------------------------------------------------------------
- # ● 更新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- self.cursor_rect.set(160 + index * 160, 0, 128, 32)
- end
- end
复制代码
求教了!
该好了谁给我分析以下原因啊?- #==============================================================================
- # ■ Window_Title
- #------------------------------------------------------------------------------
- # 标题画面的窗口。
- #==============================================================================
- class Window_Title < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(160, 350, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = 160
- @commands = ["开始游戏", "结束游戏"]
- @item_max = 2
- @column_max = 2
- draw_item(0, normal_color)
- draw_item(1, normal_color)
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目标号
- # color : 文字颜色
- #--------------------------------------------------------------------------
- def draw_item(index, color)
- self.contents.font.color = color
- rect = Rect.new(index * 160 + 4, 0, 128 - 10, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- self.contents.draw_text(rect, @commands[index], 1)
- end
- #--------------------------------------------------------------------------
- # ● 更新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- self.cursor_rect.set(index * 160, 0, 128, 32)
- end
- end
复制代码 |
|