Xojo.Core.Rect.Offset

From Xojo Documentation

Method

Xojo.Core.Rect.Offset(DeltaX As Integer, DeltaY As Integer) As Xojo.Core.Rect

Supported for all project types and targets.

A new rect offset by the specified values.


Method

Xojo.Core.Rect.Offset(Delta As Xojo.Core.Point) As Xojo.Core.Rect

Supported for all project types and targets.

A new rect offset by the specified delta point.

Sample Code

Var rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
Var rect2 As Xojo.Core.Rect
rect2 = rect1.Offset(50, 50)
Var rect1 As New Xojo.Core.Rect(10, 10, 100, 100)
Var p As New Xojo.Core.Point(50, 50)
Var rect2 As Xojo.Core.Rect
rect2 = rect1.Offset(p)