Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=========================================================================
- # Classe Text
- #-------------------------------------------------------------------------
- # Cole o código abaixo no chamar evento
- #
- # txt = "texto que você quer mostrar"
- # $txt = Text.new(x,y,w,h,txt)
- #
- # Substitua x,y,w e h pelas cordenadas x e y da tela, a largura e a altura. Respectivamente.
- #=========================================================================
- class Text < Sprite
- def initialize(x,y,w,h,txt)
- super(nil)
- self.bitmap = Bitmap.new(w,h)
- self.bitmap.draw_text(0,0,w,h,txt)
- @x = x
- @y = y
- end
- def update
- super
- self.x = @x
- self.y = @y
- end
- def dispose
- self.bitmap.clear
- super
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement