设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1538|回复: 2
打印 上一主题 下一主题

[已经过期] 关于怪物图签窗口的问题。。。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1288
在线时间
354 小时
注册时间
2009-9-14
帖子
328
跳转到指定楼层
1
发表于 2015-3-23 18:36:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我默认的窗口外观图形是一个半透明的图片。。。
所以用这个怪物图签的时候,,就会像下面这样,,,
由于是半透明的,,,所以看起来很乱。。。

脚本如下,请问如何能让怪物介绍的界面不是半透明,
或者怪物介绍的界面出来的时候,把怪物列表那个界面变成一个没有文字的背景
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #——————————————————————————————————————
  5. #魔物图鉴+介绍
  6. #
  7. #战斗终了时自动添加敌人进入图鉴(class Scene_Battle start_phase5 追加。目前与各种战斗系统没有发现冲突)
  8. #不想加入图鉴的怪物设置其“不加入图鉴”属性有效度为A即可
  9. #图鉴完成度的表示功能追加
  10. #SHOW_COMPLETE_TYPE 的数值可以设定
  11. #当为1,显示现有个数/总数,当为2,显示完成百分比,当为3,全显示。
  12. #使用方法:$scene = Scene_MonsterBook.new
  13. #数据库中属性里面那些种族特效的位置,建议把默认的“对 不死”之类改成“不死”,不然显示会很奇怪
  14. #由于雷达图的设计问题,只支持8项属性
  15. #默认种族特效处理属性中编号9到编号16,如果你做了修改请自行改动380行左右的for i in 9..16这一句代码
  16. #显示各种信息位于630行左右,想不显示的话只要删除相应语句
  17. CHARA_INFO=[]#怪物的介绍,对应怪物id,空格为换行,同时也会自动换行,没有写介绍的怪物会自动显示“无详细信息”
  18. CHARA_INFO[1] = "怪物介绍1"
  19. CHARA_INFO[3] = "生活在潮湿的沼泽地区的变异生物,性情凶暴,经常会袭击各种路过的生物"
  20. #没有信息测试,4号怪物
  21. #=============
  22. #雷达图相关处理部分
  23. #=============
  24. class Bitmap
  25. def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  26. distance = (start_x - end_x).abs + (start_y - end_y).abs
  27. if end_color == start_color
  28. for i in 1..distance
  29. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  30. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  31. if width == 1
  32. self.set_pixel(x, y, start_color)
  33. else
  34. self.fill_rect(x, y, width, width, start_color)
  35. end
  36. end
  37. else
  38. for i in 1..distance
  39. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  40. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  41. r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  42. g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  43. b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  44. a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  45. if width == 1
  46. self.set_pixel(x, y, Color.new(r, g, b, a))
  47. else
  48. self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  49. end
  50. end
  51. end
  52. end
  53. end
  54. #=============
  55. # Graphic_Def_Elem
  56. #=============
  57. class Window_Base
  58. FONT_SIZE = 18
  59. WORD_ELEMENT_GUARD = "属性有效度"
  60. NUMBER_OF_ELEMENTS = 8
  61. ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
  62. GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
  63. GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
  64. GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
  65. GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
  66. GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
  67. end
  68.  
  69. #——————————————————————————————————————
  70. module Enemy_Book_Config
  71. DROP_ITEM_NEED_ANALYZE = true #显示物品
  72. EVA_NAME = "回避修正"              #回避修正的名称(因为数据库中没有定义)
  73. SHOW_COMPLETE_TYPE = 3         #图鉴完成率表示方法
  74. end
  75. class Data_MonsterBook
  76. #--------------------------------------------------------------------------
  77. # ● 图鉴用ID設定
  78. #--------------------------------------------------------------------------
  79. def enemy_book_id_set
  80.     data = [0]
  81.     data[1] = 2
  82.     data[2] = 1
  83.     data[3] = 15
  84.     data[4] = 25
  85.     data[5] = 18
  86.     data[6] = 30
  87.     return data
  88. end
  89. end
  90. class Game_Temp
  91. attr_accessor :enemy_book_data
  92. alias temp_enemy_book_data_initialize initialize
  93. def initialize
  94.     temp_enemy_book_data_initialize
  95.     @enemy_book_data = Data_MonsterBook.new
  96. end
  97. end
  98.  
  99. class Game_Party
  100. #==============================================
  101. #--------------------------------------------------------------------------
  102.    # ● 公開インスタンス変数
  103.    #--------------------------------------------------------------------------
  104.    attr_reader   :actors                   # アクター
  105.    attr_reader   :gold                     # ゴールド
  106.    attr_reader   :steps                    # 歩数
  107.  
  108.    #--------------------------------------------------------------------------
  109.    # ● オブジェクト初期化
  110.    #--------------------------------------------------------------------------
  111.    def initialize
  112.      # アクターの配列を作成
  113.      @actors = []
  114.      # ゴールドと歩数を初期化
  115.      @gold = 0
  116.      @steps = 0
  117.      # アイテム、武器、防具の所持数ハッシュを作成
  118.      @items = {}
  119.      @weapons = {}
  120.      @armors = {}
  121.    end
  122. #==============================================
  123. attr_accessor :enemy_info               # 出会った敵情報(図鑑用)
  124.  
  125. #--------------------------------------------------------------------------
  126. # ● オブジェクト初期化
  127. #--------------------------------------------------------------------------
  128. alias book_info_initialize initialize
  129. def initialize
  130.     book_info_initialize
  131.     @enemy_info = {}
  132. end
  133.  
  134. #--------------------------------------------------------------------------
  135. # ● エネミー情報の追加(図鑑用)
  136. #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
  137. #     0:無遭遇 1:遭遇済 2:アナライズ済
  138. #--------------------------------------------------------------------------
  139. def add_enemy_info(enemy_id, type = 0)
  140.     case type
  141.     when 0
  142.       if @enemy_info[enemy_id] == 2
  143.         return false
  144.       end
  145.       @enemy_info[enemy_id] = 1
  146.     when 1
  147.       @enemy_info[enemy_id] = 2
  148.     when -1
  149.       @enemy_info[enemy_id] = 0
  150.     end
  151. end
  152. #--------------------------------------------------------------------------
  153. # ● 魔物図鑑の最大登録数を取得
  154. #--------------------------------------------------------------------------
  155. def enemy_book_max
  156.     return $game_temp.enemy_book_data.id_data.size - 1
  157. end
  158. #--------------------------------------------------------------------------
  159. # ● 魔物図鑑の現在登録数を取得
  160. #--------------------------------------------------------------------------
  161. def enemy_book_now
  162.     now_enemy_info = @enemy_info.keys
  163.     # 登録無視の属性IDを取得
  164.     no_add = $game_temp.enemy_book_data.no_add_element
  165.     new_enemy_info = []
  166.     for i in now_enemy_info
  167.       enemy = $data_enemies[i]
  168.       next if enemy.name == ""
  169.       if enemy.element_ranks[no_add] == 1
  170.         next
  171.       end
  172.       new_enemy_info.push(enemy.id)
  173.     end
  174.     return new_enemy_info.size
  175. end
  176. #--------------------------------------------------------------------------
  177. # ● 魔物図鑑の完成率を取得
  178. #--------------------------------------------------------------------------
  179. def enemy_book_complete_percentage
  180.     e_max = enemy_book_max.to_f
  181.     e_now = enemy_book_now.to_f
  182.     comp = e_now / e_max * 100
  183.     return comp.truncate
  184. end
  185. end
  186.  
  187. class Interpreter
  188. def enemy_book_max
  189.     return $game_party.enemy_book_max
  190. end
  191. def enemy_book_now
  192.     return $game_party.enemy_book_now
  193. end
  194. def enemy_book_comp
  195.     return $game_party.enemy_book_complete_percentage
  196. end
  197. end
  198.  
  199. class Scene_Battle
  200. alias add_enemy_info_start_phase5 start_phase5
  201. def start_phase5
  202.     for enemy in $game_troop.enemies
  203.       # エネミーが隠れ状態でない場合
  204.       unless enemy.hidden
  205.         # 敵遭遇情報追加
  206.         $game_party.add_enemy_info(enemy.id, 0)
  207.       end
  208.     end
  209.     add_enemy_info_start_phase5
  210. end
  211. end
  212.  
  213. class Window_Base < Window
  214. #--------------------------------------------------------------------------
  215. # ● エネミーの戦闘後獲得アイテムの描画
  216. #--------------------------------------------------------------------------
  217. def draw_enemy_drop_item(enemy, x, y)
  218.     self.contents.font.color = normal_color
  219.     treasures = []
  220.     if enemy.item_id > 0
  221.       treasures.push($data_items[enemy.item_id])
  222.     end
  223.     if enemy.weapon_id > 0
  224.       treasures.push($data_weapons[enemy.weapon_id])
  225.     end
  226.     if enemy.armor_id > 0
  227.       treasures.push($data_armors[enemy.armor_id])
  228.     end
  229.     # 現状ではとりあえず1つのみ描画
  230.     if treasures.size > 0
  231.       item = treasures[0]
  232.       bitmap = RPG::Cache.icon(item.icon_name)
  233.       opacity = 255
  234.       self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  235.       name = treasures[0].name
  236.     else
  237.       self.contents.font.color = disabled_color
  238.       name = "无"
  239.     end
  240.     self.contents.draw_text(x+28, y, 212, 32, name)
  241. end
  242. #--------------------------------------------------------------------------
  243. # ● エネミーの図鑑IDの描画
  244. #--------------------------------------------------------------------------
  245. def draw_enemy_book_id(enemy, x, y)
  246.     self.contents.font.color = normal_color
  247.     id = $game_temp.enemy_book_data.id_data.index(enemy.id)
  248.     self.contents.draw_text(x, y, 32, 32, id.to_s)
  249. end
  250. #--------------------------------------------------------------------------
  251. # ● 敌人简介描绘
  252. #--------------------------------------------------------------------------
  253. def draw_enemy_other(enemy, x, y)
  254.     if CHARA_INFO[enemy.id]==nil
  255.      CHARA_INFO[enemy.id] = "没有相关资料"
  256.   end
  257.     self.contents.font.size=16
  258.     x+=self.contents.text_size("").width
  259.     info = CHARA_INFO[enemy.id]
  260.     s=info.scan(/./)
  261.      #一行显示21个字
  262.      for i in s
  263.        sss = self.contents.text_size(i)
  264.  
  265.        if  i==" "
  266.         y+=16
  267.          x=0
  268.        elsif (x+sss.width)>(width - 32-260)
  269.          y+=16
  270.          x=0
  271.          self.contents.draw_text(x, y, sss.width, sss.height, i)
  272.          x+=sss.width
  273.        else
  274.        self.contents.draw_text(x, y, sss.width, sss.height, i)
  275.        x+=sss.width
  276.        end
  277.      end
  278.    end
  279.     #--------------------------------------------------------------------------
  280. # ● 敌人特技描绘
  281. #--------------------------------------------------------------------------
  282. def draw_enemy_action(enemy, x, y)
  283.     self.contents.font.size=16
  284.     yy=y
  285.     self.contents.font.color = system_color
  286.     self.contents.draw_text(x, yy, 999, 18,"技能列表")
  287.     self.contents.font.color = normal_color
  288.     for action in enemy.actions
  289.       yy+=18
  290.       if action.kind==0
  291.         case action.basic
  292.          when 0
  293.            ac="普通攻击"
  294.          when 1
  295.            ac="防御"
  296.          when 2
  297.            ac="逃跑"
  298.          when 3
  299.            ac="无"
  300.          end
  301.       self.contents.draw_text(x, yy, 999, 18, ac )
  302.       end
  303.       if action.kind==1
  304.       self.contents.draw_text(x, yy, 999, 18, $data_skills[action.skill_id].name )
  305.       end
  306.     end
  307. end
  308. #雷达图描绘
  309.    #=======================================================================================
  310.    def draw_actor_element_radar_graph(actor, x, y)
  311.      radius = 56
  312. cx = x + radius + FONT_SIZE + 48
  313. cy = y + radius + FONT_SIZE + 32
  314. self.contents.font.color = system_color
  315. self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
  316. for loop_i in 0..NUMBER_OF_ELEMENTS
  317. if loop_i == 0
  318.  
  319. else
  320. @pre_x = @now_x
  321. @pre_y = @now_y
  322. @pre_ex = @now_ex
  323. @pre_ey = @now_ey
  324. @color1 = @color2
  325. end
  326. if loop_i == NUMBER_OF_ELEMENTS
  327. eo = ELEMENT_ORDER[0]
  328. else
  329. eo = ELEMENT_ORDER[loop_i]
  330. end
  331. er = actor.element_rate(eo)
  332. estr = $data_system.elements[eo]
  333. @color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
  334. if er <0
  335.   then xsh=true
  336. else xsh=false
  337. end
  338. er = er.abs
  339. th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
  340. @now_x = cx + (radius * Math.cos(th)).floor
  341. @now_y = cy - (radius * Math.sin(th)).floor
  342. @now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
  343. @now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
  344. @now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
  345. @now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
  346. @now_ex = cx + (er*radius/100 * Math.cos(th)).floor
  347. @now_ey = cy - (er*radius/100 * Math.sin(th)).floor
  348. if loop_i == 0
  349. @pre_x = @now_x
  350. @pre_y = @now_y
  351. @pre_ex = @now_ex
  352. @pre_ey = @now_ey
  353. @color1 = @color2
  354. else
  355.  
  356. end
  357. next if loop_i == 0
  358. self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  359. self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
  360. self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  361. self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
  362. self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
  363. self.contents.font.size = FONT_SIZE
  364. if xsh == true
  365.   then self.contents.font.color = Color.new(100,255,128,128)
  366.    sdd="-"
  367. else self.contents.font.color = system_color
  368.    sdd=""
  369. end
  370. self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
  371. self.contents.font.color = Color.new(255,255,255,128)
  372. self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, sdd+er.to_s + "%", 2)
  373. end
  374. end
  375. #_----------------------------------------------
  376. def draw_race(enemy,x,y)
  377.        text="无"
  378.        text2="无"
  379.        for i in 9..18
  380.          if enemy.element_rate(i) == 200
  381.          text = $data_system.elements[i]
  382.          end
  383.          if enemy.element_rate(i) == 150
  384.          text2 =$data_system.elements[i]
  385.          end
  386.        end
  387.        self.contents.font.color = system_color
  388.        self.contents.draw_text(x, y, 80, 32,"主要种族")
  389.        self.contents.font.color = normal_color
  390.        self.contents.draw_text(x+80, y, 76, 32,text,2)
  391.        self.contents.font.color = system_color
  392.        self.contents.draw_text(x+160, y, 80, 32,"次要种族")
  393.        self.contents.font.color = normal_color
  394.        self.contents.draw_text(x+80+160, y, 76, 32,text2,2)
  395. end
  396.  
  397. #--------------------------------------------------------------------------
  398. # ● エネミーの名前の描画
  399. #     enemy : エネミー
  400. #     x     : 描画先 X 座標
  401. #     y     : 描画先 Y 座標
  402. #--------------------------------------------------------------------------
  403. def draw_enemy_name(enemy, x, y)
  404.     self.contents.font.color = normal_color
  405.     self.contents.draw_text(x, y, 152, 32, enemy.name)
  406. end
  407. #--------------------------------------------------------------------------
  408. # ● エネミーグラフィックの描画(アナライズ)
  409. #     enemy : エネミー
  410. #     x     : 描画先 X 座標
  411. #     y     : 描画先 Y 座標
  412. #--------------------------------------------------------------------------
  413. def draw_enemy_graphic(enemy, x, y, opacity = 255)
  414.  
  415. end
  416. #--------------------------------------------------------------------------
  417. # ● エネミーの獲得EXPの描画
  418. #     enemy : エネミー
  419. #     x     : 描画先 X 座標
  420. #     y     : 描画先 Y 座標
  421. #--------------------------------------------------------------------------
  422. def draw_enemy_exp(enemy, x, y)
  423.     self.contents.font.color = system_color
  424.     self.contents.draw_text(x, y, 120, 32, "EXP")
  425.     self.contents.font.color = normal_color
  426.     self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
  427. end
  428. #--------------------------------------------------------------------------
  429. # ● エネミーの獲得GOLDの描画
  430. #     enemy : エネミー
  431. #     x     : 描画先 X 座標
  432. #     y     : 描画先 Y 座標
  433. #--------------------------------------------------------------------------
  434. def draw_enemy_gold(enemy, x, y)
  435.     self.contents.font.color = system_color
  436.     self.contents.draw_text(x, y, 120, 32, "掉落金钱")
  437.     self.contents.font.color = normal_color
  438.     self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
  439. end
  440. end
  441.  
  442. class Game_Enemy_Book < Game_Enemy
  443. #--------------------------------------------------------------------------
  444. # ● オブジェクト初期化
  445. #--------------------------------------------------------------------------
  446. def initialize(enemy_id)
  447.     super(2, 1)#ダミー
  448.     @enemy_id = enemy_id
  449.     enemy = $data_enemies[@enemy_id]
  450.     @battler_name = enemy.battler_name
  451.     @battler_hue = enemy.battler_hue
  452.     @hp = maxhp
  453.     @sp = maxsp
  454. end
  455. end
  456.  
  457. class Data_MonsterBook
  458. attr_reader :id_data
  459. #--------------------------------------------------------------------------
  460. # ● オブジェクト初期化
  461. #--------------------------------------------------------------------------
  462. def initialize
  463.     @id_data = enemy_book_id_set
  464. end
  465. #--------------------------------------------------------------------------
  466. # ● 図鑑用登録無視属性取得
  467. #--------------------------------------------------------------------------
  468. def no_add_element
  469.     no_add = 0
  470.     # 登録無視の属性IDを取得
  471.     for i in 1...$data_system.elements.size
  472.       if $data_system.elements[i] =~ /不加入图鉴/
  473.         no_add = i
  474.         break
  475.       end
  476.     end
  477.     return no_add
  478. end
  479. #--------------------------------------------------------------------------
  480. # ● 図鑑用敵ID設定
  481. #--------------------------------------------------------------------------
  482. def enemy_book_id_set
  483.     data = [0]
  484.     no_add = no_add_element
  485.     # 登録無視の属性IDを取得
  486.     for i in 1...$data_enemies.size
  487.       enemy = $data_enemies[i]
  488.       next if enemy.name == ""
  489.       if enemy.element_ranks[no_add] == 1
  490.         next
  491.       end
  492.       data.push(enemy.id)
  493.     end
  494.     return data
  495. end
  496. end
  497.  
  498.  
  499. class Window_MonsterBook < Window_Selectable
  500. attr_reader   :data
  501. #--------------------------------------------------------------------------
  502. # ● オブジェクト初期化
  503. #--------------------------------------------------------------------------
  504. def initialize(index=0)
  505.     super(0, 64, 640, 416)
  506.     @column_max = 2
  507.     @book_data = $game_temp.enemy_book_data
  508.     @data = @book_data.id_data.dup
  509.     @data.shift
  510.     #@data.sort!
  511.     @item_max = @data.size
  512.     self.index = 0
  513.     refresh if @item_max > 0
  514. end
  515. #--------------------------------------------------------------------------
  516. # ● 遭遇データを取得
  517. #--------------------------------------------------------------------------
  518. def data_set
  519.     data = $game_party.enemy_info.keys
  520.     data.sort!
  521.     newdata = []
  522.     for i in data
  523.       next if $game_party.enemy_info[i] == 0
  524.       # 図鑑登録無視を考慮
  525.       if book_id(i) != nil
  526.         newdata.push(i)
  527.       end
  528.     end
  529.     return newdata
  530. end
  531. #--------------------------------------------------------------------------
  532. # ● 表示許可取得
  533. #--------------------------------------------------------------------------
  534. def show?(id)
  535.     if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
  536.       return false
  537.     else
  538.       return true
  539.     end
  540. end
  541. #--------------------------------------------------------------------------
  542. # ● 図鑑用ID取得
  543. #--------------------------------------------------------------------------
  544. def book_id(id)
  545.     return @book_data.index(id)
  546. end
  547. #--------------------------------------------------------------------------
  548. # ● エネミー取得
  549. #--------------------------------------------------------------------------
  550. def item
  551.     return @data[self.index]
  552. end
  553. #--------------------------------------------------------------------------
  554. # ● リフレッシュ
  555. #--------------------------------------------------------------------------
  556. def refresh
  557.     if self.contents != nil
  558.       self.contents.dispose
  559.       self.contents = nil
  560.     end
  561.     self.contents = Bitmap.new(width - 32, row_max * 32)
  562.     #項目数が 0 でなければビットマップを作成し、全項目を描画
  563.     if @item_max > 0
  564.       for i in 0...@item_max
  565.        draw_item(i)
  566.       end
  567.     end
  568. end
  569. #--------------------------------------------------------------------------
  570. # ● 項目の描画
  571. #     index : 項目番号
  572. #--------------------------------------------------------------------------
  573. def draw_item(index)
  574.     enemy = $data_enemies[@data[index]]
  575.     return if enemy == nil
  576.     x = 4 + index % 2 * (288 + 32)
  577.     y = index / 2 * 32
  578.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  579.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  580.     self.contents.font.color = normal_color
  581.     draw_enemy_book_id(enemy, x, y)
  582.     if show?(enemy.id)
  583.       self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
  584.     else
  585.       self.contents.draw_text(x + 28+16, y, 212, 32, "-----", 0)
  586.       return
  587.     end
  588.     if analyze?(@data[index])
  589.       self.contents.font.color = text_color(3)
  590.       self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
  591.     end
  592. end
  593. #--------------------------------------------------------------------------
  594. # ● アナライズ済かどうか
  595. #--------------------------------------------------------------------------
  596. def analyze?(enemy_id)
  597.     if $game_party.enemy_info[enemy_id] == 2
  598.       return true
  599.     else
  600.       return false
  601.     end
  602. end
  603. end
  604.  
  605.  
  606. class Window_MonsterBook_Info < Window_Base
  607. include Enemy_Book_Config
  608. #--------------------------------------------------------------------------
  609. # ● オブジェクト初期化
  610. #--------------------------------------------------------------------------
  611. def initialize
  612.     super(0, 0+64, 640, 480-64)
  613.     self.back_opacity=255
  614.     self.contents = Bitmap.new(width - 32, height - 32)
  615.  
  616. end
  617. #--------------------------------------------------------------------------
  618. # ● リフレッシュ
  619. #--------------------------------------------------------------------------
  620. def refresh(enemy_id)
  621.     self.contents.clear
  622.     self.contents.font.size = 22
  623.     enemy = Game_Enemy_Book.new(enemy_id)
  624.     @gra = Sprite_Enemy_Graphic.new(nil,enemy)
  625.     @gra.z = 120      #怪物图片
  626.     draw_enemy_book_id(enemy, 4, 0)    #各种详细信息
  627.     draw_enemy_name(enemy, 48, 0)
  628.     draw_actor_hp(enemy, 288, 0)
  629.     draw_actor_sp(enemy, 288+160, 0)
  630.     self.contents.font.size=18
  631.     draw_actor_parameter(enemy, 288    ,  25, 0)
  632.     self.contents.font.color = system_color
  633.     self.contents.draw_text(288+160, 25, 120, 32, EVA_NAME)
  634.     self.contents.font.color = normal_color
  635.     self.contents.draw_text(288+160 + 120, 25, 36, 32, enemy.eva.to_s, 2)
  636.     draw_actor_parameter(enemy, 288    ,  50, 3)
  637.     draw_actor_parameter(enemy, 288+160,  50, 4)
  638.     draw_actor_parameter(enemy, 288    ,  75, 5)
  639.     draw_actor_parameter(enemy, 288+160,  75, 6)
  640.     draw_actor_parameter(enemy, 288    , 100, 1)
  641.     draw_actor_parameter(enemy, 288+160, 100, 2)
  642.     draw_enemy_exp(enemy, 288, 125)
  643.     draw_enemy_gold(enemy, 288+160, 125)
  644.     draw_race(enemy, 288, 150)
  645.     #--------------------------------------------------------------------
  646.     draw_enemy_other(enemy, 0, 280)  #简介文字
  647.     #draw_enemy_action(enemy,200, 30)  #显示敌人行动
  648.     draw_enemy_action(enemy,360, 180)  #显示敌人行动
  649.     #draw_actor_element_radar_graph(enemy, 360, 180)#雷达图
  650.     #--------------------------------------------------------------------
  651.     if DROP_ITEM_NEED_ANALYZE==true  #掉落物品
  652.       self.contents.font.color = system_color
  653.          self.contents.font.size=16
  654.       self.contents.draw_text(0, 235, 96, 32, "掉落物品")
  655.       draw_enemy_drop_item(enemy, 128, 235)
  656.       self.contents.font.color = normal_color
  657.          self.contents.font.size=18
  658.        end      
  659.      end
  660. def cl
  661.         @gra.dispose
  662. end
  663. #--------------------------------------------------------------------------
  664. # ● アナライズ済かどうか
  665. #--------------------------------------------------------------------------
  666. def analyze?(enemy_id)
  667.     if $game_party.enemy_info[enemy_id] == 2
  668.       return true
  669.     else
  670.       return false
  671.     end
  672. end
  673. end
  674.  
  675.  
  676. class Scene_MonsterBook
  677. include Enemy_Book_Config
  678. #--------------------------------------------------------------------------
  679. # ● メイン処理
  680. #--------------------------------------------------------------------------
  681. def main
  682.     $game_temp.enemy_book_data = Data_MonsterBook.new
  683.     # ウィンドウを作成
  684.     @title_window = Window_Base.new(0, 0, 640, 64)
  685.     @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
  686.     @title_window.contents.draw_text(4, 0, 320, 32, "魔物图鉴", 0)
  687.     if SHOW_COMPLETE_TYPE != 0
  688.       case SHOW_COMPLETE_TYPE
  689.       when 1
  690.         e_now = $game_party.enemy_book_now
  691.         e_max = $game_party.enemy_book_max
  692.         text = e_now.to_s + "/" + e_max.to_s
  693.       when 2
  694.         comp = $game_party.enemy_book_complete_percentage
  695.         text = comp.to_s + "%"
  696.       when 3
  697.         e_now = $game_party.enemy_book_now
  698.         e_max = $game_party.enemy_book_max
  699.         comp = $game_party.enemy_book_complete_percentage
  700.         text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
  701.       end
  702.       if text != nil
  703.         @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
  704.       end
  705.     end
  706.     @main_window = Window_MonsterBook.new
  707.     @main_window.active = true
  708.     # インフォウィンドウを作成 (不可視・非アクティブに設定)
  709.     @info_window = Window_MonsterBook_Info.new
  710.     @info_window.z = 110
  711.     @info_window.visible = false
  712.     @info_window.active = false
  713.     @visible_index = 0
  714.     # トランジション実行
  715.     Graphics.transition
  716.     # メインループ
  717.     loop do
  718.       # ゲーム画面を更新
  719.       Graphics.update
  720.       # 入力情報を更新
  721.       Input.update
  722.       # フレーム更新
  723.       update
  724.       # 画面が切り替わったらループを中断
  725.       if $scene != self
  726.         break
  727.       end
  728.     end
  729.     # トランジション準備
  730.     Graphics.freeze
  731.     # ウィンドウを解放
  732.     @main_window.dispose
  733.     @info_window.dispose
  734.     @title_window.dispose
  735. end
  736. #--------------------------------------------------------------------------
  737. # ● フレーム更新
  738. #--------------------------------------------------------------------------
  739. def update
  740.     # ウィンドウを更新
  741.     @main_window.update
  742.     @info_window.update
  743. #   gra.update
  744.     if @info_window.active
  745.       update_info
  746.       return
  747.     end
  748.     # メインウィンドウがアクティブの場合: update_target を呼ぶ
  749.     if @main_window.active
  750.       update_main
  751.       return
  752.     end
  753. end
  754. #--------------------------------------------------------------------------
  755. # ● フレーム更新 (メインウィンドウがアクティブの場合)
  756. #--------------------------------------------------------------------------
  757. def update_main
  758.     # B ボタンが押された場合
  759.     if Input.trigger?(Input::B)
  760.       # キャンセル SE を演奏
  761.       $game_system.se_play($data_system.cancel_se)
  762.       $scene = Scene_Menu.new(6)
  763.       return
  764.     end
  765.     # C ボタンが押された場合
  766.     if Input.trigger?(Input::C)
  767.       if @main_window.item == nil or @main_window.show?(@main_window.item) == false
  768.         # ブザー SE を演奏
  769.         $game_system.se_play($data_system.buzzer_se)
  770.         return
  771.       end
  772.       # 決定 SE を演奏
  773.       $game_system.se_play($data_system.decision_se)
  774.       @main_window.active = false
  775.       @info_window.active = true
  776.       @info_window.visible = true
  777.       @visible_index = @main_window.index
  778.       @info_window.refresh(@main_window.item)
  779.       return
  780.     end
  781. end
  782. #--------------------------------------------------------------------------
  783. # ● フレーム更新 (インフォウィンドウがアクティブの場合)
  784. #--------------------------------------------------------------------------
  785. def update_info
  786.     # B ボタンが押された場合
  787.     if Input.trigger?(Input::B)
  788.       # キャンセル SE を演奏
  789.       $game_system.se_play($data_system.cancel_se)
  790.       @main_window.active = true
  791.       @info_window.active = false
  792.       @info_window.visible = false
  793.       @info_window.cl
  794.       return
  795.     end
  796.     # C ボタンが押された場合
  797.     if Input.trigger?(Input::C)
  798.       # 決定 SE を演奏
  799.       #$game_system.se_play($data_system.decision_se)
  800.       return
  801.     end
  802.     if Input.trigger?(Input::L)
  803.       # 決定 SE を演奏
  804.       $game_system.se_play($data_system.decision_se)
  805.       loop_end = false
  806.       while loop_end == false
  807.         if @visible_index != 0
  808.           @visible_index -= 1
  809.         else
  810.           @visible_index = @main_window.data.size - 1
  811.         end
  812.         loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  813.       end
  814.       @info_window.cl
  815.       id = @main_window.data[@visible_index]
  816.       @info_window.refresh(id)
  817.       return
  818.     end
  819.     if Input.trigger?(Input::R)
  820.       # 決定 SE を演奏
  821.       $game_system.se_play($data_system.decision_se)
  822.       loop_end = false
  823.       while loop_end == false
  824.         if @visible_index != @main_window.data.size - 1
  825.           @visible_index += 1
  826.         else
  827.           @visible_index = 0
  828.         end
  829.         loop_end = true if @main_window.show?(@main_window.data[@visible_index])
  830.       end
  831.       @info_window.cl
  832.       id = @main_window.data[@visible_index]
  833.       @info_window.refresh(id)
  834.       return
  835.     end
  836. end
  837. end
  838. #==============================================================================
  839. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  840. #==============================================================================
  841. class Sprite_Enemy_Graphic< Sprite
  842.    attr_accessor :enemy
  843.    #--------------------------------------------------------------------------
  844.    # ● オブジェクト初期化
  845.    #--------------------------------------------------------------------------
  846.    def initialize(viewport,enemy)
  847.      super(viewport)
  848.      if @enemy != enemy
  849.        self.bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
  850.        cw = self.bitmap.width
  851.        ch = self.bitmap.height
  852.      if cw>ch
  853.       self.zoom_x=200.0/cw
  854.       self.zoom_y=200.0/cw
  855.     else
  856.       self.zoom_x=200.0/ch
  857.       self.zoom_y=200.0/ch     
  858.     end
  859.       self.x=10
  860.       self.y=110
  861.        @enemy=enemy
  862.      end
  863.    end
  864.    #--------------------------------------------------------------------------
  865.    # ● 解放
  866.    #--------------------------------------------------------------------------
  867.    def dispose
  868.      if self.bitmap != nil
  869.        self.bitmap.dispose
  870.      end
  871.      super
  872.    end
  873.    #--------------------------------------------------------------------------
  874.    # ● フレーム更新
  875.    #--------------------------------------------------------------------------
  876.    def refresh(enemy)
  877.    end
  878. end

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2015-3-24 17:19:02 手机端发表。 | 只看该作者
隐藏掉背后的那个窗口

点评

CR~
请问要怎么隐藏?谢谢!  发表于 2015-3-25 09:23
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
发表于 2015-3-27 19:09:44 | 只看该作者
两种办法···一种如楼上,一种是不要使用半透明的窗口···

点评

不透明度改成0或者直接关掉那个窗口···  发表于 2015-3-27 22:20
CR~
要怎么隐藏啊。。。  发表于 2015-3-27 22:18
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-22 23:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表