赞 | 12 |
VIP | 107 |
好人卡 | 6 |
积分 | 4 |
经验 | 31122 |
最后登录 | 2024-6-29 |
在线时间 | 1606 小时 |
Lv2.观梦者 傻♂逼
- 梦石
- 0
- 星屑
- 374
- 在线时间
- 1606 小时
- 注册时间
- 2007-3-13
- 帖子
- 6562
|
把图片放在PICTURE目录
脚本:
- class Window_In < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- @pic = Sprite.new
- @pic.z = 9999
- @pic.bitmap = Cache.picture("变量界面图2_82135405")
- @height = @pic.bitmap.height
- @pic.x = 3
- @pic.y = 416-@height
- # self.z = 99999
- super(0, 416-@height, 544, WLH + @height)
- self.opacity = 0
- #super(0, 0, 544, WLH + 500)
-
- refresh
- end
- def dispose
- super
- @pic.bitmap.dispose
- @pic.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- item
- $game_variables[1] = 100 if $game_variables[1]>100
- $game_variables[2] = 100 if $game_variables[2]>100
- $game_variables[3] = 100 if $game_variables[3]>100
- $game_variables[4] = 100 if $game_variables[4]>100
- draw_currency_value($game_party.gold, -23, 60, 140)
- x = 174
- y = 38
- $g = $game_party.gold
- draw_currency_line($game_variables[1],x,y)
- x = 174
- y = 55
- $v = []
- $v[1] = $game_variables[1]
- draw_currency_line($game_variables[2],x,y)
- x = 174+65+32+13
- y = 37
- $v[2] = $game_variables[2]
- draw_currency_line($game_variables[3],x,y)
- x = 174+65+32+13
- y = 56
- $v[3] = $game_variables[3]
- draw_currency_line($game_variables[4],x,y)
- $v[4] = $game_variables[4]
- draw_currency_item
- end
- def draw_currency_item
- for i in 0...5
- draw_item(i)
- end
- end
- def draw_item(index)
- x = 362+(index*32)
- y = 60
- item = @data[index]
- if item != nil
- icon_index = item.icon_index
- bitmap = Cache.system("Iconset")
- rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
- self.contents.blt(x, y, bitmap, rect, 255)
- end
- end
- def draw_currency_line(value,x,y)
- gw = 66 * value / 100
- gc1 = hp_gauge_color1
- gc2 = hp_gauge_color2
- #self.contents.fill_rect(x, y + WLH - 8, 72, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- end
- def updated?
- if @data != item_i
- return true
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # ● 列表中包含的物品
- # item : 物品
- #--------------------------------------------------------------------------
- def include?(item)
- return false if item == nil
- if $game_temp.in_battle
- return false unless item.is_a?(RPG::Item)
- end
- return true
- end
- #--------------------------------------------------------------------------
- # ● 取得物品
- #--------------------------------------------------------------------------
- def item
- @data = []
- for item in $game_party.items
- next unless include?(item)
- @data.push(item)
- if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id
- #self.index = @data.size - 1
- end
- end
- @data.push(nil) if include?(nil)
- #@item_max = @data.size
- end
- #--------------------------------------------------------------------------
- # ● 取得物品
- #--------------------------------------------------------------------------
- def item_i
- data = []
- for item in $game_party.items
- next unless include?(item)
- data.push(item)
- if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id
- #self.index = @data.size - 1
- end
- end
- data.push(nil) if include?(nil)
- return data
- #@item_max = @data.size
- end
- end
复制代码 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|