设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1406|回复: 3
打印 上一主题 下一主题

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3121
在线时间
1435 小时
注册时间
2009-7-27
帖子
1452
跳转到指定楼层
1
发表于 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
复制代码

博客:我的博客

Lv1.梦旅人

梦石
0
星屑
55
在线时间
142 小时
注册时间
2009-5-15
帖子
220
2
发表于 2012-1-27 23:59:56 | 只看该作者
回复

使用道具 举报

Lv2.观梦者

路人

梦石
0
星屑
590
在线时间
943 小时
注册时间
2011-8-20
帖子
1011
3
发表于 2012-1-28 01:44:50 | 只看该作者
用个图片标题菜单好了,到时候你想干嘛干嘛!{:nm_4:}
为填坑而修炼中……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
18 小时
注册时间
2012-1-26
帖子
22
4
发表于 2012-1-28 08:58:26 | 只看该作者
本帖最后由 点叙 于 2012-1-28 20:24 编辑

@爆焰会错意了。。。

点评

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-2-19 07:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表