Project1
标题:
名称输入加强脚本
[打印本页]
作者:
xcr530551426
时间:
2009-1-13 00:32
标题:
名称输入加强脚本
#==============================================================================
# 请先删除Window_NameInput脚本,然后在Main前面添加下面脚本,
#
# 或者把Window_NameInput替换成本脚本的内容。
#------------------------------------------------------------------------------
# 名称输入加强脚本
#==============================================================================
#==============================================================================
# 请先删除Window_NameInput脚本,然后在Main前面添加下面脚本,
#
# 或者把Window_NameInput替换成本脚本的内容。
#------------------------------------------------------------------------------
# 名称输入加强脚本
#==============================================================================
# ————————————————————————————————————
# 本脚本来自www.66rpg.com,转载请保留此信息
# ————————————————————————————————————
class Window_NameInput < Window_Base
CHARACTER_TABLE =
[
"A","B","C","D","E",
"F","G","H","I","J",
"K","L","M","N","O",
"P","Q","R","S","T",
"U","V","W","X","Y",
"Z","","","","",
"","","","","",
"", "" ,"", "" ,"",
"","","","","",
"", "" ,"", "" ,"",
"1","2","3","4","5",
"6","7","8","9","0",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
"","", "" , "" , "" ,
"a","b","c","d","e",
"f","g","h","i","j",
"k","l","m","n","o",
"p","q","r","s","t",
"u","v","w","x","y",
"z","","","","",
"","","","","",
"", "" ,"", "" ,"",
"","","","","",
"", "" ,"", "" ,"",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
"","", "" , "" , "" ,
]
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 128, 640, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@index = 0
refresh
update_cursor_rect
end
#--------------------------------------------------------------------------
# ● 获取文字
#--------------------------------------------------------------------------
def character
return CHARACTER_TABLE[@index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0..179
x = 4 + i / 5 / 9 * 152 + i % 5 * 28
y = i / 5 % 9 * 32
self.contents.draw_text(x, y, 28, 32, CHARACTER_TABLE[i], 1)
end
self.contents.draw_text(544, 9 * 32, 64, 32, "Confirm", 1)
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
# 光标位置在 [确定] 的情况下
if @index >= 180
self.cursor_rect.set(544, 9 * 32, 64, 32)
# 光标位置在 [确定] 以外的情况下
else
x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
y = @index / 5 % 9 * 32
self.cursor_rect.set(x, y, 28, 32)
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 光标位置在 [确定] 的情况下
if @index >= 180
# カーソル下
if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index -= 180
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index -= 180 - 40
end
# 光标位置在 [确定] 以外的情况下
else
# 按下方向键右的情况下
if Input.repeat?(Input::RIGHT)
# 按下状态不是重复的情况下
# 光标位置不在右端的情况下
if Input.trigger?(Input::RIGHT) or
@index / 45 < 3 or @index % 5 < 4
# 光标向右移动
$game_system.se_play($data_system.cursor_se)
if @index % 5 < 4
@index += 1
else
@index += 45 - 4
end
if @index >= 180
@index -= 180
end
end
end
# 按下方向键左的情况下
if Input.repeat?(Input::LEFT)
# 按下状态不是重复的情况下、
# 光标位置不在左端的情况下
if Input.trigger?(Input::LEFT) or
@index / 45 > 0 or @index % 5 > 0
# 光标向右移动
$game_system.se_play($data_system.cursor_se)
if @index % 5 > 0
@index -= 1
else
@index -= 45 - 4
end
if @index < 0
@index += 180
end
end
end
# 按下方向键下的情况下
if Input.repeat?(Input::DOWN)
# 光标向下移动
$game_system.se_play($data_system.cursor_se)
if @index % 45 < 40
@index += 5
else
@index += 180 - 40
end
end
# 按下方向键上的情况下
if Input.repeat?(Input::UP)
# 按下状态不是重复的情况下、
# 光标位置不在上端的情况下
if Input.trigger?(Input::UP) or @index % 45 >= 5
# カーソルを上に移動
$game_system.se_play($data_system.cursor_se)
if @index % 45 >= 5
@index -= 5
else
@index += 180
end
end
end
# L 键与 R 键被按下的情况下
if Input.repeat?(Input::L) or Input.repeat?(Input::R)
# ひらがな / カタカナ 移動
$game_system.se_play($data_system.cursor_se)
if @index / 45 < 2
@index += 90
else
@index -= 90
end
end
end
update_cursor_rect
end
end
复制代码
作者:
八云紫
时间:
2009-1-13 00:43
那个,请问,加强了什么呢?
作者:
tigerzhz
时间:
2009-1-15 01:41
哈哈!这个系统比我的【是中国人怎能用日文文字表?v1.0(正式版发布!) 】
好多了!!!!不过名字没我多,也不丰富:
http://rpg.blue/viewthread.php?tid=114526
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1