class Waxy::Render::Svg::Canvas

Concept from www-cs-students.stanford.edu/~amitp/game-programming/grids/draw_grid.rb

Attributes

body[RW]
height[RW]
width[RW]

Public Class Methods

new(_width = 1000, _height = 1000) click to toggle source
# File lib/waxy/render/canvas.rb, line 11
def initialize(_width = 1000, _height = 1000)
  @width = _width
  @height = _height 

  @body = ''
end

Public Instance Methods

to_svg() click to toggle source
# File lib/waxy/render/canvas.rb, line 18
def to_svg
  doc = Waxy::Render::Svg.open_svg(self)
  doc << body 
  doc << Waxy::Render::Svg.close_svg
  doc
end