Latest OxygenBasic.zip at GitHub (Click on the Wizard)
0 Members and 1 Guest are viewing this topic.
include "win64.inc"window "Constrain Demo",640,490,2font 12,24,0,"courier"function Constrain(single xb,mi,ma) as singleif xb > mi and xb < ma then return xbelseif xb < mi then return mielseif xb < ma then return maend if end functionsingle x, y=200, aWhile EscKey()=0ClsColor 0,0,0'bouncing bally=200 + 50 * SIN(x/16)Oval x,y,30,30,255,0,0a = Constrain(x,0,Width)Text 0,0,"constrain: " + str(a,0),255,255,255IF Constrain(x,0,Width) > 0 x = x + 0.15Else x=0 END IF FlipBuffer'WaitFor 80WendWinEnd