Action: Restrictx(target, min, max)

Related Actions: move, moveto, movebyx, movebyy, movetorand, moverandy, restricty, letinitx, letinity, letobjectx, letobjecty
See also: FKiSS, Events, Actions

restrictx(target, min, max)

First defined in: FKiSS4
The restrictx action changes the horizontal movement limits of target to the absolute range of min to max. If target is outside of that range, it is moved to the closest position within that range. If min is greater than max, any previous bounding set by restrictx is cancelled.
The vertical position of target is not affected.
This action takes precedence over any bounding limits set by the user options for a viewing program.

target

In FKiSS4, target may be an object number or a variable representing an object number.

min

In FKiSS4, min may be number or a variable.

max

In FKiSS4, max may be number or a variable.

Example:

;@ restrictx(#5, 5, 105)        ; Restricts horizontal movement of object #5 to the range of 5 and 105 pixels.
;@ restrictx(VarObj, Low, High) ; Restricts horizontal movement of object identified by variable VarObj to the range of Low and High pixels.
;@ restrictx(#17, 100, 0)       ; Cancels horizontal movement restriction on object #17.