Module: RoomDraw

Included in:
Room
Defined in:
lib/rooms/room_draw.rb

Instance Method Summary collapse

Instance Method Details

#draw(gc) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rooms/room_draw.rb', line 3

def draw( gc )
  gc.rectangle( @min_x, @min_y, @max_x, @max_y )

  # Squares
  1.upto( Room::ROOM_SQUARE_SIZE ).each do |t|
    gc.line( @min_x + DrawableObject::SQUARE_SIZE_IN_PIXELS*t, @min_y, @min_x + DrawableObject::SQUARE_SIZE_IN_PIXELS*t, @max_y )
    gc.line( @min_x, @min_y + DrawableObject::SQUARE_SIZE_IN_PIXELS*t, @max_x, @min_y + DrawableObject::SQUARE_SIZE_IN_PIXELS*t )
  end

  if @content
    print_text( gc, @content )
  end

  @decorations.each do |decoration|
    draw_four_columns(gc, decoration[:decoration_data] ) if decoration[:decoration_type] == :four_columns
  end
end