Blur – Examples

Example 1 Blur Checkbox

This example is a script which might be attached to a checkbox button for setting or removing the blur from an object called image1. It suppose the properties of the checkbox button have been used to link it to the variable checkbox_Blur. Opus will automatically set this variable to true whenever the button is down (On).

The script sets the Blur to 6 pixels in the horizontal (left to right) and 3 in the vertical direction and to a quality setting of 3.

 

if (checkbox_Blur==true)

{

image1.SetBlur(6,3,3)

}

else

{

image1.RemoveBlur()

}

Example 2: Motion Blur Animation

This script uses a blur in just the horizontal direction to suggest motion blur as the object (called toonCar) animates horizontally too. Both the amount the car animates and the amount of blur are increased by using a counter. A smoother effect could be achieved by using smaller increments or by putting individual blur and move actions into a simultaneous action group.

 

var blurVal=1

 // this line sets the initial blur amount

var aniVal=10

 // this line sets the initial amount to move by

counter=0

 // this line resets the counter for the loop

 

while(counter<=10)

  // this line sets a loop until the counter reaches 10.

{

toonCar.SetBlur(blurVal,0,3)

toonCar.Move(aniVal,0,0.1)

blurVal++

 // this line increases the blur amount by 1 each time round the loop

aniVal+=counter*2

 // this line increases the amount to animate by the counter value multiplied by 2

counter++

}

 

Example 3: Blur Reveal

This example supposes a quiz reveal situation in which points are scored for guessing the blurred object before it is finally reveals. It supposes that an image called "imgQ1" is on the page but is set to be initially hidden . The script sets the blur to maximum