Class: Gosu::Image

Inherits:
Object
  • Object
show all
Includes:
TexPlay
Defined in:
lib/texplay.rb

Constant Summary

Constants included from TexPlay

TexPlay::TEXPLAY_VERSION

Constants included from TexPlay::Colors

TexPlay::Colors::Alpha, TexPlay::Colors::Black, TexPlay::Colors::Blue, TexPlay::Colors::Brown, TexPlay::Colors::Cyan, TexPlay::Colors::Green, TexPlay::Colors::Grey, TexPlay::Colors::Orange, TexPlay::Colors::Purple, TexPlay::Colors::Red, TexPlay::Colors::Turquoise, TexPlay::Colors::Tyrian, TexPlay::Colors::White, TexPlay::Colors::Yellow

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TexPlay

create_blank_image, on_setup, setup

Class Method Details

.new(*args, &block) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/texplay.rb', line 97

def new(*args, &block)

    # invoke old behaviour
    obj = original_new(*args, &block)

    # refresh the TexPlay image cache
    if obj.width <= (TexPlay::TP_MAX_QUAD_SIZE - 2) &&
            obj.height <= (TexPlay::TP_MAX_QUAD_SIZE - 2) && obj.quad_cached? then
        
        obj.refresh_cache
    end

    # run custom setup
    TexPlay::setup(obj)

     obj.instance_variable_set(:@__window__, args.first)

    # return the new image
    obj
end

.original_newObject



95
# File 'lib/texplay.rb', line 95

alias_method :original_new, :new

Instance Method Details

#__window__Object



119
120
121
# File 'lib/texplay.rb', line 119

def __window__
    @__window__
end