Class: Doom::Wad::HudSprite
- Inherits:
-
Object
- Object
- Doom::Wad::HudSprite
- Defined in:
- lib/doom/wad/hud_graphics.rb
Overview
Simple sprite container for HUD graphics
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#left_offset ⇒ Object
readonly
Returns the value of attribute left_offset.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#top_offset ⇒ Object
readonly
Returns the value of attribute top_offset.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #column_pixels(x) ⇒ Object
-
#initialize(name, width, height, left_offset, top_offset, columns) ⇒ HudSprite
constructor
A new instance of HudSprite.
Constructor Details
#initialize(name, width, height, left_offset, top_offset, columns) ⇒ HudSprite
Returns a new instance of HudSprite.
243 244 245 246 247 248 249 250 |
# File 'lib/doom/wad/hud_graphics.rb', line 243 def initialize(name, width, height, left_offset, top_offset, columns) @name = name @width = width @height = height @left_offset = left_offset @top_offset = top_offset @columns = columns end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
241 242 243 |
# File 'lib/doom/wad/hud_graphics.rb', line 241 def columns @columns end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
241 242 243 |
# File 'lib/doom/wad/hud_graphics.rb', line 241 def height @height end |
#left_offset ⇒ Object (readonly)
Returns the value of attribute left_offset.
241 242 243 |
# File 'lib/doom/wad/hud_graphics.rb', line 241 def left_offset @left_offset end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
241 242 243 |
# File 'lib/doom/wad/hud_graphics.rb', line 241 def name @name end |
#top_offset ⇒ Object (readonly)
Returns the value of attribute top_offset.
241 242 243 |
# File 'lib/doom/wad/hud_graphics.rb', line 241 def top_offset @top_offset end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
241 242 243 |
# File 'lib/doom/wad/hud_graphics.rb', line 241 def width @width end |
Instance Method Details
#column_pixels(x) ⇒ Object
252 253 254 |
# File 'lib/doom/wad/hud_graphics.rb', line 252 def column_pixels(x) @columns[x % @width] end |