chickadee » sdl2 » rect-move

rect-move rect dx dyprocedure
rect-move! rect dx dy #!optional destprocedure

Efficiently move rect by adding the given amounts to its X and Y values. dx and dy must be integers. The results will be clamped to the range -2147483648 to 2147483647.

If dx and dy are already stored in an sdl2:point, it is more efficient and convenient to use rect-add-point or rect-sub-point, instead of extracting the individual fields from the point.

  • rect-move returns a new managed sdl2:rect.
  • rect-move! modifies and returns dest. If dest is omitted, rect is modified and returned.

These procedures are available in sdl2 egg version 0.2.0 and higher.