Project1
标题:
美化的动态选项窗口 (仿小生自己家的DVD控制界面)
[打印本页]
作者:
KKME
时间:
2007-2-9 02:56
标题:
美化的动态选项窗口 (仿小生自己家的DVD控制界面)
这个是根据主站上的http://rpg.blue/web/htm/news165.htm进行修改制作的脚本,和小生这两天发布的另外几个不一样,只是比较小的一些改动而已,为了美化一些,仅此而已。
#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
# 一般的命令选择行窗口。
#==============================================================================
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# width : 窗口的宽
# commands : 命令字符串序列
#--------------------------------------------------------------------------
def initialize(width, commands)
# 由命令的个数计算出窗口的高
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
@item = []
self.index = 0
refresh
@oldindex = 0
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i != self.index
draw_item_dis(i)
else
draw_item_active(i,@item[i])
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
# color : 文字色
#--------------------------------------------------------------------------
def draw_item_dis(index)
rect = Rect.new(5, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
self.contents.draw_text(5,32*index-1,self.contents.width,32, @commands[index])
self.contents.draw_text(5-1,32*index,self.contents.width,32, @commands[index])
self.contents.draw_text(5+1,32*index,self.contents.width,32, @commands[index])
self.contents.font.color = disabled_color
self.contents.draw_text(rect, @commands[index])
end
def draw_item_active(index, type)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
self.contents.draw_text(5,32*index-1,self.contents.width,32, @commands[index])
self.contents.draw_text(5-1,32*index,self.contents.width,32, @commands[index])
self.contents.draw_text(5+1,32*index,self.contents.width,32, @commands[index])
if type==1
self.contents.font.color = disabled_color
else
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index])
end
#--------------------------------------------------------------------------
# ● 项目无效化
# index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
@item[index] = 1
end
#--------------------------------------------------------------------------
# ● 刷新方法更新
#--------------------------------------------------------------------------
def update
super
#——这里使用的刷新方法比直接refresh节约很多内存
if self.index != @oldindex
@oldindex = self.index
refresh
end
end
def update_cursor_rect
self.cursor_rect.empty
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]
Edited by 傳說の仙劍
作者:
KKME
时间:
2007-2-9 02:56
标题:
美化的动态选项窗口 (仿小生自己家的DVD控制界面)
这个是根据主站上的http://rpg.blue/web/htm/news165.htm进行修改制作的脚本,和小生这两天发布的另外几个不一样,只是比较小的一些改动而已,为了美化一些,仅此而已。
#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
# 一般的命令选择行窗口。
#==============================================================================
class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# width : 窗口的宽
# commands : 命令字符串序列
#--------------------------------------------------------------------------
def initialize(width, commands)
# 由命令的个数计算出窗口的高
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
@item = []
self.index = 0
refresh
@oldindex = 0
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i != self.index
draw_item_dis(i)
else
draw_item_active(i,@item[i])
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
# color : 文字色
#--------------------------------------------------------------------------
def draw_item_dis(index)
rect = Rect.new(5, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
self.contents.draw_text(5,32*index-1,self.contents.width,32, @commands[index])
self.contents.draw_text(5-1,32*index,self.contents.width,32, @commands[index])
self.contents.draw_text(5+1,32*index,self.contents.width,32, @commands[index])
self.contents.font.color = disabled_color
self.contents.draw_text(rect, @commands[index])
end
def draw_item_active(index, type)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
self.contents.draw_text(5,32*index-1,self.contents.width,32, @commands[index])
self.contents.draw_text(5-1,32*index,self.contents.width,32, @commands[index])
self.contents.draw_text(5+1,32*index,self.contents.width,32, @commands[index])
if type==1
self.contents.font.color = disabled_color
else
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index])
end
#--------------------------------------------------------------------------
# ● 项目无效化
# index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
@item[index] = 1
end
#--------------------------------------------------------------------------
# ● 刷新方法更新
#--------------------------------------------------------------------------
def update
super
#——这里使用的刷新方法比直接refresh节约很多内存
if self.index != @oldindex
@oldindex = self.index
refresh
end
end
def update_cursor_rect
self.cursor_rect.empty
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]
Edited by 傳說の仙劍
作者:
zhong
时间:
2007-2-9 06:06
效果很不错,拿来用了!!!~~~~{/qiang}
作者:
19911118
时间:
2007-2-9 23:55
提示:
作者被禁止或删除 内容自动屏蔽
作者:
KKME
时间:
2007-2-10 00:21
以下引用
19911118于2007-2-9 15:55:23
的发言:
按什么键返回游戏界面
什么叫返回游戏界面?此脚本只改了显示效果,对算法无任何改动。
请用新工程测试。
作者:
幻の飞鱼
时间:
2007-2-10 21:34
由于重定义了Window_Command的刷新
我加进去以后,鼠标脚本在Window_Command里就废掉了,呵呵
算了,就不改了,
就用目前这个从黑暗圣剑里的效果也还不错
作者:
叶舞枫
时间:
2007-3-26 05:15
发布到主站完毕
LZ VIP += 2
http://rpg.blue/web/htm/news653.htm
作者:
juju2001
时间:
2007-3-26 06:31
不错顶,支持!
作者:
精灵使者
时间:
2007-3-26 13:55
效果不错!这比以前那个脚本明显多了!谢谢支持!{/qiang}
刚才测试的时候出了些错误。错误原因是,如果对话框小于默认字体数的话,字体会压缩,在没有选中的时候和没有压缩的黑色的底部放在一起会很难看。希望楼主修改一下黑色的底部能自动压缩,否则界面会出问题。为了美观起见,我还是使用原来的脚本选项,配合字体阴影脚本就没这个问题了。
作者:
千年狐狸精
时间:
2007-3-27 03:38
很好看.现在才知道LZ是男生{/gg}
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1