Project1
标题:
Window_BattleResult問題
[打印本页]
作者:
ms0688987
时间:
2010-9-1 14:20
标题:
Window_BattleResult問題
本帖最后由 ms0688987 于 2010-9-1 14:22 编辑
戰斗結束的EXP跟G的信息框把Windows改成圖片要怎麼改呢?
作者:
ms0688987
时间:
2010-9-1 19:50
5Hr了怎沒人回
作者:
fux2
时间:
2010-9-2 06:56
本帖最后由 fux2 于 2010-9-2 12:26 编辑
话说为什么LZ的头像和我一样?
得,我改了
怎么用不会也要教你把,你再不会我也不说了。
在"Picture/back/" 放进"XX.png"
复制代码
#==============================================================================
# ■ Window_BattleResult
#------------------------------------------------------------------------------
# 战斗结束时、显示获得的 EXP 及金钱的窗口。
#==============================================================================
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# exp : EXP
# gold : 金钱
# treasures : 宝物
#--------------------------------------------------------------------------
def initialize(exp, gold, treasures)
@exp = exp
@gold = gold
@treasures = treasures
super(160, 0, 320, @treasures.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.y = 160 - height / 2
self.back_opacity = 160
self.visible = false
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
bmp = Bitmap.new("Graphics/back/XX.png")
@pic_width = bmp.width
@pic_height = bmp.height
@back_win = Window_Base.new(0, 0, @pic_width, @pic_height)
@back_win.z = 100
@back_contents.bitmap = bmp
self.contents.clear
x = 4
self.contents.font.color = normal_color
cx = contents.text_size(@exp.to_s).width
self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("EXP").width
self.contents.draw_text(x, 0, 64, 32, "EXP")
x += cx + 16
self.contents.font.color = normal_color
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end
复制代码
作者:
ms0688987
时间:
2010-9-2 13:35
純屬巧合@_@"
我會用低...
感謝呵
作者:
ms0688987
时间:
2010-9-2 13:50
本帖最后由 ms0688987 于 2010-9-2 13:52 编辑
汗....找不到圖片
路徑都對,名稱也對呀 真奇怪= =
@back_contents.bitmap = bmp 有錯誤
作者:
fux2
时间:
2010-9-3 06:47
回复
ms0688987
的帖子
我用着没问题啊,难道你还用了什么脚本?
…………脚本里的地址要自己改啊,不是说XX.png就是任意名字哦。
作者:
ms0688987
时间:
2010-9-4 21:56
呃...我開新文件用上去貌似也一樣出錯
腳本Window_BattleResult的34行發生了NoMethodError。
undefined method`bitmap='for nil:NilClass
出現以上兩行阿....咋嚜回事?
作者:
Cola酱
时间:
2010-9-5 09:43
把你改了的Window_BattleResult发一下吧 没脚本不好改厄
还有 那个错误是调用了未定义过的方法
那个bitmap是空的
仔细检查一下是不是打错了哪里
作者:
逸豫
时间:
2010-9-5 10:15
34行改成@back_win.contents = bmp
然后吐槽:为啥一定要窗口来显示图片啊!Sprite是干虾米用的
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1