Realbasic.Rect.Constructor(X As Integer, Y As Integer, Width As Integer, Height As Integer)

From Xojo Documentation

Revision as of 13:02, 22 October 2018 by PLefebvre (talk | contribs) (Created page with "{{ConstructorBox | name=Constructor | owner=Realbasic.Rect | newinversion = 2011r2 | parameters = X As Integer, Y As Integer, Width As Integer, Height As Int...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Constructor
Realbasic.Rect.Constructor(X As Integer, Y As Integer, Width As Integer, Height As Integer)

Creates a Realbasic.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 Realbasic.Rect(0, 0, 100, 75)
rectTwo = New Realbasic.Rect(Self.Width - 100, Self.Height - 75, 100, 75)

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