Class: Nyle::Screen::Layer
- Inherits:
-
Cairo::ImageSurface
- Object
- Cairo::ImageSurface
- Nyle::Screen::Layer
- Defined in:
- lib/nyle/screen.rb
Constant Summary collapse
- @@layers =
{}
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(w, h) ⇒ Layer
constructor
A new instance of Layer.
Constructor Details
#initialize(w, h) ⇒ Layer
Returns a new instance of Layer.
19 20 21 |
# File 'lib/nyle/screen.rb', line 19 def initialize(w, h) super(w, h) end |
Class Method Details
.clear ⇒ Object
32 33 34 |
# File 'lib/nyle/screen.rb', line 32 def self.clear @@layers.clear end |
.create(id, w, h) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/nyle/screen.rb', line 22 def self.create(id, w, h) #puts "#{id} #{w} #{h}" if @@layers.has_key?(id) @@layers[id] # existing instance else layer = new(w, h) @@layers[id] = layer layer # new instance end end |
.status ⇒ Object
35 36 37 |
# File 'lib/nyle/screen.rb', line 35 def self.status p @@layers end |