Project1

标题: 脚本中如何先后地显示图片? (非事件) [打印本页]

作者: 仙芋    时间: 2010-8-30 12:07
标题: 脚本中如何先后地显示图片? (非事件)
本帖最后由 仙芋 于 2010-8-30 12:08 编辑

比如下面的.
如何做到先显示 win_1.png
过了数秒后
显示 win_2.png?
我用了  "20.times{Graphics.update}" 也没效果~
  1. def refresh
  2.     self.contents.clear
  3.     self.contents.font.bold = true
  4.     x = 4      
  5.                   bitmap = Bitmap.new("Graphics/System/win_1.png")
  6.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  7.     self.contents.blt(75, 86, bitmap,src_rect)
  8.      20.times{Graphics.update}
  9.                   bitmap = Bitmap.new("Graphics/System/win_2.png")
  10.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  11.     self.contents.blt(75, 156, bitmap,src_rect)
  12.      
  13.     self.contents.font.size = 20
  14.                 self.contents.font.color = Color.new(132,48,0,255)
  15.         cx = contents.text_size(@exp.to_s).width
  16.         self.contents.draw_text(221, 97, cx, 32, @exp.to_s)
  17.                 self.contents.font.color = Color.new(132,48,0,255)
  18.         cx = contents.text_size(@gold.to_s).width
  19.         self.contents.draw_text(206, 159, cx, 32, @gold.to_s)
  20.         
  21.     self.contents.font.color = Color.new(250,130,0,255)
  22.     cx = contents.text_size(@exp.to_s).width
  23.     self.contents.draw_text(220, 96, cx, 32, @exp.to_s)
  24.     cx = contents.text_size(@gold.to_s).width
  25.     self.contents.draw_text(205, 158, cx, 32, @gold.to_s)
  26.     y = 160
  27.     x = 0
  28.     @a = 0
  29.    
  30.     if @treasures.size < 3
  31.       self.contents.font.size = 19
  32.       for item in @treasures
  33.         x = (@a % 3) * 100
  34.         y = 160+(@a / 3) * 20
  35.         self.contents.font.color = Color.new(132,48,0,255)
  36.         draw_item_name1(item, x+90, y+61)
  37.             self.contents.font.color = Color.new(250,130,0,255)
  38.        draw_item_name1(item, x+89, y+60)
  39.         @a += 1
  40.       end
  41.     else
  42.       self.contents.font.size = 17
  43.       for item in @treasures
  44.         x = (@a % 3) * 110
  45.         y = 160+(@a / 3) * 20
  46.         draw_item_name1(item, x, y)
  47.         @a += 1
  48.       end
  49.     end
  50.   end
  51.   def dispose
  52.     super
  53.     @back.dispose
  54.   end
  55. 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