Assign boundaries

There are two kinds of boundary: horizontal, and vertical. These boundaries could be assign in three ways.

1. In properties bar,

Horizontal: "Horizontal" property to "Yes", and configure the "Left", "Right" bound

Vertical: "Vertical" property to "Yes", and configure the "Top", "Bottom" bound

2. Assign boundaries by "Set horizontal boundary" and "Set vertical boundary" actions.

3. Assign boundaries related by image points of other object by "Set horizontal boundary to", "Set vertical boundary to" actions.

Clamp

Set "Mode" to "Clamp" could clamp the position of object in the boundary.

Set "Align" to "Boundaries" could clamp the object according to the boundaries of this object, or

Set "Align" to "Origin", to clamp this object according to origin point (i.e. instance's XY position) of this object.

Wrap

Set "Mode" to "Wrap". The object which has left out one boundary, will be reappear at the other side.

Set "Align" to "Boundaries" will do wrapping until whole object has left out the boundary. This behavior is similar to official Wrap behavior.

Set "Align" to "Origin" will do wrapping when the origin point of this object has left out the boundary.

Mode wrap

Set "Mode" to "Mod wrap". The object which has left out one boundary, will be reappear at the other side, with an offset to keep the moving distance.

For example, if this instance moved out of left bound with offset to -10 pixels, i.e. (left - 10), it would be wrapped to right bound with offset to -10 pixels, i.e. (right - 10).

Property "Align" of this mode only supports "Origin".

Percentage

You can get a value between 0 to 1 mapped from left boundary to right boundary, or top boundary to bottom boundary by "HorPercent" (left-right), or "VerPercent" (top-bottom) expressions.

"HorScale" and "VerScale" expressions are advance expressions, they will map the percentage value to another value.

This feature might be useful while making a value input interface by scrolling.

Get position by percentage of boundaries

Get position X/Y from percentage (0-1) of horizontal / vertical boundaries by "HorPercent2PosX" / "HorPercent2PosY" expressions.

Download

1.1 Stable (13.42 KB)

Info

  • License MIT License
  • Copyright Rex.Rainbow. All rights reserved.

Statistics

  • Download count107 total downloads
  • Latest download count 41 downloads of latest version
  • Average download count1 downloads per day average

Owners

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!