Project

r2dsvg

0.0
No commit activity in last 3 years
No release in over 3 years
Experimental gem to render SVG within a Ruby2D application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.4, >= 0.4.1
>= 0.1.0, ~> 0.1
~> 0.9, >= 0.9.4
~> 0.4, >= 0.4.7
 Project Readme

Viewing coloured shapes using the experimental r2dsvg gem

Installation

Follow the instructions on how to install the ruby2d gem and then gem install r2dsvg.

Example

require 'r2dsvg'

s=<<EOF
<svg width="300" height="200">
  <rect width="50" height="50" style="z-index:6" />
  <rect width="80" height="70" style="fill:red;z-index:4 " />
</svg>
EOF

R2dSvg.new s

The above example creates 2 rectangles which are overlapping each other. Here's a screenshot of the above example:

Screenshot of the Ruby program r2dsvg

Notes:

  • This gem is experimental
  • Only rectangles are rendered at the moment
  • The z-index is a non-standard SVG attribute
  • This gem relies upon the ruby2d libraries which are themself experiemental.

Resources

gem r2dsvg svg program application ruby2d svgle gtk graphics