Skip to content
Browse files

Merge commit 'pjones/svg-with-turns'

  • Loading branch information...
2 parents 71b907e + c5ffa1c commit 675a8d4eda4225d1f795cba4a56346f8da6f0ba2 @JEG2 committed Jan 29, 2009
Showing with 7 additions and 2 deletions.
  1. +1 −1 lib/wig_wug/game.rb
  2. +6 −1 lib/wig_wug/map.rb
View
2 lib/wig_wug/game.rb
@@ -109,7 +109,7 @@ def print_text(message = "")
def draw_svg
return unless @svg
File.open(File.join(@svg, "turn_#{@turn}.svg"), "w") do |svg|
- svg << @map.to_svg(@options)
+ svg << @map.to_svg(@options.merge(:turn => @turn))
end
end
end
View
7 lib/wig_wug/map.rb
@@ -105,7 +105,7 @@ def to_svg(options = Hash.new)
center = scale / 2.0
max_x = width * scale
max_y = height * scale
- bottom = max_y + (options[:legend] ? players.size * 15 + 5 : 0)
+ bottom = max_y + (options[:legend] ? players.size * 15 + 5 : 0) + 20
SVG::Image.new(max_x, bottom) do |svg|
# background
@@ -131,6 +131,11 @@ def to_svg(options = Hash.new)
:font_size => 12,
:fill => :white )
end
+ down = max_y + players.size * 15 + 5
+ svg.text("Turn #{options[:turn]}", scale + 5, down + 12,
+ :font_family => "Verdana",
+ :font_size => 12,
+ :fill => :white )
end
each_with_xy do |cell, x, y|

0 comments on commit 675a8d4

Please sign in to comment.
Something went wrong with that request. Please try again.