WrapValue
Value# = WrapValue(Value#, Min#, Max#)
 
Parameters:

    Value# = The Value you want to wrap
    Min# = The lower wrap range
    Max# = The higher wrap range
Returns:

    Value# = The value wrapped within the range
 

      The WrapValue function wraps a value within a range. For example, when a value exceeds the max range, it wraps around from the Min side and vice versa.




Mini Tutorial:


      This example wraps the X coordinates as plots the series of pixels down the screen.


  
  
  For ylp=0 To GetScreenHeight()
     
     // wrap the Y value within the 100,200)
     Xpos=WrapValue(Xpos+1,100,200)
     
     // draw this dot
     Dot Xpos,Ylp
  Next
  
  Sync
  WaitKey
  





 
Related Info: ClipRange | ClipRange# | Mod | Sprites | WrapAngle :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com