Lingo Dictionary > O-R > offset() (rectangle function) |
![]() ![]() ![]() |
offset() (rectangle function)
Syntax
rectangle.offset(
horizontalChange
,
verticalChange
)
offset (
rectangle
,
horizontalChange
,
verticalChange
)
Description
Function; yields a rectangle that is offset from the rectangle specified by rectangle
. The horizontal offset is the value specified by horizontalChange
; the vertical offset is the value specified by verticalChange
.
![]() |
When |
![]() |
When |
The values for verticalChange
and horizontalChange
are in pixels.
Example
This handler moves sprite 1 five pixels to the right and five pixels down.
on diagonalMove newRect=sprite(1).rect.offset(5, 5) sprite(1).rect=newRect end
![]() ![]() ![]() |