Group2D.AddAt

From Xojo Documentation

Method

Group2D.AddAt(Index as Integer, Object as Object2D)

New in 2019r2

Supported for all project types and targets.

Adds the object passed to it at the specified location.

Sample Code

This example adds text as the second object in the Group2D.

Var px As PixmapShape
Var t As TextShape
Var t2 As TextShape
Var d As New Group2D
Var o As New Object2D

px = New PixmapShape(DSC_0343)
d.Add(px)

t = New TextShape
t.Y = 70
t.Value = "This is what I call a REAL car!"
t.FontName = "Helvetica"
t.IsBold = True
d.Add(t)

t2 = New TextShape

t2.Y = 20
t2.Value = "This is inserted text!"
t2.FontName = "Helvetica"
t2.IsBold = True
d.AddAt(1, t2)

g.DrawObject(d, 100, 100)