Project1
标题:
脚本中如何先后地显示图片? (非事件)
[打印本页]
作者:
仙芋
时间:
2010-8-30 12:07
标题:
脚本中如何先后地显示图片? (非事件)
本帖最后由 仙芋 于 2010-8-30 12:08 编辑
比如下面的.
如何做到先显示 win_1.png
过了数秒后
显示 win_2.png?
我用了 "20.times{Graphics.update}" 也没效果~
def refresh
self.contents.clear
self.contents.font.bold = true
x = 4
bitmap = Bitmap.new("Graphics/System/win_1.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(75, 86, bitmap,src_rect)
20.times{Graphics.update}
bitmap = Bitmap.new("Graphics/System/win_2.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(75, 156, bitmap,src_rect)
self.contents.font.size = 20
self.contents.font.color = Color.new(132,48,0,255)
cx = contents.text_size(@exp.to_s).width
self.contents.draw_text(221, 97, cx, 32, @exp.to_s)
self.contents.font.color = Color.new(132,48,0,255)
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(206, 159, cx, 32, @gold.to_s)
self.contents.font.color = Color.new(250,130,0,255)
cx = contents.text_size(@exp.to_s).width
self.contents.draw_text(220, 96, cx, 32, @exp.to_s)
cx = contents.text_size(@gold.to_s).width
self.contents.draw_text(205, 158, cx, 32, @gold.to_s)
y = 160
x = 0
@a = 0
if @treasures.size < 3
self.contents.font.size = 19
for item in @treasures
x = (@a % 3) * 100
y = 160+(@a / 3) * 20
self.contents.font.color = Color.new(132,48,0,255)
draw_item_name1(item, x+90, y+61)
self.contents.font.color = Color.new(250,130,0,255)
draw_item_name1(item, x+89, y+60)
@a += 1
end
else
self.contents.font.size = 17
for item in @treasures
x = (@a % 3) * 110
y = 160+(@a / 3) * 20
draw_item_name1(item, x, y)
@a += 1
end
end
end
def dispose
super
@back.dispose
end
end
复制代码
作者:
fux2
时间:
2010-8-30 12:59
图片1的优先级太高?你试试把图片1消失了再显示图片2
作者:
仙芋
时间:
2010-8-30 19:58
回复
fux2
的帖子
我希望是图片2出现的时候
图片1还在
作者:
bzzdhm
时间:
2010-8-30 20:00
使用不同的标识符
作者:
仙芋
时间:
2010-8-31 15:06
回复
bzzdhm
的帖子
解释一下....
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1