Class: Gosu::Image
- Inherits:
-
Object
- Object
- Gosu::Image
- Defined in:
- lib/devil/gosu.rb
Class Method Summary (collapse)
-
+ (Object) new(window, file, *args, &block)
monkey patching to support multiple image formats.
- + (Object) original_new_redux
Class Method Details
+ (Object) new(window, file, *args, &block)
monkey patching to support multiple image formats. This method is only available if require 'devil/gosu' is used
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/devil/gosu.rb', line 56 def new(window, file, *args, &block) if file.respond_to?(:to_blob) || file =~ /\.(bmp|png)$/ original_new_redux(window, file, *args, &block) else img = Devil.load(file).flip begin gosu_img = original_new_redux(window, img, *args, &block) ensure img.free end gosu_img end end |
+ (Object) original_new_redux
52 |
# File 'lib/devil/gosu.rb', line 52 alias_method :original_new_redux, :new |