查看: 1692|回复: 3

[已经解决] 如何将标题横向显示的脚本成到尽头返回第一或结尾的样式

[复制链接]
梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
发表于 2012-1-27 19:31:05 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 爆焰 于 2012-1-28 19:02 编辑

就是这个脚本,要如何改成到达最后一个选项再按右键就跳回第一个选项?在第一个选项按左键又变回最后一个选项?
  1. #==============================================================================
  2. # ■ Window_Command1
  3. #------------------------------------------------------------------------------
  4. #  一般的命令选择行窗口。
  5. #==============================================================================
  6. #Scene_Title 第40行改成:
  7. #@command_window = Window_Command1.new(392, [s1, s2, s3])




  8. class Window_Command1 < Window_Selectable
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化对像
  11.   #     width    : 窗口的宽
  12.   #     commands : 命令字符串序列
  13.   #--------------------------------------------------------------------------
  14.   def initialize(width, commands)
  15.     # 由命令的个数计算出窗口的高
  16.     super(0, 0, width, 64)
  17.     @item_max = commands.size
  18.     @commands = commands
  19.     @column_max = commands.size
  20.     self.contents = Bitmap.new(width - 32, 64- 32)
  21.     refresh
  22.     self.index = 0
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 刷新
  26.   #--------------------------------------------------------------------------
  27.   def refresh
  28.     self.contents.clear
  29.     for i in 0...@item_max
  30.       draw_item(i, normal_color)
  31.     end
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 描绘项目
  35.   #     index : 项目编号
  36.   #     color : 文字色
  37.   #--------------------------------------------------------------------------
  38.   def draw_item(index, color)
  39.     self.contents.font.color = color
  40.     # 计算光标的宽
  41.     cursor_width = width / @column_max - 32
  42.     # 计算光标坐标
  43.     x = index % @column_max * (cursor_width + 32)
  44.     #y = @index / @column_max * 32 - self.oy
  45.     rect = Rect.new(x, 0, cursor_width - 8, 32)
  46.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  47.     self.contents.draw_text(rect, @commands[index], 1)
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 项目无效化
  51.   #     index : 项目编号
  52.   #--------------------------------------------------------------------------
  53.   def disable_item(index)
  54.     draw_item(index, disabled_color)
  55.   end
  56. end
复制代码

博客:我的博客
梦石
0
星屑
55
在线时间
142 小时
注册时间
2009-5-15
回帖
206
发表于 2012-1-27 23:59:56 | 显示全部楼层
回复

使用道具 举报

路人

梦石
0
星屑
595
在线时间
943 小时
注册时间
2011-8-20
回帖
965
发表于 2012-1-28 01:44:50 | 显示全部楼层
用个图片标题菜单好了,到时候你想干嘛干嘛!{:nm_4:}
为填坑而修炼中……
回复

使用道具 举报

梦石
0
星屑
50
在线时间
18 小时
注册时间
2012-1-26
回帖
21
发表于 2012-1-28 08:58:26 | 显示全部楼层
本帖最后由 点叙 于 2012-1-28 20:24 编辑

@爆焰会错意了。。。

点评

根本就不行  发表于 2012-1-28 18:50
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部