Group2D

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object2D)

Used to group Object2D objects.

Properties
Count Rotation Scale
Methods
AddObject Item RemoveObjectAt
AddObjectAt RemoveObject

Notes

Use the Objects property of the Picture class to associate a Group2D object with a picture and the DrawObject method of the Graphics class to draw the object.

A Group2D is a container for Object2D shapes (including other Group2Ds). When a Group2D is rotated, translated, or scaled, all of its contents are updated accordingly. This means that all objects use the same coordinate system, but you can quickly transform an entire set of objects by transforming their group.

Sample Code

This code adds a PixMapShape and a StringShape to the Group2D object and displays it in the window. The code is in the Paint event. The picture DSC_0343 has been added to the Project.

Var px As PixmapShape
Var t As TextShape
Var d As New Group2D

px = New PixmapShape(DSC_0343) // added to the project
d.AddObject(px)

t = New TextShape
t.Y=70
t.Value = "This is what I call a REAL car!"
t.FontName="Helvetica"
t.Bold = True
d.AddObject(t)
g.DrawObject(d, 100, 100)

See Also

ArcShape, CurveShape, FigureShape, FolderItem, Graphics, OvalShape, Picture, PixmapShape, RectShape, RoundRectShape, TextShape classes.