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

Project1

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

[已经解决] 【专业伸手党】请教一下如何实现随机下拉菜单?谢谢啦

[复制链接]

Lv1.梦旅人

梦石
0
星屑
239
在线时间
2399 小时
注册时间
2008-4-11
帖子
12326

贵宾第6届短篇游戏比赛季军

跳转到指定楼层
1
发表于 2013-3-14 23:04:57 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
10星屑

看到手机游戏里面有一个文字置放型游戏。
里面的迷宫行动,都用一行行文字来显示,
蛮好玩啊,VX怎么才能显示一行行文字这样的方式呢?
(每行文字都是独立的框,并且选择进入后可以看到下一阶的内容。)

比如:

进入迷宫第\v[1]层

得到一个宝箱(进入查看) ==》 打开宝箱得到100G

遇见一群怪物(进入查看) ==》 战斗过程。。。。



如果不进入查看的话,就显示第一阶的文字

所有的文字都可以上拉下拉来查看,最多可以保存999+行文字


谢谢啦,给你们带来困扰了。














最佳答案

查看完整内容

小瞬你看看这个《P叔的动作列表》是否满足你的要求。 [hr] 范例: 截图: 脚本(使用时务必注明来源): #============================================================================== # ■ P叔的动作列表 #------------------------------------------------------------------------------ # 请设定动作列表保留的最大行数: Line_Max = 999 # 三点注意事项: # 1、需要保留动作的文章,在文章开头打上符号 ...

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4514
在线时间
5228 小时
注册时间
2009-4-29
帖子
14318

贵宾

来自 2楼
发表于 2013-3-14 23:04:58 | 只看该作者
本帖最后由 protosssonny 于 2013-3-15 19:08 编辑

小瞬你看看这个《P叔的动作列表》是否满足你的要求。


范例: P叔的动作列表.rar (249.93 KB, 下载次数: 83)
截图:

