Using Visual Effects

Another way to improve your UI and make using your application a more pleasant experience for the user is to use visual effects. A visual effect is a special effect that is used when changes are made to the display.

LiveCode supports visual transition effects when changing card, updating the screen or hiding and showing objects.

There are three types of effect support: built-in effects which work on all platforms, QuickTime effects which work on systems that have QuickTime installed and Core Image effects which work on Mac OS 10.4 or later.

Updating Multiple Objects on Screen

Updating Multiple Objects on Screen

If you want to update multiple objects on screen without the user seeing all the changes you can use the lock screen command. Locking the screen temporarily prevents screen updates, when you unlock the screen all the changes are shown.

on mouseUp

lock screen

hide field 1

hide button "one"

hide button "two"

hide button "three"

show image "LiveCode"

unlock screen

end mouseUp

If you want to  use a visual effect to show the screen updates after a lock screen use the form:

on mouseUp

lock screen for visual effect

hide field 1

hide button "one"

hide button "two"

hide button "three"

show image "LiveCode"

unlock screen with visual effect dissolve

end mouseUp

Showing and Hiding Objects

Showing and Hiding Objects

You can use a visual effect when updating the screen by showing and hiding objects.

Create a stack and add a field. In the message box execute the command:

hide field 1 with visual effect dissolve

Changing Cards

Changing Cards

You can also use a visual effect when moving between cards.

You specify the visual effect you want to use and then use the go command to change cards.

on mouseUp

visual effect push left

go next card

end mouseUp

 

The Visual Effect Command

The visual effect command allows you to specify an effect to be used the next time there is a move to another card. You specify the effect name and can optionally specify a speed, final image, audio clip and style (iOS only).

When you issue a visual effect command, it is stored to be used the next time you navigate to another card. Usually, you place the visual effect command immediately before these commands. However, it is not necessary to execute the navigation command immediately; the visual effect is stored and used the next time you navigate. You can even issue a visual effect command in one handler and the navigation command in another handler. All visual effects are cleared when all pending handlers exit.

0 Comments

Add your comment

E-Mail me when someone replies to this comment