Project1

标题: 求“地图名显示”和“菜单美化”脚本。。。。。。。。... [打印本页]

作者: 嘉凉    时间: 2016-5-21 09:44
标题: 求“地图名显示”和“菜单美化”脚本。。。。。。。。...
地图名显示一直没有找到自己想要的,我需要一个左上方一直显示地图名的脚本,不需要图片就能显示的那种,坐标显示也不要。
菜单美化主要是更改对话框和菜单栏之类的透明度,请问这个谁有呢??0 0
作者: crow2006    时间: 2016-5-21 10:16
  1. #==============================================================================
  2. # ■ Window_MapName 显示地图名称
  3. #==============================================================================

  4. class Window_MapName < Window_Base
  5. #--------------------------------------------------------------------------
  6. # ● 初始化
  7. #--------------------------------------------------------------------------
  8. def initialize
  9. @map_id = $game_map.map_id
  10. super(0, 0, 182, 52)
  11. self.contents.font.size = 20
  12. self.z = 151
  13. refresh
  14. end
  15. #--------------------------------------------------------------------------
  16. # ● 刷新
  17. #--------------------------------------------------------------------------
  18. def refresh
  19. self.contents_opacity = 255
  20. name = $data_mapinfos[@map_id].name
  21. width = self.contents.text_size(name).width
  22. height = self.contents.text_size(name).height
  23. self.width = width + 32
  24. self.height = height + 32
  25. self.contents = Bitmap.new(width, height)
  26. self.contents.font.size = 20
  27. self.contents.font.color = text_color(0)
  28. self.x = 0
  29. self.y = 0
  30. self.contents.draw_text(0, 0, width, 20, name, 1)
  31. self.opacity = 255
  32. end
  33. #--------------------------------------------------------------------------
  34. # ● 更新
  35. #--------------------------------------------------------------------------
  36. def update
  37. if $game_map.map_id != @map_id
  38. @map_id = $game_map.map_id
  39. refresh
  40. self.opacity -= 5
  41. self.contents_opacity = 255
  42. end
  43. return if self.opacity == 0
  44. self.opacity = 0
  45. self.contents_opacity = 255  
  46. end
  47. end

  48. class Scene_Title < Scene_Base
  49. #--------------------------------------------------------------------------
  50. # ● 数据库载入
  51. #--------------------------------------------------------------------------
  52. alias old_ld load_database
  53. def load_database
  54. old_ld
  55. $data_mapinfos = load_data("Data/MapInfos.rvdata")
  56. end
  57. end

  58. class Scene_Map < Scene_Base
  59. #--------------------------------------------------------------------------
  60. # ● 开始
  61. #--------------------------------------------------------------------------
  62. alias old_start start
  63. def start
  64. old_start
  65. @mapname_window = Window_MapName.new
  66. end
  67. #--------------------------------------------------------------------------
  68. # ● 结束
  69. #--------------------------------------------------------------------------
  70. alias old_ter terminate
  71. def terminate
  72. old_ter
  73. @mapname_window.dispose
  74. end
  75. #--------------------------------------------------------------------------
  76. # ● 更新
  77. #--------------------------------------------------------------------------
  78. alias old_update update
  79. def update
  80. old_update
  81. @mapname_window.update
  82. end
  83. end
复制代码

作者: 嘉凉    时间: 2016-5-21 15:21
crow2006 发表于 2016-5-21 10:16

诶,背后的边框能不能一直在




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1