This command will return a value that does not exceed a range of 0 - 360.


dbWrapValue( Angle );


If the Angle given exceeds 359, the command will wrap the value around to bring it back within the range. This command is best understood by using the number of a clock as a mental picture of how a number wraps. If the clock hand points to 11 and is then advanced 2 hours, the number has to wrap from 12 around to 1 to keep the cycle going.

For example:

dbWrapValue ( 90 );

will return a value of 90, but

dbWrapValue ( 361 );

will return a value of 1; the angle has come complete circle from 360 to start back at 1. This command can be very helpful when used in combination with dbRotateSprite.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.