| 赞 | 274 |
| VIP | |
| 好人卡 | |
| 积分 | 496 |
| 经验 | |
| 最后登录 | 2024-6-21 |
| 在线时间 | 1919 小时 |
- 梦石
- 10
- 星屑
- 39550
- 在线时间
- 1919 小时
- 注册时间
- 2010-11-14
- 回帖
- 3214

|
发表于 2019-6-27 17:46:46
|
显示全部楼层
- #encoding:utf-8
- #==============================================================================
- # ■ Window_Message
- #------------------------------------------------------------------------------
- # 显示文字信息的窗口。
- #==============================================================================
-
- class Window_Message < Window_Base
- #--------------------------------------------------------------------------
- # ● [覆盖]处理输入等待
- #--------------------------------------------------------------------------
- def input_pause
- self.pause = true
- wait(10)
- #==================================================================
- while !(Input.trigger?(:B) || Input.trigger?(:C))
- if Scene_Map === (s = SceneManager.scene)
- CLD99::COMMON_EVENT[15] if Input.trigger?(:X)
- end
- Fiber.yield
- end
- #==================================================================
- Input.update
- self.pause = false
- end
- end
-
- class Scene_Map
- def update_spriteset(duration)
- duration.times do
- Graphics.update
- @spriteset.update
- end
- end
- end
- module CLD99
- module COMMON_EVENT
- class << self
- def [](n)
- send(sprintf("event_%03d", n))
- end
-
- def event_015
- RPG::SE.new("Absorb1", 90, 100).play
-
-
- $game_map.screen.pictures[2].show("sight2", 0, 0, 0, 100, 100, 255, 0)
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[3].show("sight3", 0, 0, 0, 100, 100, 255, 0)
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[4].show("sight4", 0, 0, 0, 100, 100, 255, 0)
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[5].show("sight5", 0, 0, 0, 100, 100, 255, 0)
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[6].show("dark", 0, 0, 0, 100, 100, 255, 0)
- SceneManager.scene.update_spriteset(2)
-
- if $game_switches[180]
- $game_map.screen.start_tone_change(Tone.new(0,0,17,34), 1)
- else
- $game_map.screen.start_tone_change(Tone.new(0,0,17,187), 1)
- end
- $game_switches[180] = !$game_switches[180]
-
- $game_map.screen.pictures[6].erase
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[5].erase
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[4].erase
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[3].erase
- SceneManager.scene.update_spriteset(2)
- $game_map.screen.pictures[2].erase
- end
- end
- end
- end
复制代码
所以情况复杂了以后就没那么简单了。
因为一次执行中涉及到图像的动态变化(需要不断更新才能显示出变化),必须手动在流程中加入update
为了防止代码太长,我把update做成了Scene_Map里的方法
如果不好理解的话,只要把SceneManager.scene.update_spriteset(n)当做刷新图片显示 并等待n帧 就好
另外,由于Game_Picture规定的图片z值最大不能超过100,而对话框的z值是200
所以你的“眨眼”图片会被对话框盖住。
这是RM机制的问题,如果不想这样的话就只能自己弄精灵自己设定更大的Z值。
|
评分
-
查看全部评分
|