脚本(使用时务必注明来源):
RUBY 代码复制
  1. #==============================================================================
  2. # ■ P叔的动作列表
  3. #------------------------------------------------------------------------------
  4. # 请设定动作列表保留的最大行数:
  5.   Line_Max = 999
  6. # 三点注意事项:  
  7. # 1、需要保留动作的文章,在文章开头打上符号 \+
  8. # 2、不需要保留动作的文章,直接打字即可
  9. # 3、文章不要太长,一般不要超过一行,不然会显示不全
  10. # 4、对于颜色显示、队员名称显示、变量显示都支持
  11. #------------------------------------------------------------------------------
  12. #                      请注明脚本来源:
  13. #                  本脚本来自[url]www.66rpg.com[/url]
  14. #==============================================================================
  15.  
  16.  
  17. #==============================================================================
  18. # ■ Game_Message
  19. #------------------------------------------------------------------------------
  20. #  处理讯息窗口状态、执行文字显示、选项等的类。 本类的实例请参考 $game_message。
  21. #==============================================================================
  22.  
  23. class Game_Message
  24.   #--------------------------------------------------------------------------
  25.   # ● 定义实例变量
  26.   #--------------------------------------------------------------------------
  27.   attr_accessor :action_table               # 行动列表
  28.   #--------------------------------------------------------------------------
  29.   # ● 初始化对像
  30.   #--------------------------------------------------------------------------
  31.   def initialize
  32.     @action_table = [] if @action_table.nil?
  33.     clear
  34.     @visible = false
  35.   end
  36. end
  37.  
  38. #==============================================================================
  39. # ■ Window_Message
  40. #------------------------------------------------------------------------------
  41. #  显示文章的信息窗口。
  42. #==============================================================================
  43.  
  44. class Window_Message < Window_Selectable
  45.   #--------------------------------------------------------------------------
  46.   # ● 转换特殊符号
  47.   #--------------------------------------------------------------------------
  48.   def convert_special_characters
  49.     @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  50.     @text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  51.     @text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  52.     @text.gsub!(/\\G/)              { "\x02" }
  53.     @text.gsub!(/\\\./)             { "\x03" }
  54.     @text.gsub!(/\\\|/)             { "\x04" }
  55.     @text.gsub!(/\\!/)              { "\x05" }
  56.     @text.gsub!(/\\>/)              { "\x06" }
  57.     @text.gsub!(/\\</)              { "\x07" }
  58.     @text.gsub!(/\\\^/)             { "\x08" }
  59.     @text.gsub!(/\\\\/)             { "\\" }
  60.     @text.gsub!(/\\\+/)             { "" }
  61.   end
  62. end  
  63.  
  64. #==============================================================================
  65. # ■ Game_Interpreter
  66. #------------------------------------------------------------------------------
  67. #  执行事件命令的解释器。本类在 Game_Map 类、Game_Troop 类、与
  68. # Game_Event 类的内部使用。
  69. #==============================================================================
  70.  
  71. class Game_Interpreter
  72.   #--------------------------------------------------------------------------
  73.   # ● 显示文章
  74.   #--------------------------------------------------------------------------
  75.   def command_101
  76.     unless $game_message.busy
  77.       $game_message.face_name = @params[0]
  78.       $game_message.face_index = @params[1]
  79.       $game_message.background = @params[2]
  80.       $game_message.position = @params[3]
  81.       text = ""
  82.       @index += 1
  83.       while @list[@index].code == 401       # 文章数据
  84.         $game_message.texts.push(@list[@index].parameters[0])
  85.         @index += 1
  86.       end
  87.       for i in 0...2
  88.         text += $game_message.texts[i] unless $game_message.texts[i].nil?
  89.       end
  90.       text = convert_special_characters(text)
  91.       $game_message.action_table.push(text) if text.include?("\x09")
  92.       if $game_message.action_table.size > 999
  93.         $game_message.action_table.delete_at(0)
  94.       end  
  95.       if @list[@index].code == 102          # 显示选择项
  96.         setup_choices(@list[@index].parameters)
  97.       elsif @list[@index].code == 103       # 数值输入处理
  98.         setup_num_input(@list[@index].parameters)
  99.       end
  100.       set_message_waiting                   # 设置等待信息结束
  101.     end
  102.     return false
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ● 转换特殊符号
  106.   #--------------------------------------------------------------------------
  107.   def convert_special_characters(texts)
  108.     text = texts.dup
  109.     text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  110.     text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  111.     text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  112.     text.gsub!(/\\G/)              { "" }
  113.     text.gsub!(/\\\./)             { "" }
  114.     text.gsub!(/\\\|/)             { "" }
  115.     text.gsub!(/\\!/)              { "" }
  116.     text.gsub!(/\\>/)              { "" }
  117.     text.gsub!(/\\</)              { "" }
  118.     text.gsub!(/\\\^/)             { "" }
  119.     text.gsub!(/\\\\/)             { "\\" }
  120.     text.gsub!(/\\\+/)             { "\x09" }
  121.     return text
  122.   end
  123. end  
  124.  
  125. #==============================================================================
  126. # ■ Window_Action
  127. #------------------------------------------------------------------------------
  128. #  显示行动列表的窗口。
  129. #==============================================================================
  130.  
  131. class Window_Action < Window_Base
  132.   #--------------------------------------------------------------------------
  133.   # ● 初始化对像
  134.   #     x      : 窗口 X 座标
  135.   #     y      : 窗口 Y 座标
  136.   #--------------------------------------------------------------------------
  137.   def initialize(x, y)
  138.     super(x, y, 544, 416)
  139.     @self_index = 0
  140.     @contents_x = 4
  141.     refresh
  142.   end
  143.   def update
  144.     max = $game_message.action_table.size
  145.     max = 999 if max > 999
  146.     if Input.trigger?(Input::B)
  147.       Sound.play_cancel
  148.       $scene = Scene_Map.new
  149.     elsif Input.repeat?(Input::UP)
  150.       if @self_index < max - 16
  151.         @self_index += 1
  152.         refresh
  153.       else
  154.         Sound.play_buzzer
  155.       end  
  156.     elsif Input.repeat?(Input::DOWN)
  157.       if @self_index > 0
  158.         @self_index -= 1
  159.         refresh
  160.       else
  161.         Sound.play_buzzer
  162.       end  
  163.     elsif Input.repeat?(Input::L)
  164.       if @self_index < max - 16
  165.         @self_index += 16
  166.         @self_index = max - 16 if @self_index > max - 16
  167.         refresh
  168.       else
  169.         Sound.play_buzzer
  170.       end  
  171.     elsif Input.repeat?(Input::R)
  172.       if @self_index > 0
  173.         @self_index -= 16
  174.         @self_index = 0 if @self_index < 0
  175.         refresh
  176.       else
  177.         Sound.play_buzzer
  178.       end   
  179.     end
  180.   end  
  181.   #--------------------------------------------------------------------------
  182.   # ● 刷新
  183.   #--------------------------------------------------------------------------
  184.   def refresh
  185.     self.contents.clear
  186.     max = $game_message.action_table.size
  187.     max = 16 if max > 16
  188.     action_table = $game_message.action_table
  189.     for i in 0...max
  190.       text = action_table[action_table.size - i - @self_index - 1]
  191.       update_message(text, i)
  192.     end
  193.   end
  194.  
  195.   def update_message(text, i)
  196.     dupped_text = text.dup
  197.     @contents_x = 4
  198.     join = false
  199.     loop do
  200.       c = dupped_text.slice!(/./m)             # 获取一个文字
  201.       case c
  202.       when nil                          # 无法获取文字时
  203.         break
  204.       when "\n"                         # 新行
  205.  
  206.       when "\x01"                       # \C[n](文字变色)
  207.         dupped_text.sub!(/\[([0-9]+)\]/, "")
  208.         contents.font.color = text_color($1.to_i)
  209.         next  
  210.       when "\x09"                       # \+(需要加入动作)
  211.         join = true
  212.       else  
  213.         if join
  214.           contents.draw_text(@contents_x, WLH * (15 - i), 544, WLH, c)
  215.           c_width = contents.text_size(c).width
  216.           @contents_x += c_width  
  217.         end
  218.       end
  219.     end   
  220.   end
  221. end
  222.  
  223. #==============================================================================
  224. # ■ Scene_Action
  225. #------------------------------------------------------------------------------
  226. #  处理战斗画面的类。
  227. #==============================================================================
  228.  
  229. class Scene_Action < Scene_Base
  230.   #--------------------------------------------------------------------------
  231.   # ● 开始处理
  232.   #--------------------------------------------------------------------------
  233.   def start
  234.     super
  235.     @action_window = Window_Action.new(0, 0)
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● 结束处理
  239.   #--------------------------------------------------------------------------
  240.   def terminate
  241.     super
  242.     @action_window.dispose
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● 更新画面
  246.   #--------------------------------------------------------------------------
  247.   def update
  248.     super
  249.     @action_window.update
  250.   end
  251. end

