Module: R2D::Adapters

Defined in:
lib/r2d/adapters.rb,
lib/r2d/adapters/gosu.rb

Defined Under Namespace

Modules: Gosu

Class Method Summary collapse

Class Method Details

.create(window, kind) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/r2d/adapters.rb', line 8

def self.create(window, kind)
  if !@active
    case kind
    when :gosu
      @active = Gosu
      @active.create_window(window)
    end
    true
  else
    false
  end
end

.current_songObject



36
# File 'lib/r2d/adapters.rb', line 36

def self.current_song; @active.current_song end

.get_color(r, g, b, a) ⇒ Object



27
# File 'lib/r2d/adapters.rb', line 27

def self.get_color(r, g, b, a); Gosu.get_color(r, g, b, a) end

.image(path) ⇒ Object



40
# File 'lib/r2d/adapters.rb', line 40

def self.image(path); @active.image(path) end

.key_lookup(key) ⇒ Object



25
# File 'lib/r2d/adapters.rb', line 25

def self.key_lookup(key); Gosu.key_id(key) end

.mouse_xObject



29
# File 'lib/r2d/adapters.rb', line 29

def self.mouse_x; Gosu.mouse_x end

.mouse_yObject



30
# File 'lib/r2d/adapters.rb', line 30

def self.mouse_y; Gosu.mouse_y end

.showObject



21
22
23
# File 'lib/r2d/adapters.rb', line 21

def self.show
  @active.show_window
end

.song(path) ⇒ Object

Fix these:



34
# File 'lib/r2d/adapters.rb', line 34

def self.song(path); @active.song(path) end

.sound(path) ⇒ Object



38
# File 'lib/r2d/adapters.rb', line 38

def self.sound(path); @active.sound(path) end

.text(h = 20, font = 'default') ⇒ Object



42
# File 'lib/r2d/adapters.rb', line 42

def self.text(h=20, font='default'); @active.text(h, font) end