lessThanEquals
Purpose
Less than or equal operator <=
Description
This is true if the value of first expression is less than or equal to the value of the second
Syntax
result = expression1 <= expression2
Arguments
result true if value of expression1 is less or equal to the value of expression2
expression1 first expression
expression2 second expression
Example
pos = { 960, 540 }
vel = { 0, 0 }
col = { 1, 0, 0, 1 }
rt = createImage( 1920, 1080, true, image_rgb )
loop
c = controls( 0 )
vel += { c.lx, -c.ly }
pos += vel
vel *= 0.95
if col.r > 0 and col.b <= 0 then
col.r -= 0.01
col.g += 0.01
else
if col.g > 0 then
col.g -= 0.01
col.b += 0.01
else
col.b -= 0.01
col.r += 0.01
endIf
endIf
setDrawTarget( rt )
box( 0, 0, 1920, 1080, { 0, 0, 0, 0.25 }, false )
circle( pos.x, pos.y, 50, 32, col, false )
setDrawTarget( framebuffer )
clear()
renderEffect( rt, framebuffer, fx_motionblur, [ 1 / 1920, 1 / 1080, vel.x / 2, vel.y / 2 ] )
update()
repeat
Associated Commands
equals, lessThan, greaterThan, lessThanEquals, greaterThanEquals, notEquals