点评

P叔V5...  发表于 2013-3-30 10:52
五个节操掉到洞里了  发表于 2013-3-16 06:45

评分

参与人数 3星屑 +72 收起 理由
0newing + 7 P叔V5!
houyuxiaoyang + 15 P叔V5!
Password + 50 P叔V5……

查看全部评分

《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
23 小时
注册时间
2013-3-12
帖子
74
3
发表于 2013-3-14 23:16:04 | 只看该作者
话说,这是什么游戏啊,头一次见呢,感觉还挺有意思,有点像塞班系统的文字网游。

点评

置放式游戏,以后消磨时光的好类型  发表于 2013-3-14 23:29
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
239
在线时间
2399 小时
注册时间
2008-4-11
帖子
12326

贵宾第6届短篇游戏比赛季军

4
 楼主| 发表于 2013-3-24 23:49:31 | 只看该作者
protosssonny 发表于 2013-3-14 23:04
小瞬你看看这个《P叔的动作列表》是否满足你的要求。


范例:

有什么办法,让每行文字都能独立存在?

我可能表达不清楚,是这样的
进入这个界面后,是有那个闪动的光框在第一行文字上的
之所以要这个光框模式因为小瞬不仅仅想要看到历史文字
更想对文字进行操作:

操作一:光框所在位置点击一下确定键就能进入下一层的解释
操作二:光框所在行数,文字超过一行的会进行滚动播出
操作三:进入界面时,光框永远停留在最近一次信息位置上。

关于【操作一】的解释:

文字信息分两层
第一层是简介,第二层是内容
就像论坛里面的帖子一样
第一层就是帖子标题,第二层就是帖子内容


希望P叔把剩下的节操都给我
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-14 14:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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