SetBackground()

Example 1:

To set the Background style on the NormalObject State for a Text object named Intro to solid with an opacity of 50% and a colour of blue, use the following syntax:

var new_style = new Object()
new_style.style = "solid"
new_style.colour = RGB(0,0,255)
Intro.SetBackground(new_style)

Example 2:

To set the same Background style as Example 1 above on the Mouse Over Object State for a Text object named Intro, use the following syntax:

var new_style = new Object()
new_style.style = "solid"
new_style.colour = RGB(0,0,255)
createEffect = Intro.GetAppearance("Mouse Over")
createEffect.SetBackground(new_style)

Example 3:

To set the Background style for a Text object named Intro to a 3 colour spiral (leaving the bands and offset as they were), use the following syntax:

var new_style = new Object();
new_style.style = "spiral";
new_style.colour = new Array();
new_style.colour[0] = RGB(128, 0, 0);
new_style.colour[1] = RGB(0, 128, 0);
new_style.colour[2] = RGB(0, 0, 128);
new_style.twist = 0.2;
Intro.SetBackground(new_style);

Note:
In Example 3, the colours are created using an array.

Example 4:

To rotate the angle of a background by 5 degrees, use the following syntax:

var new_style = new Object();
new_style.angle = 0;
while (true)
{
Frame_2.SetBackground(new_style);
new_style.angle += 5;
wait(0.1);
}

 

see also:RemoveBackground, RGB and GetAppearance

Close