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.
247 248 249 250 251 252 253 254 |
# File 'lib/doom/wad/hud_graphics.rb', line 247 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.
245 246 247 |
# File 'lib/doom/wad/hud_graphics.rb', line 245 def columns @columns end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
245 246 247 |
# File 'lib/doom/wad/hud_graphics.rb', line 245 def height @height end |
#left_offset ⇒ Object (readonly)
Returns the value of attribute left_offset.
245 246 247 |
# File 'lib/doom/wad/hud_graphics.rb', line 245 def left_offset @left_offset end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
245 246 247 |
# File 'lib/doom/wad/hud_graphics.rb', line 245 def name @name end |
#top_offset ⇒ Object (readonly)
Returns the value of attribute top_offset.
245 246 247 |
# File 'lib/doom/wad/hud_graphics.rb', line 245 def top_offset @top_offset end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
245 246 247 |
# File 'lib/doom/wad/hud_graphics.rb', line 245 def width @width end |
Instance Method Details
#column_pixels(x) ⇒ Object
256 257 258 |
# File 'lib/doom/wad/hud_graphics.rb', line 256 def column_pixels(x) @columns[x % @width] end |