Class: Dedalus::ImageRepository
- Inherits:
-
Object
- Object
- Dedalus::ImageRepository
- Defined in:
- lib/dedalus/image_repository.rb
Class Method Summary collapse
- .lookup(path) ⇒ Object
- .lookup_recording(id, width, height, window, &blk) ⇒ Object
- .lookup_tiles(path, width, height) ⇒ Object
Class Method Details
.lookup(path) ⇒ Object
3 4 5 6 7 |
# File 'lib/dedalus/image_repository.rb', line 3 def self.lookup(path) @images ||= {} @images[path] ||= Gosu::Image.new(path) @images[path] end |
.lookup_recording(id, width, height, window, &blk) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/dedalus/image_repository.rb', line 15 def self.lookup_recording(id,width,height,window,&blk) # p [ :lookup_recording, id: id ] @recordings ||= {} @recordings[id] ||= window.record(width.to_i,height.to_i,&blk) @recordings[id] end |
.lookup_tiles(path, width, height) ⇒ Object
9 10 11 12 13 |
# File 'lib/dedalus/image_repository.rb', line 9 def self.lookup_tiles(path, width, height) @tiles ||= {} @tiles[path] ||= Gosu::Image::load_tiles(path, width.to_i, height.to_i) @tiles[path] end |