Class: Doom::Wad::HudGraphics

Inherits:
Object
  • Object
show all
Defined in:
lib/doom/wad/hud_graphics.rb

Overview

Loads HUD graphics (status bar, weapons) from WAD

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wad) ⇒ HudGraphics

Returns a new instance of HudGraphics.



9
10
11
12
13
14
15
16
17
18
# File 'lib/doom/wad/hud_graphics.rb', line 9

def initialize(wad)
  @wad = wad
  @cache = {}

  load_status_bar
  load_numbers
  load_weapons
  load_faces
  load_keys
end

Instance Attribute Details

#arms_backgroundObject (readonly)

Returns the value of attribute arms_background.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def arms_background
  @arms_background
end

#facesObject (readonly)

Returns the value of attribute faces.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def faces
  @faces
end

#grey_numbersObject (readonly)

Returns the value of attribute grey_numbers.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def grey_numbers
  @grey_numbers
end

#keysObject (readonly)

Returns the value of attribute keys.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def keys
  @keys
end

#numbersObject (readonly)

Returns the value of attribute numbers.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def numbers
  @numbers
end

#status_barObject (readonly)

Returns the value of attribute status_bar.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def status_bar
  @status_bar
end

#weaponsObject (readonly)

Returns the value of attribute weapons.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def weapons
  @weapons
end

#yellow_numbersObject (readonly)

Returns the value of attribute yellow_numbers.



7
8
9
# File 'lib/doom/wad/hud_graphics.rb', line 7

def yellow_numbers
  @yellow_numbers
end

Instance Method Details

#[](name) ⇒ Object

Get a cached graphic by name



21
22
23
# File 'lib/doom/wad/hud_graphics.rb', line 21

def [](name)
  @cache[name]
end