Module: TexPlay

Defined in:
lib/devil/gosu.rb

Overview

monkey patches for TexPlay module (and by proxy the Gosu::Image class)

Instance Method Summary collapse

Instance Method Details

#save(file) ⇒ Object

save a Gosu::Image to file This method is only available if require ‘devil/gosu’ is used



11
12
13
14
15
16
17
18
# File 'lib/devil/gosu.rb', line 11

def save(file)
    capture {
        img = to_devil
        img.save(file)
        img.free
    }
    self
end

#to_devilObject

convert a Gosu::Image to a Devil::Image. This method is only available if require ‘devil/gosu’ is used



22
23
24
25
26
27
28
29
# File 'lib/devil/gosu.rb', line 22

def to_devil
    devil_img = nil
    capture {
        devil_img = Devil.from_blob(self.to_blob, self.width, self.height).flip
        devil_img
    }
    devil_img
end