Class: Nyle::Screen::Layer

Inherits:
Cairo::ImageSurface
  • Object
show all
Defined in:
lib/nyle/screen.rb

Constant Summary collapse

@@layers =
{}

Class Method Summary collapse

Instance Method Summary collapse

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

.clearObject



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

.statusObject



35
36
37
# File 'lib/nyle/screen.rb', line 35

def self.status
  p @@layers
end