Project1
标题:
[VA] 窗口翻页书声
[打印本页]
作者:
柍若
时间:
2014-2-8 16:40
标题:
[VA] 窗口翻页书声
本帖最后由 柍若 于 2014-2-8 16:43 编辑
L/R键翻页的时候播放翻书音效。
(L/R键对应键盘Q/W)
直接插入Main前即可
# ■ 翻页书声 - By 柍若
class Window_Selectable < Window_Base
def cursor_pagedown
if top_row + page_row_max < row_max
page_up_and_down
self.top_row += page_row_max
select([[url=home.php?mod=space&uid=370741]@Index[/url] + page_item_max, item_max - 1].min)
end
end
def cursor_pageup
if top_row > 0
page_up_and_down
self.top_row -= page_row_max
select([[url=home.php?mod=space&uid=370741]@Index[/url] - page_item_max, 0].max)
end
end
def change_page
Audio.se_play('Audio/SE/Book2',80,100)
end
def page_up_and_down
Audio.se_play('Audio/SE/Book1',85,100)
end
def process_cursor_move
return unless cursor_movable?
last_index = @index
cursor_down (Input.trigger?(:DOWN)) if Input.repeat?(:DOWN)
cursor_up (Input.trigger?(:UP)) if Input.repeat?(:UP)
cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
cursor_left (Input.trigger?(:LEFT)) if Input.repeat?(:LEFT)
cursor_pagedown if !handle?(:pagedown) && Input.trigger?(:R)
cursor_pageup if !handle?(:pageup) && Input.trigger?(:L)
Sound.play_cursor unless Input.trigger?(:R) or Input.trigger?(:L) or [url=home.php?mod=space&uid=370741]@Index[/url] == last_index
end
def process_pageup
change_page
Input.update
deactivate
call_handler(:pageup)
end
def process_pagedown
change_page
Input.update
deactivate
call_handler(:pagedown)
end
end
复制代码
作者:
子弹君
时间:
2014-2-28 19:13
这个和书籍阅读系统放在一起岂不是更好?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1