Class: BoxGraphics

Inherits:
Component show all
Defined in:
lib/entities/components/box_graphics.rb

Instance Attribute Summary

Attributes inherited from Component

#object

Instance Method Summary collapse

Methods inherited from Component

#update

Constructor Details

#initialize(object) ⇒ BoxGraphics

Returns a new instance of BoxGraphics.



2
3
4
5
# File 'lib/entities/components/box_graphics.rb', line 2

def initialize(object)
  super(object)
  load_sprite
end

Instance Method Details

#draw(viewport) ⇒ Object



7
8
9
10
# File 'lib/entities/components/box_graphics.rb', line 7

def draw(viewport)
  @box.draw_rot(x, y, 0, object.angle)
  Utils.mark_corners(object.box) if $debug
end

#heightObject



12
13
14
# File 'lib/entities/components/box_graphics.rb', line 12

def height
  @box.height
end

#widthObject



16
17
18
# File 'lib/entities/components/box_graphics.rb', line 16

def width
  @box.width
end