赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 1 |
经验 | 17040 |
最后登录 | 2016-2-20 |
在线时间 | 99 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 99 小时
- 注册时间
- 2014-5-2
- 帖子
- 66
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 涵影_博 于 2014-11-9 19:52 编辑
@cinderelmini 这个问题有点严重
class Window_TitleLogo < Window_Base CLEAR_FILE = '通关存档名字.格式' SLIDE_COUNT = {:chn => 60.0, :eng => 90.0} POS_TEXT = -10 POS_LINE = -50 def initialize super(0, 0, 24, 24) self.visible = false @logo = {} @logo[:那份] = Sprite.new @logo[:那份].x = 0 @logo[:那份].y = POS_TEXT @logo[:泪水] = Sprite.new @logo[:泪水].x = 0 @logo[:泪水].y = POS_TEXT @logo[:竟是永恒] = Sprite.new @logo[:竟是永恒].x = 0 @logo[:竟是永恒].y = POS_TEXT @logo[:横线] = Sprite.new @logo[:横线].x = POS_LINE @logo[:横线].y = 0 @logo[:that] = Sprite.new @logo[:that].x = POS_TEXT @logo[:that].y = 0 @logo[:tear] = Sprite.new @logo[:tear].x = POS_TEXT @logo[:tear].y = 0 @logo[:last_forever] = Sprite.new @logo[:last_forever].x = POS_TEXT @logo[:last_forever].y = 0 @logo[:copyright] = Sprite.new @logo[:ver] = Sprite.new @logo.each_key{|key|; @logo[key].opacity = 0; get_logo_bitmap(key)} end def dispose super @logo.each_value{|a| a.dispose} end def clear? return !Dir.glob(CLEAR_FILE).empty? end def get_logo_bitmap(key) case key when :那份 bitmap = Cache.picture("TLS-Title-01") when :泪水 bitmap = Cache.picture("TLS-True-Title-01") when :竟是永恒 bitmap = Cache.picture("TLS-Title-02") when :横线 bitmap = Cache.picture("TLS-Title-Line") when :that bitmap = Cache.picture("TLS-Title-03") when :tear bitmap = Cache.picture("TLS-True-Title-02") when :last_forever bitmap = Cache.picture("TLS-Title-04") when :copyright bitmap = Cache.picture("TLS-Title-C") when :ver bitmap = Cache.picture("TLS-Title-Alpha") end @logo[key].bitmap = bitmap end def calc_target(start_val, end_val, percent) return start_val + ((end_val - start_val) * percent) end def refresh d = SLIDE_COUNT[:chn] count = 0 loop do percent = count / d @logo[:那份].y = calc_target(POS_TEXT, 0, percent) @logo[:那份].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(60) if clear? count = 0 loop do percent = count / d @logo[:泪水].y = calc_target(POS_TEXT, 0, percent) @logo[:泪水].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(60) end count = 0 loop do percent = count / d @logo[:竟是永恒].y = calc_target(POS_TEXT, 0, percent) @logo[:竟是永恒].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(60) count = 0 loop do percent = count / d @logo[:横线].x = calc_target(POS_LINE, 0, percent) @logo[:横线].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(60) d = SLIDE_COUNT[:eng] count = 0 loop do percent = count / d @logo[:that].x = calc_target(POS_TEXT, 0, percent) @logo[:that].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(30) if clear? count = 0 loop do percent = count / d @logo[:tear].x = calc_target(POS_TEXT, 0, percent) @logo[:tear].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(30) end count = 0 loop do percent = count / d @logo[:last_forever].x = calc_target(POS_TEXT, 0, percent) @logo[:last_forever].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(30) count = 0 loop do percent = count / d @logo[:copyright].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end count = 0 loop do percent = count / d @logo[:ver].opacity = calc_target(0, 255, percent) count += 1 Graphics.update break if count >= d end wait(60) end def wait(count) count.times{|i| Graphics.update} end end
class Window_TitleLogo < Window_Base
CLEAR_FILE = '通关存档名字.格式'
SLIDE_COUNT = {:chn => 60.0, :eng => 90.0}
POS_TEXT = -10
POS_LINE = -50
def initialize
super(0, 0, 24, 24)
self.visible = false
@logo = {}
@logo[:那份] = Sprite.new
@logo[:那份].x = 0
@logo[:那份].y = POS_TEXT
@logo[:泪水] = Sprite.new
@logo[:泪水].x = 0
@logo[:泪水].y = POS_TEXT
@logo[:竟是永恒] = Sprite.new
@logo[:竟是永恒].x = 0
@logo[:竟是永恒].y = POS_TEXT
@logo[:横线] = Sprite.new
@logo[:横线].x = POS_LINE
@logo[:横线].y = 0
@logo[:that] = Sprite.new
@logo[:that].x = POS_TEXT
@logo[:that].y = 0
@logo[:tear] = Sprite.new
@logo[:tear].x = POS_TEXT
@logo[:tear].y = 0
@logo[:last_forever] = Sprite.new
@logo[:last_forever].x = POS_TEXT
@logo[:last_forever].y = 0
@logo[:copyright] = Sprite.new
@logo[:ver] = Sprite.new
@logo.each_key{|key|; @logo[key].opacity = 0; get_logo_bitmap(key)}
end
def dispose
super
@logo.each_value{|a| a.dispose}
end
def clear?
return !Dir.glob(CLEAR_FILE).empty?
end
def get_logo_bitmap(key)
case key
when :那份
bitmap = Cache.picture("TLS-Title-01")
when :泪水
bitmap = Cache.picture("TLS-True-Title-01")
when :竟是永恒
bitmap = Cache.picture("TLS-Title-02")
when :横线
bitmap = Cache.picture("TLS-Title-Line")
when :that
bitmap = Cache.picture("TLS-Title-03")
when :tear
bitmap = Cache.picture("TLS-True-Title-02")
when :last_forever
bitmap = Cache.picture("TLS-Title-04")
when :copyright
bitmap = Cache.picture("TLS-Title-C")
when :ver
bitmap = Cache.picture("TLS-Title-Alpha")
end
@logo[key].bitmap = bitmap
end
def calc_target(start_val, end_val, percent)
return start_val + ((end_val - start_val) * percent)
end
def refresh
d = SLIDE_COUNT[:chn]
count = 0
loop do
percent = count / d
@logo[:那份].y = calc_target(POS_TEXT, 0, percent)
@logo[:那份].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(60)
if clear?
count = 0
loop do
percent = count / d
@logo[:泪水].y = calc_target(POS_TEXT, 0, percent)
@logo[:泪水].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(60)
end
count = 0
loop do
percent = count / d
@logo[:竟是永恒].y = calc_target(POS_TEXT, 0, percent)
@logo[:竟是永恒].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(60)
count = 0
loop do
percent = count / d
@logo[:横线].x = calc_target(POS_LINE, 0, percent)
@logo[:横线].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(60)
d = SLIDE_COUNT[:eng]
count = 0
loop do
percent = count / d
@logo[:that].x = calc_target(POS_TEXT, 0, percent)
@logo[:that].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(30)
if clear?
count = 0
loop do
percent = count / d
@logo[:tear].x = calc_target(POS_TEXT, 0, percent)
@logo[:tear].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(30)
end
count = 0
loop do
percent = count / d
@logo[:last_forever].x = calc_target(POS_TEXT, 0, percent)
@logo[:last_forever].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(30)
count = 0
loop do
percent = count / d
@logo[:copyright].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
count = 0
loop do
percent = count / d
@logo[:ver].opacity = calc_target(0, 255, percent)
count += 1
Graphics.update
break if count >= d
end
wait(60)
end
def wait(count)
count.times{|i| Graphics.update}
end
end
#encoding:utf-8 #============================================================================== # ■ Window_TitleCommand #------------------------------------------------------------------------------ # 标题画面中,选择“开始游戏/继续游戏”的窗口。 #============================================================================== class Window_TitleCommand < Window_Command COUNT = 30.0 def make_command @command = [] for i in 0...item_max @command[i] = Window_TitleSub.new(command_name(i), false) end end def refresh_command @command.each{|a| count = 0 loop do percent = count / COUNT a.x = calc_target(-30, 0, percent) a.opacity = calc_target(0, 255, percent) count += 1 SceneManager.scene.update if count >= COUNT a.open = true break end end } end def dispose super @command.each{|a| a.dispose} end def select(index) @command[self.index].refresh(false) if @command wait(15, self.index) if @command super(index) @command[self.index].refresh(true) if @command end def update super return unless @command @command.each{|a| a.update} end def wait(count, index = nil) count.times{|i| @command[index].update if index; SceneManager.scene.update} end def calc_target(start_val, end_val, percent) return start_val + ((end_val - start_val) * percent) end #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 0) self.visible = false select_symbol(:continue) if continue_enabled end def draw_item(i) end #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list add_command(Vocab::new_game, :new_game) add_command(Vocab::continue, :continue, continue_enabled) add_command(Vocab::shutdown, :shutdown) make_command end end
#encoding:utf-8
#==============================================================================
# ■ Window_TitleCommand
#------------------------------------------------------------------------------
# 标题画面中,选择“开始游戏/继续游戏”的窗口。
#==============================================================================
class Window_TitleCommand < Window_Command
COUNT = 30.0
def make_command
@command = []
for i in 0...item_max
@command[i] = Window_TitleSub.new(command_name(i), false)
end
end
def refresh_command
@command.each{|a|
count = 0
loop do
percent = count / COUNT
a.x = calc_target(-30, 0, percent)
a.opacity = calc_target(0, 255, percent)
count += 1
SceneManager.scene.update
if count >= COUNT
a.open = true
break
end
end
}
end
def dispose
super
@command.each{|a| a.dispose}
end
def select(index)
@command[self.index].refresh(false) if @command
wait(15, self.index) if @command
super(index)
@command[self.index].refresh(true) if @command
end
def update
super
return unless @command
@command.each{|a| a.update}
end
def wait(count, index = nil)
count.times{|i| @command[index].update if index; SceneManager.scene.update}
end
def calc_target(start_val, end_val, percent)
return start_val + ((end_val - start_val) * percent)
end
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0)
self.visible = false
select_symbol(:continue) if continue_enabled
end
def draw_item(i)
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::new_game, :new_game)
add_command(Vocab::continue, :continue, continue_enabled)
add_command(Vocab::shutdown, :shutdown)
make_command
end
end
class Window_TitleSub < Window_Base POS = [-35, 35] COUNT = 30.0 attr_accessor :open def initialize(item = nil, on = false) super(0, 0, 24, 24) [url=home.php?mod=space&uid=257928]@open[/url] = false @on = on @ani_count = COUNT @command = [] @command[0] = Sprite.new @command[1] = Sprite.new case item when Vocab::new_game bitmap = "TLS-Title-Start-" when Vocab::continue bitmap = "TLS-Title-Continue-" when Vocab::shutdown bitmap = "TLS-Title-Exit-" end @command[0].bitmap = Cache.picture(bitmap + "0") @command[0].opacity = 0 @command[1].bitmap = Cache.picture(bitmap + "1") @command[1].opacity = 0 self.visible = false self.x = -30 end def x=(n) super(0) @command[0].x = n @command[1].x = n end def opacity=(n) super(n) @command[0].opacity = n end def dispose super @command.each{|a| a.dispose} end def refresh(on = @on) @on = on @ani_count = 0 end def calc_target(start_val, end_val, percent) return start_val + ((end_val - start_val) * percent) end def update super update_command end def _open? return @open end def update_command return unless _open? if @on if @ani_count < COUNT percent = @ani_count / COUNT @command[0].x = calc_target(0, POS[1], percent) @command[0].opacity = calc_target(255, 0, percent) @command[1].x = calc_target(POS[0], 0, percent) @command[1].opacity = calc_target(0, 255, percent) @ani_count += 1 else @command[0].x = POS[0] @command[0].opacity = 0 @command[1].x = 0 @command[1].opacity = 255 end else if @ani_count < COUNT percent = @ani_count / COUNT @command[1].x = calc_target(0, POS[1], percent) @command[1].opacity = calc_target(255, 0, percent) @command[0].x = calc_target(POS[0], 0, percent) @command[0].opacity = calc_target(0, 255, percent) @ani_count += 1 else @command[1].x = POS[0] @command[1].opacity = 0 @command[0].x = 0 @command[0].opacity = 255 end end end end
class Window_TitleSub < Window_Base
POS = [-35, 35]
COUNT = 30.0
attr_accessor :open
def initialize(item = nil, on = false)
super(0, 0, 24, 24)
[url=home.php?mod=space&uid=257928]@open[/url] = false
@on = on
@ani_count = COUNT
@command = []
@command[0] = Sprite.new
@command[1] = Sprite.new
case item
when Vocab::new_game
bitmap = "TLS-Title-Start-"
when Vocab::continue
bitmap = "TLS-Title-Continue-"
when Vocab::shutdown
bitmap = "TLS-Title-Exit-"
end
@command[0].bitmap = Cache.picture(bitmap + "0")
@command[0].opacity = 0
@command[1].bitmap = Cache.picture(bitmap + "1")
@command[1].opacity = 0
self.visible = false
self.x = -30
end
def x=(n)
super(0)
@command[0].x = n
@command[1].x = n
end
def opacity=(n)
super(n)
@command[0].opacity = n
end
def dispose
super
@command.each{|a| a.dispose}
end
def refresh(on = @on)
@on = on
@ani_count = 0
end
def calc_target(start_val, end_val, percent)
return start_val + ((end_val - start_val) * percent)
end
def update
super
update_command
end
def _open?
return @open
end
def update_command
return unless _open?
if @on
if @ani_count < COUNT
percent = @ani_count / COUNT
@command[0].x = calc_target(0, POS[1], percent)
@command[0].opacity = calc_target(255, 0, percent)
@command[1].x = calc_target(POS[0], 0, percent)
@command[1].opacity = calc_target(0, 255, percent)
@ani_count += 1
else
@command[0].x = POS[0]
@command[0].opacity = 0
@command[1].x = 0
@command[1].opacity = 255
end
else
if @ani_count < COUNT
percent = @ani_count / COUNT
@command[1].x = calc_target(0, POS[1], percent)
@command[1].opacity = calc_target(255, 0, percent)
@command[0].x = calc_target(POS[0], 0, percent)
@command[0].opacity = calc_target(0, 255, percent)
@ani_count += 1
else
@command[1].x = POS[0]
@command[1].opacity = 0
@command[0].x = 0
@command[0].opacity = 255
end
end
end
end
class Scene_Title < Scene_Base def post_start super @logo.refresh @command_window.refresh_command end alias shiina_c_c_w create_command_window def create_command_window @logo = Window_TitleLogo.new shiina_c_c_w end end
class Scene_Title < Scene_Base
def post_start
super
@logo.refresh
@command_window.refresh_command
end
alias shiina_c_c_w create_command_window
def create_command_window
@logo = Window_TitleLogo.new
shiina_c_c_w
end
end
一共是上面四段脚本
我希望出现的效果在事件标题已经做到了 但是现在转到脚本上有点问题
第一是选项滑动开始的时候开始和退出会同时滚动
第二是如果按住上/下键会出现鬼畜效果
选项滑动在事件中有样子已经提供工程附件
跳过标题脚本已经禁用
望大神指点
链接: http://pan.baidu.com/s/1jGA9uLo 密码: 1iow
@taroxd @喵呜喵5 @VIPArcher |
|