class Sprite_Up < Sprite
def initialize(string)
super()
@string = string
self.bitmap = Bitmap.new(640,480)
end
def update(str)
super()
if @string != str
@string = str
refresh(str)
end
end
# dispose
def refresh(str)
#super
self.bitmap.draw_text(self.bitmap.rect,str,1)
end
end
a = Sprite_Up.new("")
for i in 1..300
a.update("Hello World")
Graphics.update
end
a.flash(Color.new(255,0,0),40)
for i in 1..40
a.update("Hello World")
Graphics.update
end
a.dispose
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |