Project1

标题: 如何改变菜单命令窗口的透明度 [打印本页]

作者: 2578699    时间: 2010-11-15 12:53
标题: 如何改变菜单命令窗口的透明度
我想把菜单命令窗口变成透明的。

请帮帮忙......
作者: 沙之爱罗    时间: 2010-11-15 12:56
半透明菜单脚本
  1. module Opacity_Menu
  2.   def create_screen
  3.     @screen = Spriteset_Map.new
  4.   end
  5.   def dispose_screen
  6.     @screen.dispose
  7.   end
  8. end

  9. class Window_Base < Window
  10.   def initialize(x, y, width, height)
  11.     super()
  12.     @windowskin_name = $game_system.windowskin_name
  13.     self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  14.     self.x = x
  15.     self.y = y
  16.     self.width = width
  17.     self.height = height
  18.     self.z = 100
  19.     if $scene.is_a?(Scene_Menu) or
  20.       $scene.is_a?(Scene_Item) or
  21.       $scene.is_a?(Scene_Skill) or
  22.       $scene.is_a?(Scene_Equip) or
  23.       $scene.is_a?(Scene_Status) or
  24.       $scene.is_a?(Scene_Save) or
  25.       $scene.is_a?(Scene_End) or
  26.       $scene.is_a?(Scene_Shop)
  27.       self.back_opacity = 160
  28.     end
  29.   end
  30. end

  31. class Scene_Menu
  32.   include Opacity_Menu
  33.   alias main_old main
  34.   def main
  35.     create_screen
  36.     main_old
  37.     dispose_screen
  38.   end
  39. end

  40. class Scene_Item
  41.   include Opacity_Menu
  42.   alias main_old main
  43.   def main
  44.     create_screen
  45.     main_old
  46.     dispose_screen
  47.   end
  48. end

  49. class Scene_Skill
  50.   include Opacity_Menu
  51.   alias main_old main
  52.   def main
  53.     create_screen
  54.     main_old
  55.     dispose_screen
  56.   end
  57. end

  58. class Scene_Equip
  59.   include Opacity_Menu
  60.   alias main_old main
  61.   def main
  62.     create_screen
  63.     main_old
  64.     dispose_screen
  65.   end
  66. end

  67. class Scene_Status
  68.   include Opacity_Menu
  69.   alias main_old main
  70.   def main
  71.     create_screen
  72.     main_old
  73.     dispose_screen
  74.   end
  75. end

  76. class Scene_Save
  77.   include Opacity_Menu
  78.   alias main_old main
  79.   def main
  80.     create_screen
  81.     main_old
  82.     dispose_screen
  83.   end
  84. end

  85. class Scene_End
  86.   include Opacity_Menu
  87.   alias main_old main
  88.   def main
  89.     create_screen
  90.     main_old
  91.     dispose_screen
  92.   end
  93. end

  94. class Scene_Shop
  95.   include Opacity_Menu
  96.   alias main_old main
  97.   def main
  98.     create_screen
  99.     main_old
  100.     dispose_screen
  101.   end
  102. end
复制代码

作者: Wind2010    时间: 2010-11-15 12:58
  1. @command_window.opacity = 150#菜单透明度
复制代码
直接把这个复制到Scene_Menu里……
作者: 2578699    时间: 2010-11-16 12:52
谢谢




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