In addition to the methods listed above, class
RVG::Group
also implements the styles method, the shape methods and the transform methods.
RVG::Group.new [ { |self| drawing method calls } ] -> group
Drawing objects defined within a group share the transforms
and styles defined on the group. Groups can be nested
arbitrarily deep. RVG::Group.new
is commonly
invoked within another group or RVG object by calling the
g
method (RVG#g,
RVG::Group#g) , which nests the group within
the target object.
RVG::Group.new
yields to a block if one is
present, passing self
as an argument.
An RVG::Group
object
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 use method.
group.desc ->
string
group.desc = string
desc
attribute to
assign a text description to the group.
group.metadata ->
string
group.metadata = string
metadata
attribute to
assign additional metadata to the group.
group.title -> string
group.title = string
title
attribute to
assign a title to the group.
group.g [{|grp| ...}] -> group
Calls new 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.
Returns the new group, so other methods in this class can be chained to this method.
group.image(raster_image, width=nil, height=nil, x=0, y=0) -> image
Calls RVG::Image.new to construct an image and adds it to the group.
Returns the new image, so RVG::Image
methods
can be chained to this method.
group.rvg(width, height, x=0, y=0) [{|new_rvg| ...}] -> rvg
Calls RVG.new to construct a new RVG object and adds it to the group. See the rvg method in the RVG class.
The RVG
object, so other RVG
methods can be chained to this method.
group.text(x=0, y=0, text=nil) [{|text| ...}] -> text
Calls RVG::Text.new 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.
The RVG::Text
object, so other
RVG::Text
methods can be chained to this
method.
group.use(obj, x=0, y=0, width=nil, height=nil) -> use
Calls RVG::Use.new to
constructs a use
object and adds it to the RVG
object.
When the referenced argument is an RVG object, width and height 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 use
.
See RVG::Use.new
The RVG::Use
object, so other
RVG::Use
methods can be chained to this
method.