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

Project1

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

名称输入加强脚本

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
7 小时
注册时间
2008-4-5
帖子
15
跳转到指定楼层
1
发表于 2009-1-13 00:32:35 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
#==============================================================================
# 请先删除Window_NameInput脚本,然后在Main前面添加下面脚本,
#
# 或者把Window_NameInput替换成本脚本的内容。
#------------------------------------------------------------------------------
#  名称输入加强脚本
#==============================================================================
  1. #==============================================================================
  2. # 请先删除Window_NameInput脚本,然后在Main前面添加下面脚本,
  3. #
  4. # 或者把Window_NameInput替换成本脚本的内容。
  5. #------------------------------------------------------------------------------
  6. #  名称输入加强脚本
  7. #==============================================================================
  8. # ————————————————————————————————————
  9. # 本脚本来自www.66rpg.com,转载请保留此信息
  10. # ————————————————————————————————————
  11. class Window_NameInput < Window_Base
  12.   CHARACTER_TABLE =
  13.   [
  14.     "A","B","C","D","E",
  15.     "F","G","H","I","J",
  16.     "K","L","M","N","O",
  17.     "P","Q","R","S","T",
  18.     "U","V","W","X","Y",
  19.     "Z","","","","",
  20.     "","","","","",
  21.     "", "" ,"", "" ,"",
  22.     "","","","","",
  23.     "", "" ,"", "" ,"",
  24.     "1","2","3","4","5",
  25.     "6","7","8","9","0",
  26.     "","","","","",
  27.     "","","","","",
  28.     "","","","","",
  29.     "","","","","",
  30.     "","","","","",
  31.     "","", "" , "" , "" ,
  32.     "a","b","c","d","e",
  33.     "f","g","h","i","j",
  34.     "k","l","m","n","o",
  35.     "p","q","r","s","t",
  36.     "u","v","w","x","y",
  37.     "z","","","","",
  38.     "","","","","",
  39.     "", "" ,"", "" ,"",
  40.     "","","","","",
  41.     "", "" ,"", "" ,"",
  42.     "","","","","",
  43.     "","","","","",
  44.     "","","","","",
  45.     "","","","","",
  46.     "","","","","",
  47.     "","","","","",
  48.     "","","","","",
  49.     "","", "" , "" , "" ,
  50.   ]
  51.   #--------------------------------------------------------------------------
  52.   # ● 初始化对像
  53.   #--------------------------------------------------------------------------
  54.   def initialize
  55.     super(0, 128, 640, 352)
  56.     self.contents = Bitmap.new(width - 32, height - 32)
  57.     @index = 0
  58.     refresh
  59.     update_cursor_rect
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 获取文字
  63.   #--------------------------------------------------------------------------
  64.   def character
  65.     return CHARACTER_TABLE[@index]
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 刷新
  69.   #--------------------------------------------------------------------------
  70.   def refresh
  71.     self.contents.clear
  72.     for i in 0..179
  73.       x = 4 + i / 5 / 9 * 152 + i % 5 * 28
  74.       y = i / 5 % 9 * 32
  75.       self.contents.draw_text(x, y, 28, 32, CHARACTER_TABLE[i], 1)
  76.     end
  77.     self.contents.draw_text(544, 9 * 32, 64, 32, "Confirm", 1)
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● 刷新光标矩形
  81.   #--------------------------------------------------------------------------
  82.   def update_cursor_rect
  83.     # 光标位置在 [确定] 的情况下
  84.     if @index >= 180
  85.       self.cursor_rect.set(544, 9 * 32, 64, 32)
  86.     # 光标位置在 [确定] 以外的情况下
  87.     else
  88.       x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
  89.       y = @index / 5 % 9 * 32
  90.       self.cursor_rect.set(x, y, 28, 32)
  91.     end
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 刷新画面
  95.   #--------------------------------------------------------------------------
  96.   def update
  97.     super
  98.      # 光标位置在 [确定] 的情况下
  99.     if @index >= 180
  100.       # カーソル下
  101.       if Input.trigger?(Input::DOWN)
  102.         $game_system.se_play($data_system.cursor_se)
  103.         @index -= 180
  104.       end
  105.       # カーソル上
  106.       if Input.repeat?(Input::UP)
  107.         $game_system.se_play($data_system.cursor_se)
  108.         @index -= 180 - 40
  109.       end
  110.     # 光标位置在 [确定] 以外的情况下
  111.     else
  112.       # 按下方向键右的情况下
  113.       if Input.repeat?(Input::RIGHT)
  114.         # 按下状态不是重复的情况下
  115.         # 光标位置不在右端的情况下
  116.         if Input.trigger?(Input::RIGHT) or
  117.            @index / 45 < 3 or @index % 5 < 4
  118.           # 光标向右移动
  119.           $game_system.se_play($data_system.cursor_se)
  120.           if @index % 5 < 4
  121.             @index += 1
  122.           else
  123.             @index += 45 - 4
  124.           end
  125.           if @index >= 180
  126.             @index -= 180
  127.           end
  128.         end
  129.       end
  130.       # 按下方向键左的情况下
  131.       if Input.repeat?(Input::LEFT)
  132.         # 按下状态不是重复的情况下、
  133.         # 光标位置不在左端的情况下
  134.         if Input.trigger?(Input::LEFT) or
  135.            @index / 45 > 0 or @index % 5 > 0
  136.          # 光标向右移动
  137.           $game_system.se_play($data_system.cursor_se)
  138.           if @index % 5 > 0
  139.             @index -= 1
  140.           else
  141.             @index -= 45 - 4
  142.           end
  143.           if @index < 0
  144.             @index += 180
  145.           end
  146.         end
  147.       end
  148.       # 按下方向键下的情况下
  149.       if Input.repeat?(Input::DOWN)
  150.         # 光标向下移动
  151.         $game_system.se_play($data_system.cursor_se)
  152.         if @index % 45 < 40
  153.           @index += 5
  154.         else
  155.           @index += 180 - 40
  156.         end
  157.       end
  158.       # 按下方向键上的情况下
  159.       if Input.repeat?(Input::UP)
  160.         # 按下状态不是重复的情况下、
  161.         # 光标位置不在上端的情况下
  162.         if Input.trigger?(Input::UP) or @index % 45 >= 5
  163.           # カーソルを上に移動
  164.           $game_system.se_play($data_system.cursor_se)
  165.           if @index % 45 >= 5
  166.             @index -= 5
  167.           else
  168.             @index += 180
  169.           end
  170.         end
  171.       end
  172.       # L 键与 R 键被按下的情况下
  173.       if Input.repeat?(Input::L) or Input.repeat?(Input::R)
  174.         # ひらがな / カタカナ 移動
  175.         $game_system.se_play($data_system.cursor_se)
  176.         if @index / 45 < 2
  177.           @index += 90
  178.         else
  179.           @index -= 90
  180.         end
  181.       end
  182.     end
  183.     update_cursor_rect
  184.   end
  185. end
复制代码
1000 字节以内
不支持自定义 Discuz! 代码

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2009-1-3
帖子
17
3
发表于 2009-1-15 01:41:04 | 只看该作者
哈哈!这个系统比我的【是中国人怎能用日文文字表?v1.0(正式版发布!) 】
好多了!!!!不过名字没我多,也不丰富:
http://rpg.blue/viewthread.php?tid=114526
晕死啊!怎么可以!!妈妈竟然把我的游戏DATA给全删了!!我问为什么她说这是什么乱七八糟的东西所以删了,无语......
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
373
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

2
发表于 2009-1-13 00:43:34 | 只看该作者
那个,请问,加强了什么呢?

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-22 00:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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