Project1
标题:
这脚本的一点问题
[打印本页]
作者:
美丽晨露
时间:
2012-12-29 16:43
标题:
这脚本的一点问题
本帖最后由 美丽晨露 于 2013-1-7 22:55 编辑
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, -32, 32, 32,"战斗胜利")
x = 4
self.contents.font.color = system_color
cx = contents.text_size("获得 "
[email protected]
_s).width
self.contents.draw_text(x, 0, cx, 32, ("获得 "
[email protected]
_s))
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("经验").width
self.contents.draw_text(x, 0, 64, 32, "经验")
#x += cx + 16
x = 4
self.contents.font.color = system_color
cx = contents.text_size("获得 "
[email protected]
_s).width
self.contents.draw_text(x, 32, cx, 32, "获得 "
[email protected]
_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 32, 128, 32, $data_system.words.gold)
y = 64
# self.contents.draw_text(x, 64, 128, 32,"获得道具:")
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end
复制代码
有几个问题。
1.如何例外起一行写:获得道具:
2.道具获得不完全,原本可以获得四个,只显示了三个
3.如何将EXP,跟GOLD的数字用其他颜色描绘
4.如何文字居中显示
作者:
沙漠点灰
时间:
2012-12-29 23:21
1.
把x坐标设为0即可
2.
窗口高度不够
3.
参考F1,或RMXP默认代码
4.
参考F1,或RMXP默认代码
完成了1,2,再次抛个砖,lz自己去搬剩下的砖吧!
#==============================================================================
# ■ Window_BattleResult
#------------------------------------------------------------------------------
# 战斗结束时、显示获得的 EXP 及金钱的窗口。
#==============================================================================
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# exp : EXP
# gold : 金钱
# treasures : 宝物
#--------------------------------------------------------------------------
def initialize(exp, gold, treasures)
[url=home.php?mod=space&uid=13302]@exp[/url] = exp
[url=home.php?mod=space&uid=236945]@gold[/url] = gold
p treasures.size
@treasures = treasures
super(160, 0, 320, @treasures.size * 32 + 96 + (@treasures.size==0 ? 0 : 32))
self.contents = Bitmap.new(width - 32, height - 32)
self.y = 160 - height / 2
self.back_opacity = 160
self.visible = false
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, -32, 32, 32,"战斗胜利")
x = 4
self.contents.font.color = system_color
cx = contents.text_size("获得 "
[email protected]
_s).width
self.contents.draw_text(x, 0, cx, 32, ("获得 "
[email protected]
_s))
x += cx + 4
self.contents.font.color = system_color
cx = contents.text_size("经验").width
self.contents.draw_text(x, 0, 64, 32, "经验")
#x += cx + 16
x = 4
self.contents.font.color = system_color
cx = contents.text_size("获得 "
[email protected]
_s).width
self.contents.draw_text(x, 32, cx, 32, "获得 "
[email protected]
_s)
x += cx + 4
self.contents.font.color = system_color
self.contents.draw_text(x, 32, 128, 32, $data_system.words.gold)
y = 96
self.contents.draw_text(4, 64, 128, 32,"获得道具:")
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
end
end
复制代码
作者:
美丽晨露
时间:
2012-12-30 11:59
沙漠点灰 发表于 2012-12-29 23:21
1.
把x坐标设为0即可
2.
谢谢
但是显示不出“战斗胜利”
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1