Project1
标题: 显示先后问题 [打印本页]
作者: sblkhgm 时间: 2012-4-7 15:09
标题: 显示先后问题
本帖最后由 sblkhgm 于 2012-4-7 15:18 编辑
怎样让这 10号动画 显示在 图片和坐标文字的后面
- ]#==============================================================================
- # ■ Scene_Map
- #------------------------------------------------------------------------------
- # 处理地图画面的类。
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 地图窗口
- #@map_window = Window_Map.new
- #@map_window.visible = $game_temp.map_visible
- # 生成活动块
- @spriteset = Spriteset_Map.new
- # 生成快捷窗口
- @goods_window = Window_Goods.new
- # 生成头像窗口
- @head_window = Window_Head.new
- @head_window.x = 370
- @head_window.y = -16
- # 生成信息窗口
- @message_window = Window_Message.new
- # 执行过渡
- Graphics.transition
- #小提示
- #●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
- @xy_skin = Sprite.new
- @xy_skin.bitmap = RPG::Cache.windowskin("win_xy")
- @xy_info = Sprite.new
- @xy_info.bitmap = Bitmap.new(118,79)
- @xy_info.bitmap.font = Font.new("宋体",14)
- @xy_info.bitmap.draw_text(20, 14, 77, 17, $game_map.name, 1)
- @xy_x = $game_player.x
- @xy_y = $game_player.y
- txt = "X:" + $game_player.x.to_s + " Y:" + $game_player.y.to_s
- @xy_info.bitmap.draw_text(2, 63, 116, 16, txt, 1)
-
- @l_animation = RPG::Sprite.new
- @l_animation.loop_animation($data_animations[10])
- @l_animation.x = 0
- @l_animation.y = 10
- # 主循环
- loop do
- @l_animation.update
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放活动块
- @spriteset.dispose
- # 释放信息窗口
- @message_window.dispose
-
- #释放头像窗口
- @head_window.dispose
- #释放地图窗口
- #@map_window.dispose
- @goods_window.dispose
- @xy_skin.bitmap.dispose
- @xy_skin.dispose
- @xy_info.bitmap.dispose
- @xy_info.dispose
- RPG::Cache.clear
- # 标题画面切换中的情况下
- if $scene.is_a?(Scene_Title)
- # 淡入淡出画面
- Graphics.transition
- Graphics.freeze
- end
- end
- #--------------------------------------------------------------------------
- # ● 显示UI界面
- #--------------------------------------------------------------------------
- def show_ui(show = true)
- if show
- @head_window.visible = true
- @goods_window.all_visible(true)
- $message_sprite_background.visible = true
- $message_sprite.visible = true
- @xy_skin.visible = true
- @xy_info.visible = true
- else
- @head_window.visible = false
- @goods_window.all_visible(false)
- $message_sprite_background.visible = false
- $message_sprite.visible = false
- @xy_skin.visible = false
- @xy_info.visible = false
- end
- return
- end
- #--------------------------------------------------------------------------
- # ● 刷新头像窗口
- #--------------------------------------------------------------------------
- def update_head
- @head_window.refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 循环
- loop do
- # 按照地图、实例、主角的顺序刷新
- # (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动
- # 的机会的重要因素)
- $game_map.update
- $game_system.map_interpreter.update
- $game_player.update
- # 系统 (计时器)、画面刷新
- $game_system.update
- $game_screen.update
- # 如果主角在场所移动中就中断循环
- unless $game_temp.player_transferring
- break
- end
- # 执行场所移动
- transfer_player
- # 处理过渡中的情况下、中断循环
- if $game_temp.transition_processing
- break
- end
- end
- #不显示界面UI
- if Kboard.keyboard($R_Key_TAB)
- if @head_window.visible
- @head_window.visible = false
- @goods_window.all_visible(false)
- $message_sprite_background.visible = false
- $message_sprite.visible = false
- @xy_skin.visible = false
- @xy_info.visible = false
- else
- @head_window.visible = true
- @goods_window.all_visible(true)
- $message_sprite_background.visible = true
- $message_sprite.visible = true
- @xy_skin.visible = true
- @xy_info.visible = true
- end
- elsif Kboard.keyboard($R_Key_F4)
- Screen::shot1
- Audio.se_play("Audio/SE/"+"camera",100,100)
- end
- #@goods_window.update
- # 刷新活动块
- @spriteset.update
- # 刷新信息窗口
- @message_window.update
- if @xy_x != $game_player.x or @xy_y != $game_player.y
- @xy_x = $game_player.x
- @xy_y = $game_player.y
- txt = "X:" + @xy_x.to_s + " Y:" + @xy_y.to_s
- #如果坐标信息为显示时
- if @xy_info.visible
- @xy_info.bitmap.clear
- @xy_info.bitmap.draw_text(20, 14, 77, 17, $game_map.name, 1)
- @xy_info.bitmap.draw_text(2, 63, 116, 16, txt, 1)
- end
- end
- # 游戏结束的情况下
- if $game_temp.gameover
- # 切换的游戏结束画面
- $scene = Scene_Gameover.new
- return
- end
- # 返回标题画面的情况下
- if $game_temp.to_title
- # 切换到标题画面
- $scene = Scene_Title.new
- return
- end
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除过渡处理中标志
- $game_temp.transition_processing = false
- # 执行过渡
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- # 显示信息窗口中的情况下
- if $game_temp.message_window_showing
- return
- end
- # 遇敌计数为 0 且、且遇敌列表不为空的情况下
- if $game_player.encounter_count == 0 and $game_map.encounter_list != []
- # 不是在事件执行中或者禁止遇敌中
- unless $game_system.map_interpreter.running? or
- $game_system.encounter_disabled
- # 确定队伍
- n = rand($game_map.encounter_list.size)
- troop_id = $game_map.encounter_list[n]
- # 队伍有效的话
- if $data_troops[troop_id] != nil
- # 设置调用战斗标志
- $game_temp.battle_calling = true
- $game_temp.battle_troop_id = troop_id
- $game_temp.battle_can_escape = true
- $game_temp.battle_can_lose = false
- $game_temp.battle_proc = nil
- end
- end
- end
- unless $game_system.map_interpreter.running? or $game_system.menu_disabled
- if Kboard.keyb($R_Key_ALT) == 1 and Kboard.keyb($R_Key_Q) == 1 and $anzhu == nil
- $game_system.se_play($data_system.decision_se)
- $anzhu = 1
- $scene = Scene_Task.new
- elsif Kboard.keyb($R_Key_ALT) == 1 and Kboard.keyb($R_Key_E) == 1 and $anzhu == nil
- $game_system.se_play($data_system.decision_se)
- $anzhu = 1
- $scene = Scene_Item.new
- elsif Kboard.keyb($R_Key_ALT) == 1 and Kboard.keyb($R_Key_I) == 1 and $anzhu == nil
- $anzhu = 1
- p $game_map.map_id
- end
- if $anzhu == 1
- $anzhu = nil
- end
- end
- # 按下 B 键的情况下
- #●●●●●●●●●●●屏蔽鼠标右键打开菜单●●●●●●●●●●●●●●●●
- #加入判断鼠标没有点击右键的情况下
- if Input.trigger?(Input::B) and not Mouse.trigger?(Mouse::RIGHT)
- # 不是在事件执行中或菜单禁止中
- unless $game_system.map_interpreter.running? or
- $game_system.menu_disabled
- # 设置菜单调用标志以及 SE 演奏
- $game_temp.menu_calling = true
- $game_temp.menu_beep = true
- end
- end
- #●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
- # 不是在事件执行中或菜单禁止中
- unless $game_system.map_interpreter.running? or
- $game_system.menu_disabled
- mouse_x, mouse_y = Mouse.get_mouse_pos
- #选中了宝宝
- if mouse_x> 389 and mouse_x< 430 and mouse_y> 0 and mouse_y< 41
- @head_window.refresh_baby
- #选中了人物
- elsif mouse_x> 510 and mouse_x< 564 and mouse_y> 0 and mouse_y< 53
- @head_window.refresh_actor
- #选中了道具
- elsif mouse_x> 330 and mouse_x< 370 and mouse_y> 430 and mouse_y< 470
- @goods_window.draw_goods
- #选中了任务
- elsif mouse_x> 483 and mouse_x< 503 and mouse_y> 424 and mouse_y< 467
- @goods_window.draw_task
- #选中了系统
- elsif mouse_x> 585 and mouse_x< 629 and mouse_y> 423 and mouse_y< 467
- @goods_window.draw_system
-
-
- else
- #如果窗口状态不是默认状态
- if @head_window.state != 0
- @head_window.refresh
- end
- if @goods_window.state != 0
- @goods_window.refresh
- end
- end
- end
- # 调试模式为 ON 并且按下 F9 键的情况下
- if $DEBUG and Input.press?(Input::F9)
- # 设置调用调试标志
- $game_temp.debug_calling = true
- end
- # 不在主角移动中的情况下
- unless $game_player.moving?
- # 执行各种画面的调用
- if $game_temp.battle_calling
- call_battle
- elsif $game_temp.shop_calling
- call_shop
- elsif $game_temp.name_calling
- call_name
- elsif $game_temp.menu_calling
- call_menu
- elsif $game_temp.save_calling
- call_save
- elsif $game_temp.debug_calling
- call_debug
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 调用战斗
- #--------------------------------------------------------------------------
- def call_battle
- # 清除战斗调用标志
- $game_temp.battle_calling = false
- # 清除菜单调用标志
- $game_temp.menu_calling = false
- $game_temp.menu_beep = false
- # 生成遇敌计数
- $game_player.make_encounter_count
- # 记忆地图 BGM 、停止 BGM
- $game_temp.map_bgm = $game_system.playing_bgm
- $game_system.bgm_stop
- # 演奏战斗开始 SE
- $game_system.se_play($data_system.battle_start_se)
- # 演奏战斗 BGM
- $game_system.bgm_play($game_system.battle_bgm)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到战斗画面
- $scene = Scene_Battle.new
- end
- #--------------------------------------------------------------------------
- # ● 调用商店
- #--------------------------------------------------------------------------
- def call_shop
- # 清除商店调用标志
- $game_temp.shop_calling = false
- # 矫正主角姿势
- $game_player.straighten
- # 切换到商店画面
- $scene = Scene_Shop.new
- end
- #--------------------------------------------------------------------------
- # ● 调用名称输入
- #--------------------------------------------------------------------------
- def call_name
- # 清除商店调用名称输入标志
- $game_temp.name_calling = false
- # 矫正主角姿势
- $game_player.straighten
- # 切换到名称输入画面
- $scene = Scene_Name.new
- end
- #--------------------------------------------------------------------------
- # ● 调用菜单
- #--------------------------------------------------------------------------
- def call_menu
- # 清除商店调用菜单标志
- $game_temp.menu_calling = false
- # 已经设置了菜单 SE 演奏标志的情况下
- if $game_temp.menu_beep
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 清除菜单演奏 SE 标志
- $game_temp.menu_beep = false
- end
- # 矫正主角姿势
- $game_player.straighten
- # 切换到菜单画面
- $scene = Scene_Menu.new
- #$scene = Scene_Baby.new
- end
- #--------------------------------------------------------------------------
- # ● 调用存档
- #--------------------------------------------------------------------------
- def call_save
- # 矫正主角姿势
- $game_player.straighten
- # 切换到存档画面
- $scene = Scene_Save.new
- end
- #--------------------------------------------------------------------------
- # ● 调用调试
- #--------------------------------------------------------------------------
- def call_debug
- # 清除商店调用调试标志
- $game_temp.debug_calling = false
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 矫正主角姿势
- $game_player.straighten
- # 切换到调试画面
- $scene = Scene_Debug.new
- end
- #--------------------------------------------------------------------------
- # ● 主角的场所移动
- #--------------------------------------------------------------------------
- def transfer_player
- # 清除主角场所移动调试标志
- $game_temp.player_transferring = false
- # 移动目标与现在的地图有差异的情况下
- if $game_map.map_id != $game_temp.player_new_map_id
- # 设置新地图
- $game_map.setup($game_temp.player_new_map_id)
- end
- # 设置主角位置
- $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
- # 设置主角朝向
- case $game_temp.player_new_direction
- when 2 # 下
- $game_player.turn_down
- when 4 # 左
- $game_player.turn_left
- when 6 # 右
- $game_player.turn_right
- when 8 # 上
- $game_player.turn_up
- end
- # 矫正主角姿势
- $game_player.straighten
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 在生成活动块(配合双远景图)
- #●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
- #循环释放8个地图精灵
- for i in 0..8
- if @spriteset.panorama.bitmap != nil
- @spriteset.panorama.bitmap.dispose
- end
- if @spriteset.panorama2.bitmap != nil
- @spriteset.panorama2.bitmap.dispose
- end
- end
- if @spriteset.plane.bitmap != nil
- @spriteset.plane.bitmap.dispose
- end
- if @spriteset.plane2.bitmap != nil
- @spriteset.plane2.bitmap.dispose
- end
- @spriteset.dispose
- @spriteset = Spriteset_Map.new
- #垃圾回收
- RPG::Cache.clear
- # 生成快捷窗口
- @goods_window.dispose
- @goods_window = Window_Goods.new
- @xy_skin.bitmap.dispose
- @xy_skin.dispose
- @xy_info.bitmap.dispose
- @xy_info.dispose
- @xy_skin = Sprite.new
- @xy_skin.bitmap = RPG::Cache.windowskin("win_xy")
- @xy_info = Sprite.new
- @xy_info.bitmap = Bitmap.new(118,79)
- @xy_info.bitmap.font = Font.new("宋体",14)
- @xy_info.bitmap.draw_text(20, 14, 77, 17, $game_map.name, 1)
- @xy_x = $game_player.x
- @xy_y = $game_player.y
- txt = "X:" + $game_player.x.to_s + " Y:" + $game_player.y.to_s
- @xy_info.bitmap.draw_text(2, 63, 116, 16, txt, 1)
- #●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
- # 处理过渡中的情况下
- if $game_temp.transition_processing
- # 清除过渡处理中标志
- $game_temp.transition_processing = false
- # 执行过渡
- Graphics.transition(20)
- end
- # 执行地图设置的 BGM、BGS 的自动切换
- $game_map.autoplay
- # 设置画面
- Graphics.frame_reset
- # 刷新输入信息
- Input.update
- end
- #--------------------------------------------------------------------------
- # ● 随机获得小提示文字
- #--------------------------------------------------------------------------
-
- end
- end
复制代码