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

Project1

 找回密码
 注册会员
搜索

一次显示获得多个物品,并且可以自定义颜色

查看数: 1771 | 评论数: 1 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2014-9-17 23:21

正文摘要:

本帖最后由 crow2006 于 2014-9-18 13:41 编辑 脚本包含两个部分: 第一部分: RUBY 代码复制class Game_Interpreter  #------------------------------------------------ ...

回复

crow2006 发表于 2014-9-17 23:48:09
第二部分:
RUBY 代码复制
  1. #=======================================================
  2. #★显示物品提示窗口
  3. #=======================================================
  4. class Window_fuye<Window_Base
  5. #====================================
  6. #●初始化
  7. #====================================
  8. #--------------------------------------------------------------------------
  9. # ● 初始化对像
  10. #     x      : 窗口 X 座标
  11. #     y      : 窗口 Y 座标
  12. #     width  : 窗口宽度
  13. #     height : 窗口高度
  14. #--------------------------------------------------------------------------
  15. def initialize(item)
  16.     @item=item
  17.     @item_name = {}
  18.     n=0
  19.     m=0
  20.  
  21.     if @item != nil
  22.      for itn in @item
  23.  
  24.       if @item_name[itn.name]==nil
  25.          @item_name[itn.name]=[0,""]
  26.          @item_name[itn.name][1]=itn.icon_index
  27.          m+=1
  28.       end
  29.       @item_name[itn.name][0] += 1
  30.     end
  31.     end
  32.  
  33.     super(200,15, 180,25*m+75 )
  34.     self.opacity = 150
  35.  
  36.     refresh
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 刷新
  40.   #--------------------------------------------------------------------------
  41. def refresh
  42.     self.contents.clear
  43.     self.contents.font.size=16
  44.  
  45.    if @item_name.size != 0
  46.    self.contents.font.size = 16
  47.    self.contents.font.color = Color.new(255,255,0)
  48.    self.contents.draw_text(10,0,64,32,"获得物品:")
  49.    i=0
  50.  
  51.     i=0
  52.     self.contents.font.size = 14
  53.     self.contents.font.color = Color.new(255,255,255,255)
  54.     for itn in @item_name
  55. ################################
  56. #颜色自定
  57. if itn[0].include?("多彩晶矿") or itn[0].include?("紫色夜魇草") or itn[0].include?("黄金果实") or itn[0].include?("蓝魔鱼") or itn[0].include?("魔力果")
  58.      self.contents.font.color = text_color(44) #颜色请自定义
  59.      draw_icon(itn[1][1] ,6 ,32+i*25 , true)
  60.      self.contents.draw_text(30,32+i*25,160,32,itn[0] + " × "+ itn[1][0].to_s)
  61.      i+=1  
  62. else
  63.      self.contents.font.color = Color.new(255,255,255,255)     
  64.      draw_icon(itn[1][1] ,6 ,32+i*25 , true)
  65.      self.contents.draw_text(30,32+i*25,160,32,itn[0] + " × "+ itn[1][0].to_s)
  66.      i+=1
  67. end  
  68. ################################
  69.     end   
  70.   end
  71. end
  72. end
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2025-5-3 03:02

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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