<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />

  <title>RMagick 2.4.0: RVG Reference: RVG::Group Class</title>
  <meta http-equiv="Content-Type" content=
  "text/html; charset=us-ascii" />
  <meta name="GENERATOR" content="Quanta Plus" />
  <meta name="Copyright" content=
  "Copyright (C) 2006 by Timothy P. Hunter" />
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
<script type="text/javascript" src="scripts/doc.js">
</script>
<script type="text/javascript">
  //<![CDATA[
  //]]>
</script>
<style type="text/css">
  /*<![CDATA[*/
    }
  /*]]>*/
</style>
</head>

<body>
  <h6 id="header">RMagick 2.4.0 User's Guide and Reference</h6>

  <div class="nav">
    &laquo;&nbsp;<a href="rvg.html">Prev</a> | <a href=
    "index.html">Contents</a> | <a href=
    "rvgimage.html">Next</a>&nbsp;&raquo;
  </div>

  <h1>class RVG::Group <span class="superclass">&lt;
  Object</span></h1>

  <div id="toc">
    <h2>Table of Contents</h2>

    <h3>class methods</h3>

    <ul>
      <li><a href="#new">new</a></li>
    </ul>

    <h3>attributes</h3>

    <ul>
      <li><a href="#desc">desc, desc=</a></li>

      <li><a href="#metadata">metadata, metadata=</a></li>

      <li><a href="#RVG_title">title, title=</a></li>
    </ul>

    <h3>instance methods</h3>

    <ul>
      <li><a href="#g">g</a></li>

      <li><a href="#image">image</a></li>

      <li><a href="#rvg">rvg</a></li>

      <li><a href="#text">text</a></li>

      <li><a href="#use">use</a></li>
    </ul>

    <h3>shared methods</h3>

    <p>In addition to the methods listed above, <code>class
    RVG::Group</code> also implements the <a href=
    "rvgstyle.html">styles</a> method, the <a href=
    "rvgshape.html">shape methods</a> and the <a href=
    "rvgxform.html">transform methods</a>.</p>
  </div>

  <h2 class="methods">class methods</h2>

  <div class="sig">
    <h3 id="new">new</h3>

    <p><span class="arg">RVG::Group</span>.new [ <span class=
    "arg">{ |<span class="arg">self</span>| drawing method calls
    }</span> ] -&gt; <em>group</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Drawing objects defined within a group share the transforms
    and styles defined on the group. Groups can be nested
    arbitrarily deep. <code>RVG::Group.new</code> is commonly
    invoked within another group or RVG object by calling the
    <code>g</code> method (<a href="rvg.html#RVG_g">RVG#g</a>,
    <a href="#g">RVG::Group#g</a>) , which nests the group within
    the target object.</p>

    <p><code>RVG::Group.new</code> yields to a block if one is
    present, passing <code>self</code> as an argument.</p>

    <h4>Returns</h4>

    <p>An <code>RVG::Group</code> object</p>

    <h4>Example</h4>

    <p>See the tutorial for examples of the most common uses of
    groups. In this example, I use RVG::Group.new to construct a
    "stand-alone" group that is then referenced in multiple calls
    to the <a href="rvguse.html">use</a> method.</p>

    <p><a href="javascript:popup('group.rb.html')"><img src=
    "ex/group.gif" title="Click to see the example script" alt=
    "group example" /></a></p>

    <h4>See also</h4>

    <p><a href="rvg.html">RVG</a></p>
  </div>

  <h2 class="methods">attributes</h2>

  <div class="sig">
    <h3 id="desc">desc, desc=</h3>

    <p><span class="arg">group</span>.desc -&gt;
    <em>string</em><br />
    <span class="arg">group</span>.desc = <span class=
    "arg">string</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Use the <code>desc</code> attribute to
    assign a text description to the group.
  </div>

  <div class="sig">
    <h3 id="metadata">metadata, metadata=</h3>

    <p><span class="arg">group</span>.metadata -&gt;
    <em>string</em><br />
    <span class="arg">group</span>.metadata = <span class=
    "arg">string</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Use the <code>metadata</code> attribute to
    assign additional metadata to the group.
  </div>

  <div class="sig">
    <h3 id="RVG_title">title, title=</h3>

    <p><span class="arg">group</span>.title -&gt; <span class=
    "arg">string</span><br />
    <span class="arg">group</span>.title = <span class=
    "arg">string</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Use the <code>title</code> attribute to
    assign a title to the group.
  </div>

  <h2 class="methods">instance methods</h2>

  <div class="sig">
    <h3 id='g'>g</h3>

    <p><span class="arg">group.</span>g [{|<span class=
    "arg">grp</span>| ...}] -&gt; <em>group</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Calls <a href="#new">new</a> to construct a new group and
    nests it within the target group. Yields to a block if one is
    present, passing the new group as an argument.</p>

    <h4>Returns</h4>

    <p>Returns the new group, so other methods in this class can be
    chained to this method.</p>
  </div>

  <div class="sig">
    <h3 id='image'>image</h3>

    <p><span class="arg">group.</span>image(<span class=
    "arg">raster_image</span>, <span class="arg">width</span>=nil,
    <span class="arg">height</span>=nil, <span class=
    "arg">x</span>=0, <span class="arg">y</span>=0) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Calls <a href="rvgimage.html#new">RVG::Image.new</a> to
    construct an image and adds it to the group.</p>

    <h4>Returns</h4>

    <p>Returns the new image, so <code>RVG::Image</code> methods
    can be chained to this method.</p>
  </div>

  <div class="sig">
    <h3 id="rvg">rvg</h3>

    <p><span class="arg">group</span>.rvg(<span class=
    "arg">width</span>, <span class="arg">height</span>,
    <span class="arg">x</span>=0, <span class="arg">y</span>=0)
    [{|<span class="arg">new_rvg</span>| ...}] -&gt;
    <em>rvg</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Calls <a href="rvg.html#RVG_new">RVG.new</a> to construct a
    new RVG object and adds it to the group. See the <a href=
    "rvg.html#RVG_rvg">rvg</a> method in the RVG class.</p>

    <h4>Returns</h4>

    <p>The <code>RVG</code> object, so other <code>RVG</code>
    methods can be chained to this method.</p>
  </div>

  <div class="sig">
    <h3 id='text'>text</h3>

    <p><span class="arg">group.</span>text(<span class=
    "arg">x</span>=0, <span class="arg">y</span>=0, <span class=
    "arg">text</span>=nil) [{|<span class="arg">text</span>| ...}]
    -&gt; <em>text</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Calls <a href="rvgtext.html#new">RVG::Text.new</a> to
    construct a text object and adds it to the group. Yields to a
    block if one is present, passing the new text object as an
    argument.</p>

    <h4>Returns</h4>

    <p>The <code>RVG::Text</code> object, so other
    <code>RVG::Text</code> methods can be chained to this
    method.</p>
  </div>

  <div class="sig">
    <h3 id="use">use</h3>

    <p><span class="arg">group</span>.use(<span class=
    "arg">obj</span>, <span class="arg">x</span>=0, <span class=
    "arg">y</span>=0, <span class="arg">width</span>=nil,
    <span class="arg">height</span>=nil) -&gt; <em>use</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Calls <a href="rvguse.html#new">RVG::Use.new</a> to
    constructs a <code>use</code> object and adds it to the RVG
    object.</p>

    <p>When the referenced argument is an RVG object, <span class=
    "arg">width</span> and <span class="arg">height</span> can be
    used to specify the width and height of the viewport. If
    present and non-nil, these arguments override any width and
    height specified when the RVG object was created. You must
    specify the viewport size either when creating the RVG object
    or when referencing it with <code>use</code>.</p>

    <h4>Example</h4>

    <p>See <a href="rvguse.html#new">RVG::Use.new</a></p>

    <h4>Returns</h4>

    <p>The <code>RVG::Use</code> object, so other
    <code>RVG::Use</code> methods can be chained to this
    method.</p>
  </div>

  <p class="spacer">&nbsp;</p>

  <div class="nav">
    &laquo; <a href="rvg.html">Prev</a> | <a href=
    "index.html">Contents</a> | <a href="rvgimage.html">Next</a>
    &raquo;
  </div>
</body>
</html>