Rect.Constructor(X As Double, Y As Double, Width As Double, Height As Double)

From Xojo Documentation

Revision as of 22:40, 24 June 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Constructor

Rect.Constructor(X As Double, Y As Double, Width As Double, Height As Double)

New in 2019r2

Creates a Rect object at X,Y and the passed width and height.

Sample Code

This example is from the Rects example that is covered in the Notes section of the Rect class. The Open event of the main window contains constructors that appear in the top-left and bottom-right corners of the main window.

// Start by defining our two rectangles. Both will be 100 x 75.
// RectOne will be in the upper left. RectTwo will be in the lower right.
rectOne = New Rect(0, 0, 100, 75)
rectTwo = New Rect(Self.Width - 100, Self.Height - 75, 100, 75)

// Fill our point classes to avoid NilObjectException errors.
mousePosition = New Point(-1, -1)
mouseOffset = New Point(0, 0)